Vicon for External Position Estimation

#1

Hey everyone,

I have been working on setting up an indoor flight environment with Vicon cameras, but am still having some trouble. I have seen multiple posts regarding this, but none have any definitive answer. So what I am hoping is for someone who is using the Vicon cameras to let me know a couple things:

  1. Which state estimator are you using: LPE or EKF2?
  2. What MAVROS topic are you publishing the Vicon information to and is it in the World frame or Body frame?
  3. How can I check that the PX4 flight stack is actually receiving this information, other than checking the output of the pose?

Thanks! Hopefully this post will clear things up for myself and others that follow.

#2

Hi Charris,

You can have a look at our implementation and at the code. We use a different tracking solution, but the architecture is very similar. You should use EKF2 now as it is the supported pose estimator. In my experience, LPE had issues with timeouts.

I strongly recommend that you install mavproxy.py or mavlink router on the companion computer. This will allow multiple sources of data to communicate with the Pixhawk, including QGC. In our implementation, QGC connects automatically to the drone over wifi. This is because mavproxy is automatically launched on the companion computer and it acts as a multiplexer of QGC, pose data and control script mavlink messages. QGC is very helpful as it allows you to check that the data is correctly received, especially during development. In QgroundControl, go in Widget>Analyze. You will see many, many state messages (roll, battery status…). If everything is set up correctly, you will see VISION_XXX messages from your motion capture system. The data of those messages should be very close to the state estimator messages. You need to change PX4 parameters on the drone as explained in the README of the gitlab repo linked above.

Do you need ROS for your test? It is absolutely possible to use ROS, but you may also find that using a forward script on the drone and Dronecode SDK is easier, as we do in our implementation.

I hope our code can be of some use! We had to implement a lot of checks, and getting everything right usually takes months of work. You might find that the shell scripts (part 1 and part 2) that builds the environment on our companion computer are especially useful. You don’t need everything in there: for example, the code for the small OLED screen is only for convenience, as it just displays information on the drone (IP address, tracking status …). However, many small steps took us weeks to figure out and debug. Since we are developing an open platform, we are always looking for merge requests and suggestions, so if you use our code and find improvements, don’t hesitate to let us know! Let me know if you have other questions.

Sincerely,

#3

This is so very helpful! I have been enlisted to work on this project on the side over the last few months and have yet to have a full day in the lab to get everything right. I think this will get me there, hopefully tomorrow is my chance to get it done.

Is it required to run on the companion computer? I have a Raspberry Pi setup for offboard control, but am having issues in my lab because of Firewall on the computers. I can’t send information to the Pi. Can I not send the Vicon data via Telemetry (433 GHz)?

I am using ROS. Okay, I will checkout your script! I work mostly in ROS, but am open to anything that works efficiently.

I am very interested in adding to open-source projects. I have had limited time on this project (it is my side project in the lab, not what I get paid to do). But I should be working on this a lot the next few months so I will be looking to add to your work.

I will keep in touch. Thanks again for the information!

#4

Hi charris,

I have not seen anybody use the telemetry to forward position data. It may be possible, but I don’t know if you will run into issues with data rate or latency. The PX4 documentation strongly recommends using a companion computer. Using a companion computer has the advantage of allowing multiple connexions to the PX4. In our case, Dronecode, our pose forward script and QgroundControl all talk to the PX4 through the companion computer.

As I said above, setting up the Raspberry Pi tooks us a few months the first time, so the install scripts above should help. Cloud9 is really great for development!

What kind of firewall do you have setup? Could you use a dedicated router? It is actually a good idea to use a dedicated router, as it reduces the risk of transmission issues. Ideally, the dedicated router should be wired to the ground computer running RCbenchmark Tracking Lab or the Vicon software to minimize latency and the number of wireless link.