0
$\begingroup$

Rosanswers logo

Hi! I need help to create a topic for the communication between a gazebo plugin and a ros node. The plugin receives the GPS measures and it should publish on a ros topic the data. The problem is that I have not understood how to make the communication between the plugin and the ros topic. Have you got any idea? Thanks!


Originally posted by tonio on ROS Answers with karma: 3 on 2017-07-23

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Your plugin needs a node handle to publish ROS messages. Here is an example of a GPS plugin for Gazebo.

Especially look at the following lines:

152. node_handle_ = new ros::NodeHandle(namespace_);
153. fix_publisher_ = node_handle_->advertise<sensor_msgs::NavSatFix>(fix_topic_, 10);
236. fix_publisher_.publish(fix_);

Originally posted by Andre Volk with karma: 775 on 2017-07-24

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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