Robot Localization Not Subscribing to Odometry and Imu Topics
Hey you all!
I'm using ROS2 Galactic with Ubuntu 20.04 on an Nvidia Orin and i'm trying to use Robot_localization ekf node to merge data from a odometry msg (wheel encoder) and a imu msg (imu) but my ekf node it's not subscribing to the topics as ros2 node info shows. What can i do? i've tried a lot of tweaks already. I appreciate all the help! Below i'm posting my ekf yaml file, my ros2 node info file and the echo on the topics i want to subscribe.
ekf config file
ekffilternodeodom: ros_parameters:
use_sim_time: false
frequency: 30.0
sensor_timeout: 0.1
two_d_mode: true
transform_time_offset: 0.0
transform_timeout: 0.0
print_diagnostics: true
debug: true
debug_out_file: /home/orinihr/Documents/debug.txt
publish_tf: true
publish_acceleration: false
reset_on_time_jump: true # true
map_frame: map # Defaults to "map" if unspecified
odom_frame: odom # Defaults to "odom" if unspecified
base_link_frame: base_link # Defaults to "base_link" if unspecified
world_frame: odom # Defaults to the value of odom_frame if unspecified
odom0: odometry
odom0_config: [true, true, true,
false, false, false,
false, false, false,
false, false, false,
false, false, false]
odom0_queue_size: 2
odom0_nodelay: false
odom0_differential: false
odom0_relative: false
imu0: imu/data
imu0_config: [false, false, false,
true, true, true,
false, false, false,
true, true, true,
true, true, true]
imu0_nodelay: false
imu0_differential: true
imu0_relative: false
imu0_queue_size: 7
My Ros2 node info:
/ekffiltermapping Subscribers: /parameterevents: rclinterfaces/msg/ParameterEvent /setpose: geometrymsgs/msg/PoseWithCovarianceStamped Publishers: /diagnostics: diagnosticmsgs/msg/DiagnosticArray /odometry/filtered: navmsgs/msg/Odometry /parameterevents: rclinterfaces/msg/ParameterEvent /rosout: rclinterfaces/msg/Log /tf: tf2msgs/msg/TFMessage Service Servers: /ekffiltermapping/describeparameters: rclinterfaces/srv/DescribeParameters /ekffiltermapping/getparametertypes: rclinterfaces/srv/GetParameterTypes /ekffiltermapping/getparameters: rclinterfaces/srv/GetParameters /ekffiltermapping/listparameters: rclinterfaces/srv/ListParameters /ekffiltermapping/setparameters: rclinterfaces/srv/SetParameters /ekffiltermapping/setparametersatomically: rclinterfaces/srv/SetParametersAtomically /enable: stdsrvs/srv/Empty /setpose: robotlocalization/srv/SetPose /toggle: robotlocalization/srv/ToggleFilterProcessing Service Clients:
Action Servers:
Action Clients:
My odometry echo:
header: stamp: sec: 1664368957 nanosec: 148612552 frameid: odom childframeid: baselink pose: pose: position: x: 45.78006362915039 y: -1.4404045343399048 z: 0.0 orientation: x: 0.0 y: 0.0 z: 0.0 w: 1.0 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 twist: twist: linear: x: 0.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.0 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
My imu/data echo:
header: stamp: sec: 1664369003 nanosec: 697823784 frameid: imulink orientation: x: -0.009489537216722967 y: 0.0709395930171013 z: 0.7008257508277894 w: -0.7097330093383789 orientationcovariance: - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 angularvelocity: x: -0.00996589567512274 y: -0.014095008373260498 z: 0.004535168875008822 angularvelocitycovariance: - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 linearacceleration: x: -0.12365318834781647 y: 0.023622188717126846 z: -0.07523918151855469 linearacceleration_covariance: - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0
I'm using a bag file that posts the topics, i can echo them and everything is being published nicely. I've already tried to change the resetontime_jump since i'm using a bag but nothing changes. I already made the static transforms necessary to the work with the imu and odometry.
Asked by marcelomm103 on 2022-10-06 15:13:54 UTC
Answers
If I remember correctly, should not there be another launch file that allows you to map the topic for each sensors?
Also, just FYI, in order for the Kalman filter to work, you covariance should not be 0
Asked by sdu568 on 2022-10-06 21:56:03 UTC
Comments
Thank you for your reply sdu568. I added remappings to my launch file as follow:
ekf_filter = launch_ros.actions.Node(
package='robot_localization',
executable='ekf_node',
name='ekf_filter_mapping',
output='screen',
parameters=[ekf_params_file],
remappings=[('odometry', 'odometry'),
('imu/data', 'imu/data')]
)
And added covariance to my x and y measurements of odometry but nothing changes. Ekf node still doesnt subscribe to the odometry and imu/data topics. I've never saw this behaviour before, i used robot_localization in simulation and everything worked fine.
Asked by marcelomm103 on 2022-10-07 07:09:55 UTC
I've managed to find the error. I was launching my ekf config file with the wrong node name. Rookie mistake. Thank you for your help!
Asked by marcelomm103 on 2022-10-07 07:54:08 UTC
Comments