0
$\begingroup$

Rosanswers logo

I am trying to use '/gazebo/Model_states' topic to get the model states.

shouldn't the include be like

#include gazebo_msgs/ModelStates.h

and callback function be like

void ModelStatecallback(const gazebo_msgs::ModelStates::ConstPtr& msg)
{
}

Is anything wrong in this ? When I tried this I get following error.

/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp_traits/include/ros/message_traits.h:121: error: ‘__s_getMD5Sum’ is not a member of ‘int’

/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp_traits/include/ros/message_traits.h:138: error: ‘__s_getDataType’ is not a member of ‘int'

Any help is appreciated.


Originally posted by adesh on ROS Answers with karma: 36 on 2011-10-31

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I have had it working for my robot by using

#include <gazebo/ModelState.h>

I think there is also an extra '_msgs' and 's' in your function, so try it as

void ModelStatecallback(const gazebo::ModelState::ConstPtr& msg)
{
}

Check out the ROS Gazebo and ModelState definition pages for more details.


Originally posted by Thomas D with karma: 4347 on 2011-11-01

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by adesh on 2011-11-01:
Hi Thomas, I already tried that combination as well but it does not work either.The 'ModelState definition' link that you posted says 'This message is deprecated.Please use the version in gazebo_msgs instead' so I tried 'gazebo_msgs' and I want to know the position of a model so 'ModelStates'.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.