Home | Tutorials | Wiki | Issues
Ask Your Question
2

installing gazebo_ros_pkgs for groovy

asked 2013-07-16 06:24:42 -0600

updated 2013-07-17 04:35:06 -0600

Hi,

today i tried to reinstall gazebo and gazebo_ros_pkgs following the current instructions. Gazebo compiles and runs without any problems. but when i tried to compile gazebo_ros_pkgs I ran into a couple of problems.

1st missing shared objects in the precompiled ubuntu package

when I called catkin_make to compile the gazebo_ros_pkgs there where at least one missing .so file:

/usr/bin/ld: cannot find -lgazebo_sdf_interface

so i tried compiling from src witch leaded to other problems

2nd rosdep installs gazebo-prerelease

the command rosdep install --from-paths src --ignore-src --rosdistro groovy -y installs

gazebo-prerelease and sdformat debian packages.

this should probably not happen... but can be easily undone, with apt-get remove...

3rd when I try to run catkin_make I get an error about redefinition of classes.

In file included from /usr/local/include/gazebo-1.9/gazebo/sdf/interface/SDF.hh:25:0, from /usr/local/include/gazebo-1.9/gazebo/sdf/sdf.hh:21, from /usr/local/include/gazebo-1.9/gazebo/physics/State.hh:26, from /usr/local/include/gazebo-1.9/gazebo/physics/ModelState.hh:30, from /usr/local/include/gazebo-1.9/gazebo/physics/Model.hh:31, from /usr/local/include/gazebo-1.9/gazebo/physics/Actor.hh:24, from /usr/local/include/gazebo-1.9/gazebo/physics/physics.hh:2, from $HOME/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/include/gazebo_plugins/gazebo_ros_block_laser.h:37, from $HOME/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/src/gazebo_ros_block_laser.cpp:26: /usr/local/include/gazebo-1.9/gazebo/sdf/interface/Param.hh:50:9: error: redefinition of ‘class sdf::Param’ /usr/include/sdf-1.4/sdf/Param.hh:52:9: error: previous definition of ‘class sdf::Param’

currently I don't know how to fix this problems. I would be happy if some one could point me in the right direction...

Thx

Benjamin

edit retag flag offensive close merge delete

Comments

In your ~/catkin_ws/build/CMakeCache.txt, add the following code (search INTERNAL cache entries): https://gist.github.com/anonymous/6022853 - try again catkins_make.

EduardoMaciel gravatar imageEduardoMaciel ( 2013-07-17 12:59:34 -0600 )edit

4 Answers

Sort by » oldest newest most voted
0

answered 2013-07-18 06:28:23 -0600

Hi again,

after switching to the branch gazebo_1.9 the old error disappeared and now i get an error about a missing SDF.hh header and a lot of other things

/home/user/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/src/gazebo_ros_bumper.cpp:31:22: fatal error: sdf/SDF.hh: No such file or directory compilation terminated. /home/user/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/src/gazebo_ros_camera_utils.cpp:34:22: fatal error: sdf/SDF.hh: No such file or directory compilation terminated. /home/user/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/src/gazebo_ros_block_laser.cpp:31:22: fatal error: sdf/SDF.hh: No such file or directory compilation terminated.

I'm currently confused how this can compile on other installations...

a lot of plugins seem to include <sdf/SDF.hh> (for example gazebo_ros_block_laser.cpp) but neither gazebo nor sdformat seems to have a file in this path gazebo has <sdf/interface/SDF.hh> and sdformat has no SDF.hh.

when using the SDF.hh from gazebo catkin was trying to use the sdf includes from gazebo...

after further investigations I recognized that gazebo is not using any of the src in the gazebo/sdf directory anymore, so removed the gazebo sdf directory in my include path and replaced all occurrences of sdf/SDF.hh with sdf/sdf.hh

this seems to have solved the Problem. I'm not sure how this is supposed to work

