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

Prevent topics in custom node from being prefixed by node name

asked 2015-05-14 07:13:41 -0500

locustcox gravatar image

updated 2015-05-14 07:28:43 -0500

I wrote out a custom PID position controller for a turtlebot. Basically, it sends velocity to command for the straight-line path to a target. I'm having an annoying issue, though. Every topic that the controller subscribes to gets prefixed by the node name in ROS. The name of my node is "BotPID," as is the name of my class. The following three lines are contained in the constructor:

poseSubscriber = nh_private.subscribe("goal/pose", 10,&BotPID::poseCallback,this);
poseDesiredSubscriber = nh_private.subscribe("robot/pose", 10, &BotPID::poseDesiredCallback,this);
//advertise twist publisher
twistPublisher = nh_private.advertise<geometry_msgs::Twist>("cmd_vel_mux/input/teleop", 10);

Annoyingly, when I run the node, the following topics show up in ROS:

/BotPID/robot/pose
/BotPID/cmd_vel_mux/input/teleop
/BotPID/goal/pose

Is there any way in my node to prevent these topics from being prefixed by the node name without adding a "/" before the name of the file?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-05-14 07:28:00 -0500

locustcox gravatar image

So, I changed how I was searching in ROS answers, and came across this answered question! This solves my problem. I was using my private nodehandle for subscribing instead of the normal nodehandle...

http://answers.ros.org/question/11728...

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-05-14 07:13:41 -0500

Seen: 384 times

Last updated: May 14 '15