Ask Your Question
0

Understanding launch file from nav2d tutorial

asked 2016-04-06 02:58:59 -0500

RosUser gravatar image

updated 2016-04-06 03:04:06 -0500

I have a node that I want to subscribe two topics from nav2d, I'm interested to use the /base_scan and /odom topics. When I look in launch files then I can see <!-- Start the Operator to control the simulated robot --> <node name="Operator" pkg="nav2d_operator" type="operator" > <remap from="scan" to="base_scan"/> <rosparam file="$(find nav2d_tutorials)/param/operator.yaml"/> <rosparam file="$(find nav2d_tutorials)/param/costmap.yaml" ns="local_map" /> </node>

I know that "scan" in stage that is remapped to the "base_scan" topic. But what is the remap name for /odom or /base_pose_ground_truth topic ? Or where can I find it ?

Can I for example name /odom topic as <remap from="odometry" to="odom"/> ?

edit retag flag offensive close merge delete

Comments

If you make : rosnode info Operator ; you will see topics coming in and out of this node. Then you just have to take the name of the odometry topic and change it with odom with a remap.

F.Brosseau gravatar imageF.Brosseau ( 2016-04-06 04:24:16 -0500 )edit

I tried rosnode info Stage and can see both base_scan and odom publications! sow can I write like this in launch file: <remap from="Odometry" to="odom"/> ?

RosUser gravatar imageRosUser ( 2016-04-06 04:53:56 -0500 )edit

Yes it should work

F.Brosseau gravatar imageF.Brosseau ( 2016-04-06 05:55:19 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-04-06 06:59:24 -0500

Sebastian Kasperski gravatar image

This will work for the scans. but not for the odometry. The Operater receives odometry information via the "tf" topic. (Which is also provided by Stage) So you just have to make sure that the frame names for "robot_frame" and "odometry_frame" are set correctly.

edit flag offensive delete link more

Comments

In Operator it is set ("robot_frame", mRobotFrame, std::string("robot") and ("odometry_frame", mOdometryFrame, std::string("odometry_base). So should it be <remap from="odometry_base" to="odom"/> ?

RosUser gravatar imageRosUser ( 2016-04-06 08:16:46 -0500 )edit

These are node parameters, please set them in operator.yaml.

Sebastian Kasperski gravatar imageSebastian Kasperski ( 2016-04-07 03:24:21 -0500 )edit

I have set in operator.yaml file odometry_frame: odom and robot_frame: base_link.I'm not sure robot_frame should be set to the topic base_link because I can't find this topic when I run rostopic list

RosUser gravatar imageRosUser ( 2016-04-07 04:55:49 -0500 )edit

These are not topics, but frame names published via topic "tf". Use "rosrun tf view_frames" to view all published frames in your system. I also strongly recommend the tutorials at tf package.

Sebastian Kasperski gravatar imageSebastian Kasperski ( 2016-04-07 07:24:50 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-04-06 02:58:59 -0500

Seen: 385 times

Last updated: Apr 06 '16