I will now do some tests with my current solution and mark the Question as solved if no unexspected behaviour occurs....

edit flag offensive delete link more

Comments

In your ~/catkinws/build/CMakeCache.txt, add the following code (search INTERNAL cache entries): https://gist.github.com/anonymous/6022853 - try again catkinsmake.

EduardoMaciel gravatar imageEduardoMaciel ( 2013-07-18 14:44:07 -0600 )edit

this might be an error from intermediate releases, can you try sudo apt-get update sudo apt-get install gazebo to install latest gazebo 1.9.0 and try catkin_make again from scratch? This should have been fixed.

hsu gravatar imagehsu ( 2013-07-25 19:33:08 -0600 )edit

@hsu Hi,

the SDF.hh error is definitively fixed in the repo...

I am not sure about the copied directory of the current gazebo-src realease... but I guess the files aren't copied anymore. I don't know if this Problem occurres when using the precompiled gazebo-prerealese version...

maybe I try to install everything from source again next week but I'm not sure if I find the time for that.

evilBiber gravatar imageevilBiber ( 2013-07-26 03:39:00 -0600 )edit
1

answered 2013-07-18 05:32:27 -0600

Zeyn gravatar image

updated 2013-07-18 05:40:43 -0600

OK so I've also updated all my source repositories, and had to fix the missing SDF.hh error which seems to be due to the SDF repository removing the file SDF.hh. So I changed the includes in the files gazebo_ros_block_laser.cpp, gazebo_ros_bumper.cpp, and gazebo_ros_camera_utils.cpp to

#include <sdf/sdf.hh>

Then I still get the redefinition of ‘class sdf::Param’ error. How is this supposed to work? Should Gazebo even have a Param.hh file in its source repo? Here are the latest source files:

Latest version of gazebo/physics/State.hh https://bitbucket.org/osrf/gazebo/src/dd765457ec03337cf12fa75ce8327674e6c8d79c/gazebo/physics/State.hh?at=default includes "gazebo/sdf/sdf.hh"

Latest version of gazebo/sdf/sdf.hh https://bitbucket.org/osrf/gazebo/src/dd765457ec03337cf12fa75ce8327674e6c8d79c/gazebo/sdf/sdf.hh?at=default includes "gazebo/sdf/interface/Param.hh"

groovy-devel branch version of /gazebo_ros_pkgs/gazebo_plugins/include/gazebo_plugins/gazebo_ros_block_laser.h https://github.com/ros-simulation/gazebo_ros_pkgs/blob/groovy-devel/gazebo_plugins/include/gazebo_plugins/gazebo_ros_block_laser.h

#include <sdf/Param.hh>
  • which is the conflicting file from /usr/include/sdformat-1.4/sdf/Param.hh rather than "gazebo/sdf/interface/Param.hh"

Output of normal catkin_make run:

Built target gazebo_plugins_gencfg
Scanning dependencies of target gazebo_ros_camera_utils
[ 70%] Building CXX object gazebo_ros_pkgs/gazebo_plugins/CMakeFiles/gazebo_ros_block_laser.dir/src/gazebo_ros_block_laser.cpp.o
[ 70%] Building CXX object gazebo_ros_pkgs/gazebo_plugins/CMakeFiles/gazebo_ros_bumper.dir/src/gazebo_ros_bumper.cpp.o
[ 70%] Building CXX object gazebo_ros_pkgs/gazebo_plugins/CMakeFiles/gazebo_ros_camera_utils.dir/src/gazebo_ros_camera_utils.cpp.o
In file included from /home/zeyn/Dropbox/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/src/gazebo_ros_bumper.cpp:32:0:
/usr/include/sdformat-1.4/sdf/Param.hh:52:9: error: redefinition of ‘class sdf::Param’
/usr/local/include/gazebo-1.9/gazebo/sdf/interface/Param.hh:52:9: error: previous definition of ‘class sdf::Param’
In file included from /usr/local/include/gazebo-1.9/gazebo/sdf/interface/SDF.hh:25:0,
                 from /usr/local/include/gazebo-1.9/gazebo/sdf/sdf.hh:21,
                 from /usr/local/include/gazebo-1.9/gazebo/physics/State.hh:26,
                 from /usr/local/include/gazebo-1.9/gazebo/physics/ModelState.hh:30,
                 from /usr/local/include/gazebo-1.9/gazebo/physics/Model.hh:31,
                 from /usr/local/include/gazebo-1.9/gazebo/physics/Actor.hh:24,
                 from /usr/local/include/gazebo-1.9/gazebo/physics/physics.hh:2,
                 from /home/zeyn/Dropbox/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/include/gazebo_plugins/gazebo_ros_block_laser.h:37,
                 from /home/zeyn/Dropbox/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/src/gazebo_ros_block_laser.cpp:26:
