rotors_simulator icon indicating copy to clipboard operation
rotors_simulator copied to clipboard

Install libmav_msgs.so

Open sloretz opened this issue 6 years ago • 19 comments

All of the gazebo plugin targets depend on libmav_msgs.so. This PR makes sure that library gets installed so the gazebo plugins work from the install space.

Without this PR running roslaunch rotors_gazebo three_multicopters_hovering_example.launch with the install space sourced results in:

[Err] [Plugin.hh:180] Failed to load plugin librotors_gazebo_multirotor_base_plugin.so: libmav_msgs.so: cannot open shared object file: No such file or directory
[Err] [Plugin.hh:180] Failed to load plugin librotors_gazebo_motor_model.so: libmav_msgs.so: cannot open shared object file: No such file or directory
[Err] [Plugin.hh:180] Failed to load plugin librotors_gazebo_motor_model.so: libmav_msgs.so: cannot open shared object file: No such file or directory
[Err] [Plugin.hh:180] Failed to load plugin librotors_gazebo_motor_model.so: libmav_msgs.so: cannot open shared object file: No such file or directory
[Err] [Plugin.hh:180] Failed to load plugin librotors_gazebo_motor_model.so: libmav_msgs.so: cannot open shared object file: No such file or directory
[Err] [Plugin.hh:180] Failed to load plugin librotors_gazebo_controller_interface.so: libmav_msgs.so: cannot open shared object file: No such file or directory
[Err] [Plugin.hh:180] Failed to load plugin librotors_gazebo_imu_plugin.so: libmav_msgs.so: cannot open shared object file: No such file or directory
[Err] [Plugin.hh:180] Failed to load plugin librotors_gazebo_imu_plugin.so: libmav_msgs.so: cannot open shared object file: No such file or directory
[Err] [Plugin.hh:180] Failed to load plugin librotors_gazebo_odometry_plugin.so: libmav_msgs.so: cannot open shared object file: No such file or directory
[Err] [Plugin.hh:180] Failed to load plugin librotors_gazebo_odometry_plugin.so: libmav_msgs.so: cannot open shared object 
file: No such file or directory

sloretz avatar Jun 20 '18 00:06 sloretz

Can one of the admins verify this patch?

ethzasl-jenkins avatar Jun 20 '18 00:06 ethzasl-jenkins

ok to test

ffurrer avatar Aug 28 '18 08:08 ffurrer

Should this not be fixed in mav_msgs?

ffurrer avatar Aug 28 '18 08:08 ffurrer

The last merge in master did not correct the #556 issue. @ffurrer or @michaelpantic could you consider merging this PR ? It's really annoying to not be able to use the package from the melodic ROS depot.

Thanks a lot.

aeudes avatar Apr 10 '19 19:04 aeudes

Should this not be fixed in mav_msgs?

@ffurrer I don't think so. The library target is named mav_msgs, but does not come from mav_comm/mav_msgs. It is created here:

https://github.com/ethz-asl/rotors_simulator/blob/748268f9a11f6473cfeb55827459cea1e1d7b2d5/rotors_gazebo_plugins/CMakeLists.txt#L205-L212

sloretz avatar Apr 10 '19 20:04 sloretz

@aeudes Hm, are we talking about a build from source or a installation using apt-get here?

If its installed from source I can't really reproduce the problem (were having plenty of people running melodic and rotors). If its installed using apt-get, that will take some time to debug, and release. The current melodic packages are still in a devel state, so I recommend you just use the source build.

michaelpantic avatar Apr 10 '19 20:04 michaelpantic

Also, the ros melodic packages are not updated nearly as often as the source master. E.g. the current ros melodic packages in the ros.org repos were built last time sometime in january.

michaelpantic avatar Apr 10 '19 20:04 michaelpantic

If its installed from source I can't really reproduce the problem (were having plenty of people running melodic and rotors)

@michaelpantic I don't have a workspace at the moment, but when I faced this I was building from source. The problem happens when using the install space instead of devel space. Hopefully these commands are close to copy/pastable for you.

