0

I'm trying to make VISUAL_POSITION_ESTIMATE messages work. After a lot of trial and error, I ended up creating a very basic sample program, that simply feeds the position & orientation that PX4 reports for the drone in the form of VISUAL_POSITION_ESTIMATE messages. My expectation was that this would be a noop, as the visual position sent to PX4 is the same that it already has calculated.

The result is that one can't even arm the drone in such a setup.

If one arms the drone and takes off without considering the VISUAL_POSITION_ESTIMATE messages, then starts to consider them after the drone is airborne, the drone will end up tumbling & moving erratically.

I wonder what I'm doing wrong, and how to make VISUAL_POSITION_ESTIMATE messages work. Any help is appreciated.

Details of the experiment:

I have a PX4 SITL setup using AirSim, as descrived here: https://dev.px4.io/en/simulation/airsim.html . I'm using the latest master for the PX4 Firmware. the ./build/posix_sitl_default/bin/px4 executable is started from the source directory. the PX4 startup script is this one: https://pastebin.com/C7ExQzuk

after startup, I start my minimal VISUAL_POSITION_ESTIMATE app, which is based on the mavlink_upd.c sample code, here is the source: https://pastebin.com/FfxRkQYJ

if I start PX4 with considering visual position estimates, I can't even arm it:

pxh> param set EKF2_AID_MASK 25
+ EKF2_AID_MASK: curr: 1 -> new: 25
pxh> INFO  [ecl/EKF] EKF commencing external vision position fusion
INFO  [ecl/EKF] EKF commencing external vision yaw fusion

pxh> INFO  [ecl/EKF] EKF GPS checks passed (WGS-84 origin set, using GPS height)
INFO  [ecl/EKF] EKF commencing GPS fusion

pxh> commander arm
WARN  [commander_tests] PREFLIGHT FAIL: EKF INTERNAL CHECKS
ERROR [commander] arming failed

of I start it with GPS-only, I can arm & take off, but then it will time out on the fusion and the drone will tumble / move around:

pxh> commander arm
pxh> INFO  [logger] Start file log
INFO  [logger] Opened log file: ./log/2018-08-21/15_11_20.ulg

pxh> 
pxh> 
pxh> commander takeoff
pxh> INFO  [commander] Takeoff detected

pxh> param set EKF2_AID_MASK 25
+ EKF2_AID_MASK: curr: 1 -> new: 25
pxh> INFO  [ecl/EKF] EKF commencing external vision position fusion

pxh> WARN  [ecl/EKF] EKF GPS fusion timeout - reset to GPS
WARN  [ecl/EKF] EKF GPS fusion timeout - reset to GPS

tumbling is related to the fusion timeout events noted above.

I wonder what I'm doing wrong, and what is the simplest way to get a naive dummy sample of VISUAL_POSITION_ESTIMATE messages working.

Akos

Ákos Maróy
  • 919
  • 2
  • 10
  • 19
  • It's `VISION_POSITION_ESTIMATE`, not `VISUAL`. – Ankor Aug 24 '18 at 01:44
  • 1. The most probable explanation is that your message in wrong in some way. Can you check it's echo in QGroundControl MAVLink Inspector? – Ankor Aug 24 '18 at 02:02
  • 2. Have you tried LPE? I use vision position estimate with LPE without hassle, but had some problems with EKF2 earlier. – Ankor Aug 24 '18 at 02:09
  • @AndreiKorigodski I also tried LPE, and results were better, but I could still 'confuse' the state of the LPE fusion by just sending VISION_POSITION_ESTIMATE updates, and it wouldn't recover even after I stopped sending any data. would you be open to share some info about your environment, like the PX4 startup script (rcS script), and maybe some sample VISION_POSITION_ESTIMATE messages that you're sending? – Ákos Maróy Aug 26 '18 at 19:59
  • rcS is default, why would I change it just for VPE? I use mavros (ROS package) to send VPE: https://github.com/CopterExpress/clever/blob/master/clever/src/aruco_vpe.cpp – Ankor Aug 28 '18 at 10:59
  • Do you use Mavlink or Mavros for communication? – Dogukan Altay Jan 20 '21 at 14:39

0 Answers0