Good morning everyone
I am trying to fly a quadcopter in an indoor environment, the local position is provided by an Optitrack vision system.
My hardware architecture is composed of:
- Pixhawk 6c, Firmware 1.13.2
- Raspberry PI 4.
The RPi4 is connected to the Pixhawk by serial communication over the port TELEM2, where MAVROS is initialized. It gets data from Mocap and, through this port, it sends it to the Pixhawk.
To edit parameters and check PX4 status, I use QGroundControl.
To fuse vision data with EKF, I didn’t find an official guide for the 1.13 firmware version, so I followed this one: External Position Estimation (Vision/Motion based) · PX4 Developer Guide, to have a match in parameters’ names.
In particular, I configured the EKF as follows:
EKF2_AID_MASK = vision_posion_fusion + vision_yaw_fusion + rotate_external_vision;
EKF2_HGT_MODE = Vision;
EKF2_EV_DELAY = 0;
If I want to see ODOMETRY message in the MAVLink Inspector, but setting
MAV_ODOM_LPto 1 is not enough, I should set
MAV_1_MODE = External Vision. That parameter does not exist, it is the one related to the port where I use MAVROS, so I set MAV_0_MODE and now I can see the output of the EKF2.
when trying to switch to an automatic mode such as “Hold”, I get the message: “Check for a valid Local Position Estimate”. EKF2 seems receiving and fusing the data (see second screenshot, data from ODOMETRY matches with /mavros/vision_pose/pose), but by checking in the MAVLink shell its status, it shows ’ vehicle_visual_odometry messages missed: n events’.
Even tho, I can listen to the data on vehicle_visual_odometry topic. Could the problem in the 1st question be related (I am sending data to a port that is not configured to receive external vision)?
From the first screenshot, it shows MAV_1_CONFIG and MAV_2_CONFIG are disabled. This was because initializing MAVLink at boot on these ports that are connected to the RPi4 resulted in problems during boot on the RPi4 side, so MAVROS is initialized manually on the MAVLink shell after boot.
The result is that I cannot fly with any automatic mode. I didn’t try Offboard yet because I would have a solid and functioning solution to backup in case the quadrotor doesn’t behave as expected.
Any ideas on how to fix this?
Thank you for your time, I am linking some screenshots to show the general overview.
Screenshot 1: MAV_1_MODE does not exist.
Screenshot 2: /mavros/vehicle_pose/pose and ODOMETRY data correspondancy
Screenshot 3: ekf2 status, vehicle_visual_odometry messagges miss
Screenshot 4: listening to vehicle_visual_odometry topic
Screenshot 5: Overall MAVRos and QGC status