cd ~/my_catkin_ws
catkin_make_isolated --install-space ./install --install

then in another terminal

. ~/my_catkin_ws/install/setup.bash
roslaunch rotors_gazebo three_multicopters_hovering_example.launch

sloretz avatar Apr 10 '19 20:04 sloretz

@sloretz Thanks a lot for that info! We actually never use the install space feature (or I never came across someone using it), that's why we never had that issue.

Before I merge this into master I'd like to test if it has any side effects in the updated build configuration for the different gazebo versions (we're supporting quite a few in parallel, which sometimes causes simple changes to break lots of builds), so that will take some time. In any case I'll try to include that in an upcoming release, as it seems to be needed anyway. It might take quite some time to run through all the process and testing to get it running, so again, can't promise a timeline for when this actually finds its way into the binary ros packages that are easy to install.

michaelpantic avatar Apr 10 '19 21:04 michaelpantic

This issue is not visible if you built by source or if you install package on a machine where it was also compile by source. But on machine with only package, a library is missing. This library, contain the protobuf message that are used by rotors_gazebo_plugin and it is build in rotors gazebo plugin but not mark for installation. To convince yourself that this PR is needing you could check that any gazebo plugin is linked to libmav_msgs.so :

ldd librotors_gazebo_motor_model.so
libmav_msgs.so => not found

and the lib is not present in install space (I am pretty sure that it is not present in devel space neither but only in build space but i have not a workspace right now) and it is not export to the package (you could check on the install file list of the package).

I don't have any problem with more testing/caution, and I aware for release cycle/delay on package. I just want to be sure that this issue is not ignored as it make the package unusable and it is not trivial to detect (worked if source are built on the machine and gazebo silently failed but did not load plugins). You did a great worked by releasing the ROS package and it makes rotors installation painless for user that did not need to develop on rotors and it's that a pity if it is not usable. And at the moment, at our lab, we use packages and install by hand the missing library.

Let me know if I could provide more information or help.

aeudes avatar Apr 10 '19 22:04 aeudes

Hi there -- I had this problem as well when working from the install space. Either manually copying the library to ./install/lib or adding

list(APPEND targets_to_install mav_msgs)

appears to resolve it. For reference, I'm using the following to build/run:

catkin config --install
catkin build
source ./install/setup.bash
roslaunch rotors_gazebo three_multicopters_hovering_example.launch

idlebear avatar Jul 25 '19 14:07 idlebear

Friendly poke, are there any changes that need to be made to this PR before it can be merged?

sloretz avatar Aug 28 '19 15:08 sloretz

Hi all! I'm working to make compatible my two ROS packages, CrazyS and BebopS (they use RotorS as a basis), with Gazebo 9 and ROS Kinetic (here #586 the previous discussion). Although I spent a lot of time to solve compiling issues (I will publish the instructions list as soon as possible), when I start the simulation any feedback comes from Gazebo. Thus, the drone does not take off.

I tried what was suggested in this discussion, but it does not work for me (with and without install). Any suggestion on how to handle the problem is welcomed.

gsilano avatar Dec 17 '19 16:12 gsilano

Hi all! As you can see from the references above, I solved the problem (at least in my case). Please, take a look at my CrazyS and BebopS repositories.

gsilano avatar Dec 28 '19 16:12 gsilano

Bump @maxb91 @rikba ? maybe this one could finally be merged as #626 show that is it still relevant and gsilano/CrazyS@86d80d3 integration prove no catastrophic failure.

aeudes avatar Aug 14 '20 11:08 aeudes

Friendly ping :)

sloretz avatar Oct 19 '20 22:10 sloretz

well, this got forgotten quit a bit. I'll run it again through our buildfarm and if it builds we'll just merge it.

michaelpantic avatar Jan 22 '21 17:01 michaelpantic

test this please

michaelpantic avatar Jan 22 '21 17:01 michaelpantic

@sloretz can you merge in current master? It changed quite a bit build wise /dependency wise. just to make sure we're not breaking things.

michaelpantic avatar Jan 22 '21 17:01 michaelpantic