Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong timestamp in /Imu header frame #9

Open
maciej-przylecki opened this issue May 31, 2024 · 0 comments
Open

Wrong timestamp in /Imu header frame #9

maciej-przylecki opened this issue May 31, 2024 · 0 comments

Comments

@maciej-przylecki
Copy link

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
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant