Position mode flight failed with a mocap system

Hi all,

I am facing an issue with the indoor flight with the OptiTrack system. I use a Pixhawk Cube with a Raspberry Pi 4. The OptiTrack publishes the robot pose at around 100 Hz, and the mavros node remaps the topic to /mavros/vision_pose/pose.

The issue is that I controlled the quadrotor after change the flight mode to Position mode manually. After taking off, the quadrotor could be able to hold its position at the beginning (around 20-50 seconds). Then, the Position model failed and the flight mode was changed to Attitude mode. This issue happens also for Offboard Mode, the result is that the quadrotor lands suddenly on the ground with a warning ‘blind land’. After checking the recorded rosbags or ulg files, the estimated x/y positions are suddenly fall into zeros.

If I’ve connected the raspberry pi with Pixhawk through GPIO directly. The warning is ‘invalid setpoints’. If I used an additional USB-TTL, the warning may be ‘no local position’.

Some tests:

  1. remap robot pose at lower frequency 50 Hz – no work
  2. different framework – two quadrotors are utilized (both are equipped with Cube + RPi 4) – no work
  3. different version firmware tested – no work

some log links can be found:

I’ve also found a similar issue maybe similar issue.

Any suggestion will be kind. Thanks a lot

The problem is solved.

One needs to pay attention that, the time stamp difference between the mocap computer and the onboard computer. If the difference is too large, e.g. several seconds. The EKF2 will stop working after a while. And the quadrotor will landing in my case.

1 Like

Hello friend
– May I ask a question:
– Im using px4 and vicon for my indoor flight, I followed the instructions on the official web, the fusion works fine, I can acquire the /mavros/local_position/pose data, but I cannot get a position lock when switch to position mode manually, and the terminal keep printing request home position, I didn’t have a GPS module, how u solved this issue?
thank u