/usr/local/include/gazebo-1.9/gazebo/sdf/interface/Param.hh:52:9: error: redefinition of ‘class sdf::Param’
/usr/include/sdformat-1.4/sdf/Param.hh:52:9: error: previous definition of ‘class sdf::Param’
/home/zeyn/Dropbox/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/src/gazebo_ros_bumper.cpp: In member function ‘virtual void gazebo::GazeboRosBumper::Load(gazebo::sensors::SensorPtr, sdf::ElementPtr)’:
/home/zeyn/Dropbox/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/src/gazebo_ros_bumper.cpp:78:43: error: ‘class sdf::Element’ has no member named ‘Get’
/home/zeyn/Dropbox/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/src/gazebo_ros_bumper.cpp:78:58: error: expected primary-expression before ‘>’ token
/home/zeyn/Dropbox/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/src/gazebo_ros_bumper.cpp:78 ...
(more)
edit flag offensive delete link more

Comments

@Zeyn look at my answer I did nearly the same thing but removed the gazebo sdf directory. This solved the Problem for me...

evilBiber gravatar imageevilBiber ( 2013-07-18 06:33:45 -0600 )edit
0

answered 2013-07-17 11:38:28 -0600

Zeyn gravatar image

updated 2013-07-17 11:39:57 -0600

I have the same problem, and haven't been able to fix it yet.

I think the issue is that the latest Gazebo source still includes its own mini-SDF package, whereas the latest gazebo_ros_pkgs source relies on a standalone SDFormat installation.

My environment is Ubuntu 12.04.2, up-to-date ROS Groovy, and I've followed the instructions at http://gazebosim.org/wiki/Tutorials/1.9/Installing_gazebo_ros_Packages, with Gazebo and SDFormat installed from Mercurial, and gazebo_ros_pkgs installed from Git. * Note there's an error in the webpage http://gazebosim.org/wiki/Tutorials/1.9/Installing_gazebo_ros_Packages#ROS_Groovy - the command to check out a git branch should be:

git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git -b groovy-devel

I've tried to fix this by changing the code in Gazebo to use SDF from /usr/include/sdf-1.4/ instead of the version in gazebo/gazebo/sdf, by changing gazebo/gazebo/sdf/sdf.hh to include the system-installed SDF files

#include <sdf/Assert.hh>
#include <sdf/Console.hh>
#include <sdf/Converter.hh>
... etc

and adding the SDF package to some CMakeLists.txt

find_package(SDF REQUIRED)
include_directories(${SDFormat_INCLUDE_DIRS})
link_directories(${SDFormat_LIBRARY_DIRS})

however this finally got me to a compile error that I think is due to Gazebo needing the version its packaged with, rather than the latest SDF source version. Anyway I'm stuck. For reference, the error I got to was:

