Ask Your Question

robot_pose_ekf hardcoded topics and tf

asked 2013-01-15 21:50:38 -0500

isura gravatar image

updated 2013-01-15 22:44:04 -0500

Why are "odom", "imu_data" and "base_footprint" hardcoded in robot_pose_ekf? Why not pass these as parameters similar to "odom_combined"? see below:

nh_private.param("input_odom", input_odom_, std::string("odom"));
nh_private.param("input_imu", input_imu_, std::string("imu_data"));
nh_private.param("robot_frame", robot_frame_, std::string("base_footprint"));

The above parameters are not currently defined in robot_pose_ekf.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2013-01-15 22:24:40 -0500

updated 2013-01-15 23:33:23 -0500

Edit #1:

I think you are correct about about base_footprint. I was a bit suprised to see it was not a parameter. You should file an enhancement ticket.

On the other hand, topics such as odom, imu_data and vo can remapped on the command line and in roslaunch. See here for roslaunch remapping and here for command line remapping.

The original answer below does not answer the question.

Those are the default values of the parameters. You can still pass in these parameters and the default values will be overwritten. See the parameter server documentation and the C++ API.

edit flag offensive delete link more


Those parameters are not defined in robot_pose_ekf. The code I posted was my suggestion.

isura gravatar image isura  ( 2013-01-15 22:41:06 -0500 )edit

I missed the last line of your question. See updated answer.

piyushk gravatar image piyushk  ( 2013-01-15 23:34:20 -0500 )edit

Thanks piyushk! actually the last line was an edit to clarify my question, I forgot to add an EDIT: mark above it.

isura gravatar image isura  ( 2013-01-16 03:30:08 -0500 )edit

answered 2013-01-15 23:37:13 -0500

updated 2013-01-15 23:39:09 -0500

Concerning to the question: why topics names are harcorded? the response is easy: because they are dynamically renamable though the "remap" mechanim during the ros node initialization. This mechanism is usually managed by developers through the roslaunch and rosrun tools.

You'll see in most of project all the topic names directly hardcoded. And in fact it can been also seen as a way of improve the readability of the code.

Nonetheless there are some special cases in which is interesting to decouple the topic name using a parameter. For instance when the node has to subscribe to a not fixed number of topics, for instance: input_sources in the costmap node. Here a list of topic names are enumerated in a yaml configuration file.

edit flag offensive delete link more


Thanks! I had never needed the "remap" mechanim till you and piyushk pointed it out.

isura gravatar image isura  ( 2013-01-16 03:33:22 -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


Asked: 2013-01-15 21:50:38 -0500

Seen: 359 times

Last updated: Jan 15 '13