Eigen Revision
Dependencies: mbed LPS25HB_I2C LSM9DS1 PIDcontroller Autopilot_Eigen LoopTicker GPSUBX_UART_Eigen SBUS_without_mainfile MedianFilter Eigen UsaPack solaESKF_Eigen Vector3 CalibrateMagneto FastPWM
autopilot.cpp@139:b378528c05f2, 2021-12-06 (annotated)
- Committer:
- cocorlow
- Date:
- Mon Dec 06 08:26:16 2021 +0000
- Revision:
- 139:b378528c05f2
- Parent:
- 137:240588882ae2
- Child:
- 140:53dbdb207542
Eigen
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cocorlow | 139:b378528c05f2 | 1 | //#include "global.hpp" |
cocorlow | 139:b378528c05f2 | 2 | // |
cocorlow | 139:b378528c05f2 | 3 | //void level_flight() |
cocorlow | 139:b378528c05f2 | 4 | //{ |
cocorlow | 139:b378528c05f2 | 5 | // Vector3 vdot = calc_vdot(); |
cocorlow | 139:b378528c05f2 | 6 | // Matrix pihat = eskf.getPihat(); |
cocorlow | 139:b378528c05f2 | 7 | // Matrix vihat = eskf.getVihat(); |
cocorlow | 139:b378528c05f2 | 8 | // autopilot.update_val(rpy, -palt, pihat, vihat, vdot); |
cocorlow | 139:b378528c05f2 | 9 | // autopilot.level(); |
cocorlow | 139:b378528c05f2 | 10 | // autopilot.keep_alt(); |
cocorlow | 139:b378528c05f2 | 11 | // autopilot.return_val(roll_obj, pitch_obj, dT_obj); |
cocorlow | 139:b378528c05f2 | 12 | //} |
cocorlow | 139:b378528c05f2 | 13 | // |
cocorlow | 139:b378528c05f2 | 14 | //void point_guide() |
cocorlow | 139:b378528c05f2 | 15 | //{ |
cocorlow | 139:b378528c05f2 | 16 | // Vector3 vdot = calc_vdot(); |
cocorlow | 139:b378528c05f2 | 17 | // Matrix pihat = eskf.getPihat(); |
cocorlow | 139:b378528c05f2 | 18 | // Matrix vihat = eskf.getVihat(); |
cocorlow | 139:b378528c05f2 | 19 | // autopilot.update_val(rpy, -palt, pihat, vihat, vdot); |
cocorlow | 139:b378528c05f2 | 20 | // autopilot.guide(); |
cocorlow | 139:b378528c05f2 | 21 | // autopilot.keep_alt(); |
cocorlow | 139:b378528c05f2 | 22 | // autopilot.return_val(roll_obj, pitch_obj, dT_obj); |
cocorlow | 139:b378528c05f2 | 23 | //} |
cocorlow | 139:b378528c05f2 | 24 | // |
cocorlow | 139:b378528c05f2 | 25 | //void turning() |
cocorlow | 139:b378528c05f2 | 26 | //{ |
cocorlow | 139:b378528c05f2 | 27 | // Vector3 vdot = calc_vdot(); |
cocorlow | 139:b378528c05f2 | 28 | // Matrix pihat = eskf.getPihat(); |
cocorlow | 139:b378528c05f2 | 29 | // Matrix vihat = eskf.getVihat(); |
cocorlow | 139:b378528c05f2 | 30 | // autopilot.update_val(rpy, -palt, pihat, vihat, vdot); |
cocorlow | 139:b378528c05f2 | 31 | // autopilot.turn(); |
cocorlow | 139:b378528c05f2 | 32 | // autopilot.keep_alt(); |
cocorlow | 139:b378528c05f2 | 33 | // autopilot.return_val(roll_obj, pitch_obj, dT_obj); |
cocorlow | 139:b378528c05f2 | 34 | //} |
cocorlow | 139:b378528c05f2 | 35 | // |
cocorlow | 139:b378528c05f2 | 36 | //void climb() |
cocorlow | 139:b378528c05f2 | 37 | //{ |
cocorlow | 139:b378528c05f2 | 38 | // Vector3 vdot = calc_vdot(); |
cocorlow | 139:b378528c05f2 | 39 | // Matrix pihat = eskf.getPihat(); |
cocorlow | 139:b378528c05f2 | 40 | // Matrix vihat = eskf.getVihat(); |
cocorlow | 139:b378528c05f2 | 41 | // autopilot.update_val(rpy, -palt, pihat, vihat, vdot); |
cocorlow | 139:b378528c05f2 | 42 | // autopilot.level(); |
cocorlow | 139:b378528c05f2 | 43 | // autopilot.climb(); |
cocorlow | 139:b378528c05f2 | 44 | // autopilot.return_val(roll_obj, pitch_obj, dT_obj); |
cocorlow | 139:b378528c05f2 | 45 | //} |
cocorlow | 139:b378528c05f2 | 46 | // |
cocorlow | 139:b378528c05f2 | 47 | //Vector3 calc_vdot() |
cocorlow | 139:b378528c05f2 | 48 | //{ |
cocorlow | 139:b378528c05f2 | 49 | // Matrix m_vdot = eskf.calcDynAcc(MatrixMath::Vector2mat(acc)); |
cocorlow | 139:b378528c05f2 | 50 | // Vector3 vdot(m_vdot(1, 1), m_vdot(2, 1), m_vdot(3, 1)); |
cocorlow | 139:b378528c05f2 | 51 | // return vdot; |
cocorlow | 139:b378528c05f2 | 52 | //} |