Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: <Type> in ‘gazebo::math’ does not name a type #1

Open
erenaud3 opened this issue Oct 30, 2019 · 4 comments
Open

Error: <Type> in ‘gazebo::math’ does not name a type #1

erenaud3 opened this issue Oct 30, 2019 · 4 comments

Comments

@erenaud3
Copy link

Hi !

I have a lot of errors when trying to compile dji_m100_ros_hitl_controller_gazebo.cpp.

[100%] Built target dji_m100_controller_gazebo_sitl
/home/loophole/catkin_ws/src/dji_m100_controllers_gazebo/src/dji_m100_ros_hitl_controller_gazebo.cpp:195:19: error: ‘Quaterniond’ in namespace ‘gazebo::math’ does not name a type
             math::Quaterniond base_orientation;
                   ^
/home/loophole/catkin_ws/src/dji_m100_controllers_gazebo/src/dji_m100_ros_hitl_controller_gazebo.cpp:196:19: error: ‘Vector3d’ in namespace ‘gazebo::math’ does not name a type
             math::Vector3d base_position;
                   ^
/home/loophole/catkin_ws/src/dji_m100_controllers_gazebo/src/dji_m100_ros_hitl_controller_gazebo.cpp:197:19: error: ‘Vector3d’ in namespace ‘gazebo::math’ does not name a type
             math::Vector3d gimbal_orientation;
                   ^
/home/loophole/catkin_ws/src/dji_m100_controllers_gazebo/src/dji_m100_ros_hitl_controller_gazebo.cpp: In member function ‘virtual void gazebo::DJI_ROS_ControlPlugin::Load(gazebo::physics::ModelPtr, sdf::ElementPtr)’:
/home/loophole/catkin_ws/src/dji_m100_controllers_gazebo/src/dji_m100_ros_hitl_controller_gazebo.cpp:85:67: error: ‘class gazebo::physics::World’ has no member named ‘SphericalCoords’
                 this->spherical_coordinates_handle = this->world->SphericalCoords();
 

(and so on)...

I tried to install Ignition Math thanks to this page. But it didn't change anything.

What am I doing wrong ?

@erenaud3 erenaud3 changed the title ‘gazebo::math’ does not name a type Error: <Type> in ‘gazebo::math’ does not name a type Oct 30, 2019
@tahsinkose
Copy link
Collaborator

I'd suggest installing a proper version of Gazebo (do not make it through source install, just use the simplest method). If your Gazebo is 8.0+, then you will need ignition libraries, since the math utilities were moved to there. If your Gazebo is older than that you should have math utilites under gazebo namespace.

@erenaud3
Copy link
Author

Thank you for this fast reply.

Unfortunately, I tried to reinstall gazebo but it doesn't change anything. I did this command:

sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control --reinstall

My specs are : Ubuntu 16.04 and ROS Kinetic. So the installed version is Gazebo 7.0.0.

@tahsinkose
Copy link
Collaborator

tahsinkose commented Oct 30, 2019

Thank you for this fast reply.

Unfortunately, I tried to reinstall gazebo but it doesn't change anything. I did this command:

sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control --reinstall

My specs are : Ubuntu 16.04 and ROS Kinetic. So the installed version is Gazebo 7.0.0.

I would do a fresh install of the gazebo packages. Also, try to find the math headers under /usr/include/gazebo-7/gazebo/math or in /usr/include/gazebo/math. I recommend you to inspecting Gazebo 7.1 API

By the way, the problem is not due to gazebo-ros connection packages but due to plain Gazebo installation, therefore the command above would not fix that error. So you should have a fresh Gazebo 7.0 install from scratch. Before doing that make sure everything related to Gazebo is deleted via sudo apt-get remove '.*gazebo.*' '.*sdformat.*' '.*ignition-math.*' '.*ignition-msgs.*' '.*ignition-transport.*'. Then just execute sudo apt-get install gazebo7. That would work.

@tahsinkose
Copy link
Collaborator

tahsinkose commented Dec 18, 2019

It appears that gazebo::math uses Quaternion instead of Quaterniond as is used by ignition::math. This applies for Vector3 and Pose3 too. Also there are some API changes between Gazebo 7.0-8.0 versions, which are still not respected fully in the code.

See 45a1a36 for the fix or you can directly pull the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants