# Clarification on voxl and PX4 Integration for state estimation

Source: https://forum.modalai.com/topic/3167/clarification-on-voxl-and-px4-integration-for-state-estimation
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2024-03-03 19:26:15 UTC by aashry
Replies: 2 · Views: 1083

## aashry · 2024-03-03 19:26:15 UTC

Hello! 

I have some question regarding the onboard state estimation running onboard, and specifically for the interface between `voxl-vision-px4` and `voxl-qvio` 

As I understand, the `voxl-qvio-server` utilizes the Qualcomm algorithm, processing input from the tracking camera and IMU data to output QVIO data. This data is then consumed by `voxl-vision-px4`. My confusion arises at this stage: does `voxl-vision-px4` pass this VIO data as a state estimate directly to PX4, bypassing PX4's internal EKF2 processing? In other words, what exactly is running on the PX4 in this setup?

I'm aware that the EKF2 algorithm is typically used on PX4 for state estimation by fusing data from various sensors. How does this interact with the VIO data from the qvio server? Is the EKF algorithm on PX4 still active in this configuration, and if so, is it using the processed data from the qvio server to refine the state estimates?

This leads to another question about the distinction between the outputs of the qvio server and the EKF algorithm on PX4. Are they operating independently, each producing separate state estimates based on common inputs (IMU and tracking camera data), or is there a fusion of data from both for enhanced accuracy in state estimation?

Finally, I'm trying to pinpoint the source of the pose data when interfacing Mavros with `voxl-vision-px4`. Specifically  `mavros/local_position/pose` output, which algorithm (qvio or EKF2 on PX4) is providing this state estimate?

I apologize if my questions seem a bit convoluted; I'm just trying to get a clear understanding of how these systems work together for state estimation. Any insights or clarifications would be greatly appreciated!

Thanks in advance for your help!

## Reply by aashry · 2024-03-05 19:05:00 UTC

@Moderator any insights?

## Reply by Moderator (ModalAI staff) · 2024-03-06 03:05:38 UTC (in reply to aashry)

@aashry 

VIO and EKF2 are separate, concurrent state estimations. You can see where voxl-vision-hub sends the VIO data to PX4's EKF2 here: https://gitlab.com/voxl-public/voxl-sdk/services/voxl-vision-hub/-/blob/master/src/vio_manager.c?ref_type=heads#L395

I'm not sure what mavros uses, but here is the mpa-to-ros code to publish VIO data https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-mpa-to-ros/-/blob/master/catkin_ws/src/src/interfaces/vio_interface.cpp?ref_type=heads#L151
