BlueROV-16: Solve the initialization problem

来源:互联网 发布:kg是什么意思网络 编辑:程序博客网 时间:2024/05/21 06:32
Group meeting: Reactive Control of Autonomous Drones.

Bharath taught me how to debug a python project for the whole afternoon. Learned a lot!


Try to solve the initialization problem by using:
def is_armable(self):      return self.mode != 'INITIALISING' and self.gps_0.fix_type > 1 and self._ekf_predposhorizabs

After delete self.gps_0.fix_type > 1, it still does not work.

Check what self._ekf_predposhorizabs is:

self._ekf_predposhorizabs = (m.flags & ardupilotmega.EKF_PRED_POS_HORIZ_ABS) > 0

Delete either one of m.flags or ardupilotmega.EKF_PRED_POS_HORIZ_ABS, the vehicle is armable, but if they both exist, the vehicle is not.

Display the value:  m.flags == 165 and ardupilotmega.EKF_PRED_POS_HORIZ_ABS == 512 (165 & 512 == 0)


// Auto Pilot Modes enumerationenum control_mode_t {    STABILIZE =     0,  // manual airframe angle with manual throttle    ACRO =          1,  // manual body-frame angular rate with manual throttle    ALT_HOLD =      2,  // manual airframe angle with automatic throttle    AUTO =          3,  // fully automatic waypoint control using mission commands    GUIDED =        4,  // fully automatic fly to coordinate or fly at velocity/direction using GCS immediate commands    LOITER =        5,  // automatic horizontal acceleration with automatic throttle    RTL =           6,  // automatic return to launching point    CIRCLE =        7,  // automatic circular flight with automatic throttle    LAND =          9,  // automatic landing with horizontal position control    OF_LOITER =    10,  // deprecated    DRIFT =        11,  // semi-automous position, yaw and throttle control    SPORT =        13,  // manual earth-frame angular rate control with manual throttle    FLIP =         14,  // automatically flip the vehicle on the roll axis    AUTOTUNE =     15,  // automatically tune the vehicle's roll and pitch gains    POSHOLD =      16,  // automatic position hold with manual override, with automatic throttle    BRAKE =        17,  // full-brake using inertial/GPS system, no pilot input    THROW =        18   // throw to launch mode using inertial/GPS system, no pilot input};


原创粉丝点击