Skip to content

Wrong timestamp in /Imu header frame #9

Open
@maciej-przylecki

Description

@maciej-przylecki

I'm currently trying to integrate the /Imu topic from the ros2-driver with the robot_localization package to calculate my robot orientation. At the beggining, robot_localization was not able to handle the /Imu topic orientation information. After some investigation I discovered that the problem was in the timestamp that ros2-driver was publishing in the /Imu topic header. The timestamp was not aligned with the timestamp of the static transform that I use to convert the imu frame to base_link, so robot_localization was ignoring the topic.

This timestamp seems to be passed directly from the data received from the imu. Is there some reason to use the timestamp like this? Why not use the ROS timestamp for this field?

I solved my problem by modifying the ros2_driver advanced_navigation_driver.cpp like this

// IMU
imu_msg.header.stamp=node->now();
imu_msg.header.frame_id=imu_frame_id;
// Using the RPY orientation as done by cosama
orientation.setRPY(
	system_state_packet.orientation[0],
	system_state_packet.orientation[1],
	PI/2.0f - system_state_packet.orientation[2] //REP 103
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions