How can I use the Gazebo D435i camera with a drone to start rtabmap.launch ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I use the Gazebo D435i camera with a drone to start rtabmap.launch ?

5dollars
This post was updated on .
Hi~

I have successfully mounted the D435i camera on a drone and simulated it in Gazebo. I am using ArduPilot SITL and MAVROS to control the drone in Gazebo. I want to perform real-time RTAB-Map SLAM in Gazebo, but I keep encountering issues such as time synchronization problems, the 3D map displaying in red, and erratic IMU data.Please help me !!!

After launching rtabmap.launch, I can successfully display the image from the D435i camera in the Gazebo world, but the RTAB 3D map seems to display the wrong perspective. Could it be that there is an issue with my IMU or coordinate settings? What should I do?

Thank you!

Reply | Threaded
Open this post in threaded view
|

Re: How can I use the Gazebo D435i camera with a drone to start rtabmap.launch ?

matlabbe
Administrator
Your simulated environment lack of visual texture. I'll suggest to try in one of these worlds: https://github.com/matlabbe/rtabmap_drone_example/tree/master/worlds

For the orientation, difficult to say just with screenshots, can you share a resulting database?
Reply | Threaded
Open this post in threaded view
|

Re: How can I use the Gazebo D435i camera with a drone to start rtabmap.launch ?

5dollars
This is my startup procedure for Gazebo and RTAB-Map, along with the TF tree structure. When using a real camera, I don't have IMU flipping issues, but the simulation in Gazebo is quite unstable. Can you help me? What other information do I need to provide? Lastly, this is my experiment video. I really appreciate your help!

"video in 2:50"
https://drive.google.com/file/d/1gGsxwR8mYgQWnOgwpqMoz52RDQK63-Hl/view?usp=drive_link

gazebo startup :
roslaunch iq_sim obstacles_d435i.launch
<launch >
  <arg name="gui" default="true"/>

  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find iq_sim)/worlds/obstacles_d435i.world"/>
    <arg name="gui" value="$(arg gui)"/>
  </include>

</launch>


imu filter startup :
rosrun imu_filter_madgwick imu_filter_node \
_use_mag:=false \
_publish_tf:=false \
_world_frame:="enu" \
/imu/data_raw:=/camera/imu \
/imu/data:=/rtabmap/imu

rtabmap startup :
#!/bin/bash

# rosparam set rtabmap/SaveDatabase false &
# rosparam set use_sim_time true &

echo "Starting static transforms..."

rosrun tf static_transform_publisher 0 0 0 0 0 0 odom base_link 1 &

rosrun tf static_transform_publisher 0 0 -0.13 -1.57 0 -1.57 base_link camera_link 1 &

rosrun tf static_transform_publisher -0.0325 0 -0.13 0 0 0 camera_link drone_with_camera::camera_color_frame 1 &

rosrun tf static_transform_publisher -0.0325 0 -0.13 0 0 0 camera_link drone_with_camera::camera_depth_frame 1 &
rosrun tf static_transform_publisher 0 0 -0.13 -3.14 -1.57 1.57 base_link /rtabmap/imu 100 &

echo "Starting RTAB-Map..."

roslaunch rtabmap_ros rtabmap.launch    depth_topic:=/camera/depth/image_raw   rgb_topic:=/camera/color/image_raw   camera_info_topic:=/camera/color/camera_info imu_topic:=/rtabmap/imu frame_id:=base_link &

wait