0
$\begingroup$

What I'm currently doing is I'm trying to replace Gazebo 11 with Gazebo garden in this document. However, I ran into a problem when learning robot_localization.

First, I try to set ekf_filter_node as follows. And only read odometry information. In my understanding this could generate the conversion of odom to base_link (should be published to /tf). However, it didn't happen.

ekf_filter_node:
    ros__parameters:
        frequency: 30.0
    two_d_mode: false
    publish_acceleration: false
    publish_tf: 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" ifunspecified
    world_frame: odom           # Defaults to the value ofodom_frame if unspecified

    odom0: demo/odom
    odom0_config: [true,  true,  true,
                   false, false, false,
                   false, false, false,
                   false, false, true,
                   false, false, false]

    # imu0: demo/imu
    # imu0_config: [false, false, false,
    #               true,  true,  true,
    #               false, false, false,
    #               false, false, false,
    #               false, false, false]

The following is the header information of /demo/odom

header:
    stamp:
        sec: 48
        nanosec: 600000000
    frame_id: odom
child_frame_id: base_link

The following is tf tree enter image description here

I think there should be an arrow pointing to base_link from odom in the picture. Is this understanding wrong?

Second, regarding the settings of IMU sensor data.The following sentence from the documentation

This offset is typically specified by a static transform from the base_link_frame parameter to the IMU message’s frame_id.

My understanding is that the ekf_node of robot_localization will read the frame_id in the imu sensor (in this example, it comes from /demo/imu) and convert the coordinate system to base_link according to the conversion in the tf tree. However, the frame_id in the data sent from Gazebo garden (Gazebosim) is as follows

header:
    stamp:
        sec: 1279
        nanosec: 760000000
frame_id: sam_bot/base_link/imu_sensor

The tf tree diagram is as above, and imu is located above imu_link. Does this mean I need to change the frame_id in the imu message to imu_link?

Thank you for reading my question.

$\endgroup$

1 Answer 1

0
$\begingroup$

Regarding the first question, I later found that in the launch file, I set use_sim_time=true, which made ekf_node try to subscribe to the /clock topic, so it is necessary to convert Gazebo’s /clock topic to the ros2 topic through the ros_gz_bridge package so that it can receive Time message. This also means that the time data of the sensor must match the time data of the ekf_node.

For the second question, I added an additional branch on tf_tree through tf2 static broadcast so that ekf_node can correctly find the corresponding frame.

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.