Vicon and odroid cannot position lock and position mode fail

Hello friends
@Jaeyoung-Lim @DevTeam
– I’m using mocap vicon streaming data to my pixhawk board, the fusion works fine, I can get around 30Hz data form topic /mavros/local_position/pose, but when want switch to position mode, it not turn solid green, when increase the throttle (use transmitter) no response, please see the log, the log files keep says lpe reinit, or mocap timeoput, but I didn’t get this from the ros terminal, only in the drone’s log file,

– this is not a new topic, but I also want to know, I disabled the GPS, and it keep request home position, is this the reason it stops me switch to offboard mode and position mode.

Hello experts !

– really need some help! please see the EKF2 and vicon data position fusion, it has a large drift, but the orientation looks fine, some one can help? @TSC21 @Jaeyoung-Lim Screenshot from 2021-10-01 22-06-27|690x407

ok, let me settle this down:

  1. conclusion 1
    LPE with Mocap (I use Vicon) + vicon_bridge can get fused data from topic “/mavros/local_pose/pose” , and it was published around 30Hz, u can test the frequency bu command rostopic hz /mavros/local_pose/pose.
  • 1-1:
    But, this will not allow u switch to POSCTL mode from transmitter, don’t say offboard control, if u check the log file from the pixhawk board, at the end of the file, u can see lpe timeout, reinit to a position repeatedly.
  1. conclusion 2
    changed to EKF2, then this works fine, it can allow u switch to POSCTL mode, and LED indicator shows solid green, means position lock, if u check from QGC mavlink console, type in ekf2 status u will get “local position valid”, global position invalid (I may remember not exact correct).
    I tested the position control mode, make sure u should arm first and then switch to position mode from the stabilized mode or similar, we did this when the drone is already hovering in the air in stabilized mode. The vicon provide the feedback has good position lock, altitude is quite steady.
  • 2-1:
    My quadcopter is quad x frame, diameter is only 260mm, it is a small size drone, so if u are using a small size frame, the default value of the PID and the THR_CURV is not ok, it will generate lots oscillations, so careful.

  • 2-2:
    Tested OFFBOARD mode, using mavros send a set point before arm and switch the mode to offboard, then arm the board using rosrun mavros mavsafety arm && rosrun mavros mavsys mode -c OFFBOARD, I suggest u set a short delay between these two command, this can be easily done in bash script by add sleep(0.5) or similar way. Then the drone take off to the set position, I tried using ros service set another position, it also works, will move to my next goal.

  • 2-3
    EKF2 convergence. Notice that the EKF2 after u poweroff the companion computer, it will not aligned, or I should say not converged more accurate. so I did in this way: connect the vicon streaming, but in stabilized mode fly a little bit, let the EKF2 /mavros/local_pose/pose close to the vicon data, then landing and disarm it. After it, I conduct to do my offboard flight test. Not sure it is the correct or necessary procedure, I will try not calibrate the EKF2 directly go to offboard see if it still work.

  • 2-4:
    I saw someone met fusion failure problem including me at beginning, u should run the vicon_bridge streaming in companion computer and also the mavros pkg, this will sync the time i believe, ros master u can run on ur station PC, and minor thing, if possible, using wifi 5Ghz to reduce the interference with 2.4Ghz signals (may not that obvious outcome ).

3.Conclusion 3
some other px4 parameters settings on pixhawk board, u can easily find from the forum, just be careful and patient, especially u want fly indoor with mocap system, these parameters influence lot, and try to use a transmitter to test ur setting.

Will move to my next step, hope these procedures help.

1 Like