Iim using an Intel RealSense D435i on ROS2 Humble. If the IMU is mounted with no rotations (in the URDF rpy = "0 0 0") orietantion is correctly calculated in the filter. But if IMU is mounted with rotations, the result orientation is not correct.
In fact, with the following rotation configuration:
<joint name="camera_base_joint" type="fixed"> <parent link="base_link"/> <child link="camera_link"/> <origin xyz="0.73878 0.2785 0.1794" rpy="1.364 -0.134390 0.628319"/> </joint>
IMU message is the following one:
` root@AMR:/home/debix# ros2 topic echo /camera/camera/imu --once
header:
stamp:
sec: 1760639159
nanosec: 875420672
frame_id: camera_imu_optical_frame
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 0.0
orientation_covariance:
- -1.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
angular_velocity:
x: 0.0
y: 0.003490658476948738
z: -0.001745329238474369
angular_velocity_covariance:
- 0.01
- 0.0
- 0.0
- 0.0
- 0.01
- 0.0
- 0.0
- 0.0
- 0.01
linear_acceleration:
x: -9.316317558288574
y: -0.6472389101982117
z: 2.1378495693206787
linear_acceleration_covariance:
- 0.01
- 0.0
- 0.0
- 0.0
- 0.01
- 0.0
- 0.0
- 0.0
- 0.01
---`
and the results accelerations are not correct. After making a lot of test, I found a solution: adding a new node that republish the IMU message but converting all data to the base_link frame. With this change, it seems the orientation is now correctly.
Since already exists a TF from "camera_imu_optical_frame" to "base_link", and the added node is only using this tranform to convert the data:
- Why is this node needed?
- Is it possible to do it directly without converting before the IMU message?
Iim using an Intel RealSense D435i on ROS2 Humble. If the IMU is mounted with no rotations (in the URDF rpy = "0 0 0") orietantion is correctly calculated in the filter. But if IMU is mounted with rotations, the result orientation is not correct.
In fact, with the following rotation configuration:
<joint name="camera_base_joint" type="fixed"> <parent link="base_link"/> <child link="camera_link"/> <origin xyz="0.73878 0.2785 0.1794" rpy="1.364 -0.134390 0.628319"/> </joint>IMU message is the following one:
` root@AMR:/home/debix# ros2 topic echo /camera/camera/imu --once
header:
stamp:
sec: 1760639159
nanosec: 875420672
frame_id: camera_imu_optical_frame
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 0.0
orientation_covariance:
angular_velocity:
x: 0.0
y: 0.003490658476948738
z: -0.001745329238474369
angular_velocity_covariance:
linear_acceleration:
x: -9.316317558288574
y: -0.6472389101982117
z: 2.1378495693206787
linear_acceleration_covariance:
---`
and the results accelerations are not correct. After making a lot of test, I found a solution: adding a new node that republish the IMU message but converting all data to the base_link frame. With this change, it seems the orientation is now correctly.
Since already exists a TF from "camera_imu_optical_frame" to "base_link", and the added node is only using this tranform to convert the data: