Closed tsadarsh closed 1 year ago
Hi @tsadarsh Does setting the topic in RViz as /camera/gyro/sample (the individual gyro topic) instead of /camera/imu (the combined IMU topic from unite_imu_method) cause IMU gyro data to be displayed in RViz?
setting the topic in RViz as /camera/gyro/sample (the individual gyro topic) instead of /camera/imu
gives the following WARN message in my terminal and I do not see any change reflected in Rviz:
[WARN] [1669626320.995131908] [rviz]: New publisher discovered on topic '/camera/gyro/sample', offering incompatible QoS. No messages will be sent to it. Last incompatible policy: RELIABILITY_QOS_POLICY
And you still do not see odometry information if you use the /camera/imu topic and set unite_imu_method:=1 (Copy instead of Linear_Interpolation)?
I set the topic to /camera/imu
and unite_imu_method:=1
.
Message Filter dropping message: frame 'camera_imu_optical_frame' at time 1669732749.843 for reason 'discarding message because the queue is full'
This is the output from the Rviz console.
May I confirm that you have enabled the gyro and accel topics in your ROS launch, as they are disabled by default in the RealSense ROS wrapper. They can be enabled by adding enable_gyro:=true enable_accel:=true to the launch instruction.
Hi @MartyG-RealSense. I am using the following launch command to start the realsense2_camera node:
ros2 launch realsense2_camera rs_launch.py enable_accel:=true enable_gyro:=true unite_imu_method:=1 pointcloud.enable:=true
As you mentioned earlier, your ROS2 Rviz seems to be missing the TF section in RViz.
If this was ROS1 then using the imu_filter_madgwick module would publish the TF, like in Intel's D435i SLAM guide for ROS1.
https://github.com/IntelRealSense/realsense-ros/wiki/SLAM-with-D435i
I am not personally familiar with publishing a TF in ROS2, unfortunately. The imu_tools package at the link below does have a version of imu_filter_madgwick that supports ROS2 though, so it may be worth considering installing that.
@tsadarsh Your TF problem with ROS2 also sounds like a recent case at https://github.com/IntelRealSense/realsense-ros/issues/2560
@MartyG-RealSense Thank you for the help. I am currently checking out imu_tools
. I am trying to create a launch file for it in ROS2. I will update you on my progress in some time.
Hi @tsadarsh Do you have an update about this case that you can provide, please? Thanks!
Hi @MartyG-RealSense. I am extremely sorry for the delay. I had my University Exams going and they got over only yesterday. I will be working on this issue today and will try to give you updates in a few hours.
It's no trouble at all. Thanks very much for the update!
Yes, I got some updates!
Running the imu_filter_madgwick
node does the magic :magic_wand:
Launch the realsense camera node with accel and gyro enabled.
ros2 launch realsense2_camera rs_launch.py enable_accel:=true enable_gyro:=true unite_imu_method:=1
imu_tools
package :package:sudo apt-get install ros-<YOUR_ROSDISTO>-imu-tools
Details on source installation can be found here
Run the imu_filter_madgwick node and remap the /camera/imu topic to /imu/data_raw:
ros2 run imu_filter_madgwick imu_filter_madgwick_node --ros-args -p use_mag:=false -r /imu/data_raw:=/camera/imu
Open up Rviz2 and set Fixed Frame to odom. Add the /imu/data/Imu visualization from By topic tab:
ros2 run rviz2 rviz2
Thanks so much @tsadarsh for sharing with the RealSense ROS community the method that worked for you!
Hi @tsadarsh Did you receive any yaw drifts over time in your test?
I am receiving the odometry information at
/camera/imu
topic after setting theunit_imu_method:=2
. But I am unable to visualise them in Rviz. Does the realsense_ros library publish the requiredtf
or am I supposed to set up the static transformations?The console from which I start Rviz, spams with the following INFO once I add the IMU topic in RViz for visualization:
Is there any parameter that I need to
enable
for this? I went through the documentation and made sure thatpublish_tf
andpublish_odom_tf
is set to True.Here is a sample video demonstration of what I am trying to visualise.