0
$\begingroup$

Rosanswers logo

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?


Originally posted by locustcox on ROS Answers with karma: 1 on 2015-05-14

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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/namespace-and-remapping/


Originally posted by locustcox with karma: 1 on 2015-05-14

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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