Dear All, I will be glad to get your advice, and possible help on this issue.
I have an intel D435 camera, that has a realsense2_ros package. This package contains the opensource_tracking code which runs RTAB-Map for localization. I have transformed the pose estimates from RTAB-MAP (which is x +ve forward, y +ve to the left and z +ve upwards) to the NED frame which is (which is x +ve forward, y +ve to the right and z +ve downwards). I also correct for the attitudes (roll, pitch and yaw angles). Then I send this data using the VISION_POSITION_ESTIMATES and VELOCITY_ESTIMATES with pymavlink to the Arducopture FCU. I have also made all the necessary parameter changes as recommended here :Intel RealSense T265 — Copter documentation.
I am sending the position and velocity estimates at a rate of 30Hz, and i set the VISO_DELAY parameter to 100ms. Below is some of the flight logs I get, comparing the vision estimates to the local position estimates:
I have many such flight logs.
Whenever I switch to either Loiter or Guided mode, the drone tends to move rapidly sideways or drift towards some direction that it tends to crash if I do not disarm it. Of all the automatic flight modes, only the Land mode works with vision. Note that I have tested the Loiter and Guided mode outdoors and it works very well. Vehicle maintains the position well. So I do not know why Loiter mode is not working with Vision position indoors.
I will be glad to get help on this issue, and can provide more information if needed.