Integration of ArduPilot and VIO tracking camera (Part 4): non-ROS bridge to MAVLink in Python

tnx , i changed the Ardupilot version to a new (3.6.10) , before i used a 3.4 , now i can see the quadcopter icon .

Hey Thien,

I finally had time to test the 265 on a copter, the results were stunning - see the video.

I am however having issues creating a boot service. works fine if executed alone, but once executed through t265.service, returns errors regarding permissions.

any help would be much appreciated



@hugh Congrats on your result! That looks very stable indeed.

Regarding the permission issues, maybe you can run everything as root and see if the problem still persists.

Hello , how you do to arm the ardupilot without Compass , i uncheck Compass in Arming_check parameter , it worked one time , now it can’t , i have PreArm: Compass not healthy message .

Here are a few suggestions that you can try:

  1. Recalibrate compass: This works for me, regardless of firmware version.
  • Enable compass: COMPASS_USE = 1 .
  • Perform compass calibration again .
  • Try to arm with compass enabled and then disabled COMPASS_USE = 0.
  1. Use the dev firmware:
    If you are familiar with how to build and upload the ArduPilot code, now you can bypass compass healthy check to arm when vision data is available, which should solve this issue. But you need to use the master code for now.

You can read this thread, which discusses the same issue that you are facing, for more info.

Another is option is to use compass;
Just make sure you start with vehicle aligned north and that the EKF is fusing both estimators by walking the quadcopter and showing straight lines on mission planner map.

I Set MAG_ENABLE to 1 and Compass_Use 0 ; i have the bad compass health message ; with MAG_ENABLE,it does not make sense but it work now i can arm and fly without compass , just start with vehicle aligned to north to have the right direction in the map .
i tried before to use compass , my compass has a problem of drifting direction quickly in time,and drone turn in circle to stabilise with loiter mode .

Just a little update on my experiments;
I made a new build using a 330 Size Flamewheel with a BananaPi M2 Zero running the Python script on Ubuntu. More details here:

Video of the vehicle flying a 7 Meter (radius) Circle @ 45 Degs/Sec

The resulting mapping and the mavlink message showint the T265 confidence level at 100%.

And this is what the T265 is tracking, white corrugated sheets with black tape patterns (random shapes)… and my SUV :wink:


@LuckyBird Hello Thein,
I am currently using Audopilot 3.7.0 dev and Pixhawk 1 Flight Controller
and i have followed Part 4 non ROS guide.
The problem which i’m having is pitch , roll, yaw is not working, i’m using 6 channel Remote controller. I’m only to able to lift up the drone and land.
And other problem is when running the script and trying to control the drone with Rc controller the communication between the RC controller and the drone become very slow.
So,Can you please recommend, which fight controller is best for indoor navigation?
And anything else we can do to solve these problems.


Can you fly normally in Manual or Attitude modes? Does this problem happen in Loiter, Pos Hold or any other flight modes? My suggestion is to pinpoint the source of the problem by eliminating the suspects one by one (RC controller, parameter settings, running software etc.).

You can reduce the data rate by changing this parameter. You can go as low as 10Hz, but I think 15-20Hz will give you a safe margin.

@LuckyBird Hello Thein,
Thanks you very much for responding.

We managed to fly the drone in loiter mode but now problem is, it stabilizes for few second and start wobbling. Here’s the video of the test fight in which we are just increasing the throttle and lifting the drone but it is moving so much.

So we used this command to run the script:
python3 --connect /dev/ttyACM0 --baudrate 57600 --vision_msg_hz 20 --confidence_msg_hz 0.5

And also checked the realsense given data is right and high accuracy.

Can you suggest anything we can do to stabilize it more?And how can we solve this problem.

Thanks ,



  • Is the quad stable in manual mode ?
  • Can you ‘‘walk’’ the quad (as detailed in Thien’s wiki) and get solid and precise positioning on Mission Planner map ?
  • Can you add more texture on the wall , like pieces of black tape or else to enrich the background ? (the moving plant does not help either at it could induce the system to diverge)

Hello @ppoirier,

Thanks for responding,I checked the drone in manual mode, it is stable.
And also checked all the following instruction given in non-ros(Part4) and realsense data is correct, plus drone pointer shown in mission planner is also stable.
We will try adding texture and test it again.

I had some Questions:

  1. Should we go for smaller size frame?
  2. Can that help in stability?
  3. Is stable down facing camera with markers?


Hello again,

Smaller size means a higher ratio of weight to propeller surface so that is not helping.
Facing down is stable as well, if you have rich texture on the floor.


@LuckyBird @ppoirier Thanks for such a great support.
We were able to stabilize much more better then previously video which we shared.
Here’s the new video.

We have some questions:

  1. Are you using optical flow and range finder for more stabilization?
  2. We are currently using pihawk1 fight controller with ros but whole system is slowing down. Can you please recommend, some alternative fight controller?

Good :blush:
I prefer not to use OF because I want to experiment and optimize the VIO

I used a CUBE on the 450 and a PIXRACER on the 330

@Harsh_Vardhan I used optical flow and range finder for backup, since the tracking from the Realsense may fail sometimes.

I am using Pixhack V3 and it serves my purpose, but I would recommend the Cube for a smoother development process.

Hi. Thanks to you, I have completed this project. It is awesome!!
Q: Is there a way to fly with real gps outside and switch to realsense-pos data only when I want to?
I want to use realsense pos data for emergency in external Non-gps situations.
Modifying parameters manually is too cumbersome.

Hi There @LuckyBird @ppoirier

We tried to use Pixhack Nano board it seems to very fast, We tried to change the parameter as you have mentioned in this article after everything is done RC controller not working there was a prearm message" Throttle below fail-safe", after we remove all the parameter RC controller working fine. I have no idea what is wrong.

Any help would be much appreciated

Throttle below fail safe is generally related to rc receiver. Have you connected, tested and calibrated the rc system?