0
$\begingroup$

Rosanswers logo

I am using ROS NOETIC and Pioneer3DX as the mobile robot which publishes Odometry info into /RosAria/pose topic as nav_msgs/Odometry message. Phidgets Spatial IMU is being used which published the IMU data to /imu/data_raw and /imu/data (this uses imu_madgwick filter to get the orientation data) topics as sensor_msgs/imu.

This is my launch file:

<node pkg="robot_localization" type="ekf_localization_node" name="ekf_odom_node" output="screen" >

   <param name="frequency" value="10"/>

   <param name="sensor_timeout" value="0.1"/>

   <param name="publish_tf" value="true"/>

   <param name="two_d_mode" value="true"/>

   <remap from="odometry/filtered" to="odom/ekf/enc_imu"/>

   <!-- <param name="map_frame" value="map"/> -->

   <param name="odom_frame" value="odom"/>

   <param name="base_link_frame" value="base_link"/>

   <param name="world_frame" value="odom"/>

   <param name="transform_time_offset" value="0.0"/>

   <param name="odom0" value="/RosAria/pose"/>

   <param name="odom0_differential" value="true" />

   <param name="odom0_relative" value="false" />

   <param name="odom0_queue_size" value="10" />

   <rosparam param="odom0_config">[false,  false, false,

                                   false, false, false,

                                   true, true, false,

                                   false, false, true,

                                   false, false, false]</rosparam>

   <param name="imu0" value="/imu/data"/>

   <param name="imu0_differential" value="false" />

   <param name="imu0_relative" value="true" />

   <param name="imu0_queue_size" value="10" />

   <param name="imu0_remove_gravitational_acceleration" value="true" />

   <rosparam param="imu0_config">[false,  false, false,

                                  false, false, true,

                                  false, false, false,

                                  false, false, true,

                                  true, false, false]</rosparam>

   <param name="print_diagnostics" value="true" />

   <param name="debug" value="false" />

   <param name="debug_out_file" value="debug_odom_ekf.txt" />

   <rosparam param="process_noise_covariance">[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

                                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

                                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

                                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

                                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

                                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

                                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

                                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

                                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

                                               0, 0, 0, 0, 0, 0, 0, 0, 0, 2.7491722135750453e-06, 0, 0, 0, 0, 0,

                                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.7491722135750453e-06, 0, 0, 0, 0,

                                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.7491722135750453e-06, 0, 0, 0,

                                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7.53975837175367e-06, 0, 0,

                                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7.53975837175367e-06, 0,

                                               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7.53975837175367e-06]</rosparam>

My Odometry data doesn't have any Covariance and my IMU data has covariance for angular velocity and linear acceleration, which I have specified in the process noise covariance.

When I launch robot_localization, tf tree starts jiggling, I assume it is due to the clash between my Mobile robot controller and the robot_localization node publishing the tf in base_link. Please let me know how can I fix this.

Also, my filtered odometry topic seems to have covariance and it is constantly changing even when stationary (which I think is due to the IMU, the IMU frame is constantly quivering even when there is no movement). I would like to know the reason/fix for this. A single instance of echoed filtered odometry topic looks like this:


header: 
  seq: 109
  stamp: 
    secs: 1668740288
    nsecs: 491907835
  frame_id: "odom"
child_frame_id: "base_link"
pose: 
  pose: 
    position: 
      x: -0.0027767606103315393
      y: -0.001673958087734123
      z: -6.744843784137596e-19
    orientation: 
      x: -2.346676768845103e-21
      y: 3.727956144832735e-21
      z: -3.8869887649939077e-05
      w: 0.999999999244566
  covariance: [2.5936842164529874e-09, -8.262592806627886e-10, -6.622168163121949e-29, -6.51261107995881e-29, -2.1762563577312287e-27, 2.8450281461501656e-09, -8.26259280662786e-10, 3.466544928206097e-09, -3.531843233858175e-29, 2.240228932317681e-27, 7.406142294336661e-29, -4.720515954616235e-09, -6.237768220090504e-29, -3.652695440579897e-29, 1.6966118537294256e-09, -2.2507145702543902e-11, 3.7374557772980976e-11, -4.854850589794123e-30, -6.187178545053845e-29, 2.234850450568973e-27, -2.250714570254387e-11, 1.9517088713200696e-09, 2.3360351043958477e-13, -2.9994289813041105e-27, -2.1745832537608525e-27, 7.123303943513571e-29, 3.7374557772980866e-11, 2.336035104395824e-13, 1.9514617135004515e-09, -1.749658505742235e-27, 2.8450281461501797e-09, -4.7205159546162296e-09, -5.483666760685148e-30, -3.647455422328822e-27, -2.1815083512975117e-27, 2.1702338813096678e-08]
twist: 
  twist: 
    linear: 
      x: -0.05010471062555465
      y: -0.030309224849492545
      z: -1.1370249616301676e-18
    angular: 
      x: 1.3814492723897156e-21
      y: 6.076604847095885e-22
      z: 0.00013337306265425098
  covariance: [2.24411163849706e-09, 2.9660498804899114e-27, -7.266418360758023e-27, -3.3104205459984865e-32, 5.495001420972768e-32, 7.74031030451591e-50, 9.289639803192707e-28, 2.2441116384970603e-09, -8.745147397450586e-28, -5.4401329579754266e-33, 9.029772770157075e-33, 1.271448515629526e-50, -4.21542365055365e-27, -2.0919414991473807e-27, 1.6905828785801147e-09, -1.3851442826998742e-13, 2.300067240234748e-13, 3.2514696938862866e-31, -1.808953450357923e-32, -1.0703286354554449e-32, -1.3851442826998752e-13, 6.881328598779493e-08, 1.3119186332455095e-16, -1.4224270414867518e-25, 3.00261465895899e-32, 1.776637994317112e-32, 2.3000672402347464e-13, 1.3119186343091536e-16, 6.881328584902495e-08, -8.276459357269306e-27, 4.1654287691771453e-50, 2.478040890632391e-50, 3.3591904764586926e-31, -2.6523856600289845e-25, -2.1058221482951057e-26, 1.3872113963674785e-07]

Originally posted by pavan_c on ROS Answers with karma: 3 on 2022-11-17

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I was facing the same problem as both the robot_localization and the diff_drive_controller were publishing the tf's. So I disabled the tf's comming from diff_drive_controller by adding this param: enable_odom_tf: false This solved my problem.


Originally posted by Kunal Mod with karma: 26 on 2022-11-23

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by pavan_c on 2022-11-30:
Thank You for the answer Kunal, it is working. I even got it working with RosAria by creating a duplicate topic with different names of frame_id's so that TF's won't get clashed. Also, can you please let me know how to configure the process noise covariance matrix in the EKF node?

$\endgroup$

Your Answer

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