PX4 offboard mode( EKF2) not working with px4 mini fmuv5 - ERROR in odometer message, and also cannot see vision_pose(mocap data is published and advertised) topic in uorb command

@scalnoor You are not providing the orientation of the vehicle. The vehicle looks like it is toilet bowling due to incorrect yaw estimates

Hello @Paul_Riseborough we have been facing in correct yaw estimation during offboard autonomous flights. The vehicle does CIRCLE flying patter(toilet bowl effect) . I have so far reduced the radius of circle being created by increasing the EKF2_GYRO_NOISE value. But still in the recent flights, attaching below log we are facing the issue . https://review.px4.io/plot_app?log=d8b2df5c-ccea-4ae2-b1d6-35a8c0a87d19

we need you help here for pointer. Please refer to above attached logs.

@scalnoor Have you checked if the orientation fields in the messages your mocap system is outputting is correct?

Hello @Jaeyoung-Lim, yes i did check the orientation fields from mocap system they seems to be fine. I just did set the EKF2_EV_GATE value to 10 SD and it performed much better. Below are the logs attached please kindly review them and let me know your opinion https://review.px4.io/plot_app?log=44b05063-2a3a-4e65-b367-687f3c110c60

I wish i can share you the videos, but not sure how ? And one more thing is after three or two consecutive flight i get yaw estimation error. After which anything I fly is CIRCLES again. And when compared the logs i see that raw magnetic field strength on X and Z collides causing the issue. Where as in successful flight the magnetic field strengths are pretty good each axis.

Having said this i feel px4 magnetometer is highly sensitive, is it? Or is the firmware susceptible to even small change in manometer readings ??

@scalnoor I’m just curious - our drone performes not as bad, that it is circling around
 If you feel unsure about the magnetometer you can disable it.

For our flights we disabled SYS_HAS_BARO and SYS_HAS_MAG (not sure if this are the correct variables) and set the orientation sensors to vision only (= Mocap) and height measurement also to vision only. Then you shouldn’t be affected by magnetic fields.

Can you may share your parameter list - i can have a look and can maybe help.

Hi, I have this same message from my px4. Do you find the reason and the solution already?

Hello @hsu-ret, below is the link to parameter list https://review.px4.io/download?log=44b05063-2a3a-4e65-b367-687f3c110c60&type=1

I believed that setting EKF2_HGT_MODE to vision would defuse the barometer ? But is it still required to have disable SYS_HAS_BARO parameter as well. @Jaeyoung-Lim And I wanted to understand bit more on why EKF2 looks at magnetometer for ? when it has orientation and positions feed from mocap during Offboard operations?

@robin-ecn, this is still at large but in my case it occurs intermediately. This should not cause any issue with flight operations. I believe until and unless you have mavros in connected sate with vehicle you should be good. @Jaeyoung-Lim I would still wanna know why this could be happening.

@scalnoor what do you mean by “have mavros in connected sate with vehicle”. Do you mean the real time experience?

@robin-ecn I hope you running the launch script via ros to connect your vehicle. And if you see the issue while your trying to connect to vehicle via Offboard/companion, then in that case you might worry more about if the vehicle is connected to ros and could neglect the issue .

@scalnoor AFAIK It does not turn off the mag automatically. You need to disable the mag data getting fused to the yaw. However, the log seems to show you don’t have vision yaw getting fused

so I had a look at your params and my qgc-stettings:

First it seems I was mistaken by the Sys_has_baro/mag this parameter seems just to be relevant for preflight checks - but I guess disabling won’t hurt so maybe just try so ^^

Second your settings in EKF_AID_MASK=24 and HGT_MODE =vision are correct. These should enable vision for position and orientaion and vision for height.
But as far as I know I would change settings for EKF_MAG_TYPE
If set to mc_custom: it is for indoor applications without GPS and for configurating the mag bias
OR set it to none - because orientation is provided by mocap data.
(depends if you want to use mag in addition or skip it completly)

Also I read about setting all EKF_anySensor_DELAY parameter which is not used to 0, else the EKF would calc with wrong variables. Sadly I didn’t found where it was but somewhere in the px4 docs.

You may also decrease the EKF_EV_NOISE param to ‘tell’ px4 that your external vision = mocap is very precise.

Next about your Companion Settings in MAV-CONFIG:
I added a companion computer to my drone (RPI 3B) which is connected via TELEM Port 2 and GPIO-Pins (with an indiviual power supply - because the 5V of the pixhawk were to instable for me), which is set to MAV_1_CONFIG. Also I set the MAV_1_FORWARD param to send position data to my drone via mavlink to enable offoard commands. Maybe you could try to use similar settings like mentioned in the docs ( https://dev.px4.io/master/en/companion_computer/pixhawk_companion.html )
Forthe GPIO connection have a look at ardupilot that is mostly a great guide ( http://ardupilot.org/dev/docs/raspberry-pi-via-mavlink.html )
My GPIO pins are connected is like this (and ofc you would need something for soldering the cables and the fitting connectors)
1 5V external
2 free
3 GND - TELEM 2
4 TX - TELEM 2
5 RX - TELEM 2
6 free
7 GND external

F.e. here are my settings - may they help

MAV_0_CONFIG 101
MAV_0_FORWARD 1
MAV_0_MODE 0
MAV_0_RATE 1200
MAV_1_CONFIG 102
MAV_1_FORWARD 1
MAV_1_MODE 2
MAV_1_RATE 0
MAV_2_CONFIG 0
The baudrate is set in the mavros launchfile and didn’t need to be specified here as far as I know.
Set MAV_1_RATE to 0 to use standard baudrate/2 as recommended.

I mean you had position data sucessfully send to your drone - so the mav-settings might not be cause. But everything else seems to be fine - and my drone is flying without toilet bowling ^^

Also if I attach an Intel NUC via USB/TTL to my pixhawks I got similar problems like you mentioned at the beginning (mavlink inspector LOCAL position NED is read at 0.4 HZ).
–> I would suggest to work with GPIO pins to TELEM 2 my USB connections is not running stable enough as long as my NUC is powerd by my drone battery (still don’t know the cause)

Hope this helps