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

How to customize robot_localization

asked 2017-05-03 21:11:28 -0500

DaDaLee gravatar image

updated 2022-02-13 16:54:55 -0500

lucasw gravatar image

I'm using robot_localization package offered by ROS community. I've read over the relevant documents and code. I want to customize it based on the package .Here's my question:

1.If I have one odom and one imu as data source, then only odom0 & imu0 are needed, can I just delete contents about odom1,pose0 and twist0 ?

2.I enable X,Yaw,Vx,Yawrate in odom0_config and Yawrate,Ax in imu0_config. I should set the covariance of these variables mentioned before properly,what about the rest of covariances(including Q and P) whose variables being disabled? Maybe set them to small value (eg.1e-6)?

3.If I want to operate in 2D mode, I need to enable two_d_mode. Should I adjust the transfer function matrix to 2D mode?

4.If I want to adopt the robot_localization. I need to modify the document named ekf_template.yaml, making some change on covariance matrices and deleting some unused contents.Also, I need to modify the transfer function and transfer function Jacobian matrices or say,just simplify it. Is that so?

5.Is the coordinates used in transfer function right-handed coordinate system with X pointing forward ?

I do appreciate it if someone can enlighten it to me.

edit retag flag offensive close merge delete


1.All I need to modify are ekf_template.yaml and transfer function matrix in ekf.cpp, is that so? 2.What should I do with those covariances(both P and Q) of unfused variables,setting it to a small value(eg.1e-12) or inflate it to large value (eg.1e3)?

DaDaLee gravatar image DaDaLee  ( 2017-05-04 03:27:59 -0500 )edit

3.Is transfer function matrix in ekf.cpp using right-handed coordinate system affixed to the robot with X axis pointing forward?

DaDaLee gravatar image DaDaLee  ( 2017-05-04 03:28:12 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-05-05 04:41:54 -0500

Tom Moore gravatar image

updated 2017-05-05 04:43:02 -0500

  1. The example configuration file is just meant to show how to configure the node. Which sensor inputs you specify are totally up to you. In other words, yes, you are free to delete and add whichever of the inputs (e.g., pose0, twist0, etc.) that you want. The only requirement the node has is that you have at least one input.
    1. What kind of robot do you have? If you are running with two_d_mode set to true, I would recommend that you fuse the pose or velocity for every 2D pose variable (i.e., X, Y, and yaw). In other words, you need something measuring Y and/or vY. You don't need to change the covariance values for the unused 3D variables, as the node automatically fuses "fake" zero measurements for those variables with small covariances.
    2. No, the node does that for you, hence the parameter. You should not have to modify any C++ code in order to use the package. If your robot has a very different kinematic model to the one the package uses, then you might want to make a new FilterBase-derived class, but I wouldn't recommend that unless you need it.
    3. Again, you are not meant to modify any C++ code for the node to work. The ekf_localization_node is all you need. Just configure it by specifying parameters in the config and launch files, and away you go. Note that in ROS, most of the software packages are available as binaries, so requiring users to modify C++ code wouldn't work.
    4. Yes. robot_localization adheres to REP-103 and REP-105.
edit flag offensive delete link more


Thank you so much, Tom. It really helps a lot. Then I want to add some noise to its original data to test its robustness. It occurred to me that maybe I can add a random number to message received in callback function but it's not good way according to your advice. what should I do ?

DaDaLee gravatar image DaDaLee  ( 2017-05-05 06:30:51 -0500 )edit

Question Tools



Asked: 2017-05-03 21:11:28 -0500

Seen: 792 times

Last updated: May 05 '17