ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Model State in Gazebo

asked 2011-10-31 13:56:44 -0500

adesh gravatar image

updated 2011-10-31 19:24:47 -0500

tfoote gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2011-11-01 01:54:29 -0500

Thomas D gravatar image

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.

edit flag offensive delete link more

Comments

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'.
adesh gravatar image adesh  ( 2011-11-01 05:02:44 -0500 )edit

Question Tools

Stats

Asked: 2011-10-31 13:56:44 -0500

Seen: 1,278 times

Last updated: Nov 01 '11