# Using the Vicon Motion Capture System to Estimate Position and Heading

Source: https://forum.modalai.com/topic/1596/using-the-vicon-motion-capture-system-to-estimate-position-and-heading
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2022-12-03 14:05:29 UTC by Troi
Replies: 0 · Views: 960

## Troi · 2022-12-03 14:05:29 UTC

Re: [Using Motion Capture Systems (Optitrack) for Position Estimation](/topic/919/using-motion-capture-systems-optitrack-for-position-estimation)

This post is a follow-up to the forum post mentioned above. I want to estimate the position and heading of an m500 (with a VOXL computer) using Vicon cameras. I describe my setup and issues below.

**Setup:**

- A set of Vicon cameras.
- A host computer that runs a custom docker that collects Vicon pose messages and then publishes those messages via ROS. This computer is also my ROS master. This computer also runs QGroundControl.
- A VOXL drone that runs the `roskinetic-xenial:v1.0` docker image, has the `run_mavros.sh` script from Modal AI, and knows that the host computer is the ROS master.
- In addition, I installed `mavros-extras` in the `roskinetic-xenial:v1.0` docker to access the `/mavros/odometry/out` and `/mavros/odometry/in` topics.

The VOXL drone runs in `station` mode and is connected to my WiFi. The drone can run `rostopic echo <topic_name>` and see the messages published over the network, including the messages from the docker that publishes the Vicon poses via ROS. QGroundControl also sees the drone whenever the drone is running.

**Issues:**

1. What EKF2 parameters should I change so the drone uses the Vicon system? I saw another mention that I should set `EKF2_AID_MASK = 24`, which includes `vision position fusion` and `vision yaw fusion`. Is this configuration correct? Do I need to set any other parameters?

2. What VOXL parameter do I need to set (if any) to tell VOXL to use a motion capture system instead of the onboard VIO?

3. PX4 (on the drone) gives me an error when I publish the odometry messages from the Vicon system on the topic `/mavros/odometry/out`. They mainly relate to the frame IDs used. What should I set for the `frame_id` and the `child_frame_id` in the odometry messages?

4. How can I test if PX4 receives the odometry messages via ROS?

@DarkKnightCH and @IC, were you able to solve the issues you were experiencing in the post referenced above?
