Gazebo | Ignition | Community
Ask Your Question

Zeyn's profile - activity

2013-07-18 08:03:51 -0500 received badge  Supporter (source)
2013-07-18 06:38:54 -0500 received badge  Teacher (source)
2013-07-18 05:32:27 -0500 answered a question installing gazebo_ros_pkgs for groovy

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)
2013-07-18 05:30:00 -0500 commented answer installing gazebo_ros_pkgs for groovy

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

2013-07-17 11:39:57 -0500 received badge  Editor (source)
2013-07-17 11:38:28 -0500 answered a question installing gazebo_ros_pkgs for groovy

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)