/home/zeyn/local/installs/gazebo/gazebo/msgs/msgs.cc:302:73: error: no matching function for call to ‘Set(gazebo::msgs::Pose*, sdf::Pose)’
/home/zeyn/local/installs/gazebo/gazebo/msgs/msgs.cc:302:73: note: candidates are:
/home/zeyn/local/installs/gazebo/gazebo/msgs/msgs.cc:174:10: note: void gazebo::msgs::Set(gazebo::common::Image&, const gazebo::msgs::Image&)
/home/zeyn/local/installs/gazebo/gazebo/msgs/msgs.cc:174:10: note:   no known conversion for argument 1 from ‘gazebo::msgs::Pose*’ to ‘gazebo::common::Image&’
/home/zeyn/local/installs/gazebo/gazebo/msgs/msgs.cc:184:10: note: void gazebo::msgs::Set(gazebo::msgs::Image*, const gazebo::common::Image&)
/home/zeyn/local/installs/gazebo/gazebo/msgs/msgs.cc:184:10: note:   no known conversion for argument 1 from ‘gazebo::msgs::Pose*’ to ‘gazebo::msgs::Image*’
/home/zeyn/local/installs/gazebo/gazebo/msgs/msgs.cc:122:10: note: void gazebo::msgs::Set(gazebo::msgs::Vector3d*, const gazebo::math::Vector3&)
/home/zeyn/local/installs/gazebo/gazebo/msgs/msgs.cc:122:10: note:   no known conversion for argument 1 from ‘gazebo::msgs::Pose*’ to ‘gazebo::msgs::Vector3d*’
/home/zeyn/local/installs/gazebo/gazebo/msgs/msgs.cc:129:10: note: void gazebo::msgs::Set(gazebo::msgs::Vector2d*, const gazebo::math::Vector2d&)
/home/zeyn/local/installs/gazebo/gazebo/msgs/msgs.cc:129:10: note:   no known conversion for argument 1 from ‘gazebo::msgs::Pose*’ to ‘gazebo::msgs::Vector2d*’
/home/zeyn/local/installs/gazebo/gazebo/msgs/msgs.cc:135:10: note: void gazebo::msgs::Set(gazebo::msgs::Quaternion*, const gazebo::math::Quaternion&)
/home/zeyn/local/installs/gazebo/gazebo/msgs/msgs.cc:135:10: note:   no known conversion for argument ...
(more)
edit flag offensive delete link more

Comments

davetcoleman gravatar imagedavetcoleman ( 2013-07-18 16:26:17 -0600 )edit
0

answered 2013-07-17 17:10:35 -0600

davetcoleman gravatar image

Hi Benjamin,

1) We have investigated this issue a lot and are not able to replicate your problem even when we switch back to Groovy. Can you please post a gist link of your full build error of gazebo_ros_pkgs by running in your workspace catkin_make VERBOSE=1?

2) Right now gazebo-prerelease and sdformat are the the names of Gazebo 1.9 until they are out of Beta

3) It looks like you are mixing your installation paths up... that error output you posted references both /usr/local/include and /usr/include/ - make sure you fully uninstall Gazebo then try installing it again to just one location.

edit flag offensive delete link more

Comments

That should be `VERBOSE=1 catkin_make`.

William gravatar imageWilliam ( 2013-07-17 17:32:27 -0600 )edit

@davetcoleman Hi, thx for the reply... today I reinstalled gazebo using not that default branch but the branch gazebo_1.9 as is mentioned in the updated build instructions.... and now the previous error disappered! But now get I get errors about missing SDF.hh .... I'll investigate this error a bit more and will post here if I can or can't fix it!

evilBiber gravatar imageevilBiber ( 2013-07-18 04:25:46 -0600 )edit

Am posting my comment as a new answer as it doesn't fit in a comment box!

Zeyn gravatar imageZeyn ( 2013-07-18 05:30:00 -0600 )edit

@Zeyn please use comments and/or add updates to your initial questions. Posting additional questions as answer will only confuse other viewers. Thank you!

bit-pirate gravatar imagebit-pirate ( 2013-07-22 22:06:00 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2013-07-16 06:24:42 -0600

Seen: 1,842 times

Last updated: Jul 18 '13