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

creating a other topic in rviz display plugin

asked 2016-08-22 11:28:12 -0500

dagdiab gravatar image

Hey, i created a new Display Plugin for Rviz but i wanted to to create an other topic to return some information. Because i have no argv and argc arguments i cant do ros::init ... and if i just create a new ros::NodeHandle this works sometimes fine ... but i guess if nothing is displayed it stops on ros::spineOnce() is this normal or is the problem somewhere else in my code?

so the main question is what is the right way to create a new Topic in a rviz display plugin?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-08-24 13:10:36 -0500

William gravatar image

rviz calls ros::init() and will handle spinning. I think you just need to create a node handle and then create a subscriber from that node handle. You shouldn't need to do anything else.

edit flag offensive delete link more

Comments

In fact, the Display class has 2 protected NodeHandle members already, threaded_nh_ (non-GUI thread) and update_nh_ (GUI thread).

kramer gravatar image kramer  ( 2016-08-25 00:31:54 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-08-22 11:28:12 -0500

Seen: 497 times

Last updated: Aug 24 '16