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

Robot Localization Not Subscribing to Odometry and Imu Topics

asked 2022-10-06 15:13:54 -0500

marcelomm103 gravatar image

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

ekf_filter_node_odom: 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:

/ekf_filter_mapping Subscribers: /parameter_events: rcl_interfaces/msg/ParameterEvent /set_pose: geometry_msgs/msg/PoseWithCovarianceStamped Publishers: /diagnostics: diagnostic_msgs/msg/DiagnosticArray /odometry/filtered: nav_msgs/msg/Odometry /parameter_events: rcl_interfaces/msg/ParameterEvent /rosout: rcl_interfaces/msg/Log /tf: tf2_msgs/msg/TFMessage Service Servers: /ekf_filter_mapping/describe_parameters: rcl_interfaces/srv/DescribeParameters /ekf_filter_mapping/get_parameter_types: rcl_interfaces/srv/GetParameterTypes /ekf_filter_mapping/get_parameters: rcl_interfaces/srv/GetParameters /ekf_filter_mapping/list_parameters: rcl_interfaces/srv/ListParameters /ekf_filter_mapping/set_parameters: rcl_interfaces/srv/SetParameters /ekf_filter_mapping/set_parameters_atomically: rcl_interfaces/srv/SetParametersAtomically /enable: std_srvs/srv/Empty /set_pose: robot_localization/srv/SetPose /toggle: robot_localization/srv/ToggleFilterProcessing Service Clients:

Action Servers:

Action Clients:

My odometry echo:

header: stamp: sec: 1664368957 nanosec: 148612552 frame_id: odom child_frame_id: base_link 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 ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-10-06 21:56:03 -0500

sdu568 gravatar image

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

edit flag offensive delete link more

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.

marcelomm103 gravatar image marcelomm103  ( 2022-10-07 07:09:55 -0500 )edit

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!

marcelomm103 gravatar image marcelomm103  ( 2022-10-07 07:54:08 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-10-06 15:13:54 -0500

Seen: 526 times

Last updated: Oct 06 '22