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

How to visualise IMU data in Rviz?

asked 2022-11-25 08:19:36 -0500

updated 2022-11-25 08:20:18 -0500

OS: Pop!_OS 22.04 LTS

ROS Version: ROS2 Humble

I have my Intel Realsense d435i camera publishing the following topic:

/camera/accel/imu_info /camera/accel/metadata /camera/accel/sample /camera/color/camera_info /camera/color/image_raw /camera/color/image_raw/compressed /camera/color/image_raw/compressedDepth /camera/color/metadata /camera/depth/camera_info /camera/depth/color/points /camera/depth/image_rect_raw /camera/depth/image_rect_raw/compressed /camera/depth/image_rect_raw/compressedDepth /camera/depth/metadata /camera/extrinsics/depth_to_accel /camera/extrinsics/depth_to_color /camera/extrinsics/depth_to_depth /camera/extrinsics/depth_to_gyro /camera/gyro/imu_info /camera/gyro/metadata /camera/gyro/sample /camera/imu /parameter_events /rosout /tf_static

I want to visualise the /camera/imu topic in RViz. When the camera moves I would like to see the movement in Rviz. Currently when I open Rviz while the realsense2_camera this is the view that I get:

Rviz view

While the Imu Status: Warn Topic: No messages received shows up the ros2 topic echo /camera/imu publishes the following (showing only one message): gist

The rivz terminal spams with this INFO message:

[INFO] [1669385796.444049080] [rviz]: Message Filter dropping message: frame 'camera_imu_optical_frame' at time 1669385796.101 for reason 'discarding message because the queue is full'

I have the following option in Fixed Frame drop down menu: camera_accel_fram camera_accel_optical_frame camera_color_frame camera_depth_frame camera_depth_optical_frame camera_gyro_frame camera_gyro_optical_frame camera_link and none of them show the movement of my camera.

Do I need to create a static_transfor_publisher? If I have to, I need to map the offset of base_link to minus of whatever the value published by /camera/imu, right? Is this the way to go?

edit retag flag offensive close merge delete

Comments

If I have to, I need to map the offset of base_link to minus of whatever the value published by /camera/imu, right?

No. The urdf (or static_transform_publisher) specifies the pose of the sensor (where it is mounted) relative to base_link. The data values output by the sensor have nothing to do with it.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-11-27 09:14:49 -0500 )edit

@mike-scheutzow Doesn't the realsense2_camera publish the required tf? Am I supposed the setup the static transforms by myself?

tsadarsh gravatar image tsadarsh  ( 2022-11-28 03:12:04 -0500 )edit

You are supposed to set the tf connecting the camera frame and the base of your robot .I belive if this isn't properly done ,an error will pop up on rviz .

Davies Ogunsina gravatar image Davies Ogunsina  ( 2022-11-28 15:47:03 -0500 )edit

I do not have a robot. I just want to see the IMU data published in /camera/imu in Rviz.

tsadarsh gravatar image tsadarsh  ( 2022-11-30 09:09:09 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-11-27 06:57:10 -0500

Davies Ogunsina gravatar image

Try change the Q.O.S, reliability policy tag and set to system default and also that of Durability Policy.

edit flag offensive delete link more

Comments

I changed everything to "System Default" and I do not see any changes in Rviz. The movement of my camera doesn't reflect in Rviz.

tsadarsh gravatar image tsadarsh  ( 2022-11-28 03:10:12 -0500 )edit

Do you have a tf that connects your camera frame to the base of you robot?

Davies Ogunsina gravatar image Davies Ogunsina  ( 2022-11-28 15:43:08 -0500 )edit

Hi Davis. I want to use only the camera. I do not have a robot. Is it impossible to use the camera alone to visualise the IMU data it publishes?

tsadarsh gravatar image tsadarsh  ( 2022-11-30 09:10:32 -0500 )edit
0

answered 2022-11-25 12:41:32 -0500

RobotDreams gravatar image

have you tried changing the QoS in Rviz2?

it defaults to reliable and needs to be best effort for most sensor data.

edit flag offensive delete link more

Comments

Setting the QoS to "Best Effort" doesn't change the error message that I receive. From the log message: [INFO] [1669524133.662615199] [rviz]: Message Filter dropping message: frame 'camera_imu_optical_frame' at time 1669524133.316 for reason 'discarding message because the queue is full' it is apparent that Rviz is dropping the message. But why?

tsadarsh gravatar image tsadarsh  ( 2022-11-26 22:43:02 -0500 )edit

rviz is most likely waiting for missing transform tree info that you have not provided. Internally rviz needs to transform the messagesensor pose from the camera_imu_optical_frame to the Fixed Frame (usually map). rviz is not reading that topic queue because it is aware that the only thing it can do is discard it (since the message is useless without the corresponding transform data.)

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-11-27 09:27:06 -0500 )edit

How do I provide the missing transform tree?

tsadarsh gravatar image tsadarsh  ( 2022-11-28 04:15:05 -0500 )edit

I tried doing ros2 run tf2_ros static_transform_publisher --frame-id base_link --child-frame-id camera_imu_optical_frame. Now when I set the Fixed frame to base_link in Rviz and add the /camera/imu topic, the console gives me this warning: rviz_imu_plugin got invalid quaternion (0,0,0,0will display neutral orientation instead

tsadarsh gravatar image tsadarsh  ( 2022-11-28 04:33:44 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-11-25 08:19:36 -0500

Seen: 609 times

Last updated: Nov 27 '22