PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.59k stars 13.56k forks source link

mavros/local_position/pose x and y are zero after 1 minute of running when using EKF2. #17603

Open JelmerKleine opened 3 years ago

JelmerKleine commented 3 years ago

Describe the bug

We are using an Optitrack Motion Capturing system to stream the position and orientation of our drone. When we remap this information to the mavros/vision_pose/pose and we use ekf2 to get this information to mavros/local_position/pose. After a reboot This works for a minute then it starts to drift on the x and y, after which they become equal to zero and the z –axis remains the same. If we want it to work again we have to reboot the px4 after which the problem still occurs after the 1 minute mark.

To Reproduce

Our setup:

Windows computer with optitrack which streams it's data via vrpn.
A laptop and raspberry pi which have Ubuntu 18.04 with ros melodic installed and are connected with ssh.

.bashrc laptop: export ROS_HOSTNAME= ip of the laptop in our network export ROS_MASTER_URI=http://localhost:11311

.bashrc Raspberry pi: export ROS_HOSTNAME=ip of the raspberry pi in our network
export ROS_MASTER_URI=http://ip of the laptop in our network:11311

The raspberry pi is connected to the PX4 with an usb cable.

PX4 firmwarer version is 1.11.3.

Qgrouncontrol settings:

MAV_1_CONFIG = TELEM/Serial4

MAV_1_MODE = Onboard

SER_TEL4_BAUD = 921600

EKF2_AID_MASK = 24 (Vision position fusion, vision yaw fusion)

EKF2_ASP_DELAY = 0.0 ms

EKF2_EV_DELAY = 50.0 ms

EKF2_OF_DELAY = 0.0 ms

EKF2_HGT_MODE = vision

Steps to reproduce the behavior:

  1. start the data stream from the windows computer to get vision data.

  2. start a vrpn client node on the laptop and remap the topic to mavros/vision_pose/pose.

  3. Connect the laptop to the raspberry pi with ssh.

  4. Start the mavros node with a baudrate of 921600 on the raspberry pi.

  5. check the mavros/local_position/pose and compare it to the mavros/vision_pose/pose

  6. after around a minute or so the values the starts to drift on the x and y, after which they become equal to zero and the z –axis remains the same.

Expected behavior

A mavros/local_position/pose is almost the same as the mavros/vision_pose/pose data with a slight differnce because of efk2.

Log Files and Screenshots

https://review.px4.io/plot_app?log=0dfdbda4-0b24-4275-8ea5-b306340fd2c4 image image image

Drone (please complete the following information):

Drone: holybro x500

Our drone: image

JelmerKleine commented 3 years ago

when we run our node that remaps te vision data to /mavros/vision_pose/pose on our companion computer and we don't use our laptop as master, we don't get this issue where the /mavros/local_position/pose becomes zero on the x and y.