Robotics StackExchange | Archived questions

Use custom ROS message for subscribing to ROS topic

I've menaged to make my GAZEBO plugin subscribe to my ROS topic, but they can't communicate since the message are of two different types. This is the error given by ROS:

[ERROR] [1471637321.911173829]: Client [/gazebo_client] wants topic /quetzalcoatl/cmdVelocity to have datatype/md5sum [std_msgs/Float32/73fcbf46b49191e672908e50842a83d4], but our version has [quetzalcoatl/cmdVelocity/2dc6f1b56c5b7d7be587f9ed104596db]. Dropping connection.

ROS uses a custom message, whereas GAZEBO doesn't. How I import the ROS message in the GAZEBO plugin? I've tried with this but it isn't enough:

#include "quetzalcoatl/cmdVelocity.h"
...
quetzalcoatl::cmdVelocity cmdVelocityMsg;

I need to copy somehow the ROS message in the GAZEBO folder?

Asked by Hanteus on 2016-08-20 02:44:30 UTC

Comments

I once had the same error due to differences in message content. A ROS topic can't subscribe to a gazebo topic (i guess). So, check the .msg and look for diferences in them.

Asked by wicked88 on 2016-08-20 07:10:49 UTC

It's the opposite, I want the GAZEBO plugin to subscribe the ROS topic. Anyway, so I need to have the corresponding .msg also in the GAZEBO project source folder?

Asked by Hanteus on 2016-08-20 07:48:20 UTC

Answers