diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-10-30 09:15:55 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-10-30 09:15:55 +0100 |
commit | dc80d6745e94df71d351f4338c610f910c2a4e94 (patch) | |
tree | bd4fbaa1d68fa6f38919167cea8285ba94b7e594 /src/modules/segway/BlockSegwayController.cpp | |
parent | 34d2f318ac8a72cce63e3e14e004daee45001011 (diff) | |
parent | 0fa03e65ab3ab0e173e487b3e5f5321780f3afff (diff) | |
download | px4-firmware-dc80d6745e94df71d351f4338c610f910c2a4e94.tar.gz px4-firmware-dc80d6745e94df71d351f4338c610f910c2a4e94.tar.bz2 px4-firmware-dc80d6745e94df71d351f4338c610f910c2a4e94.zip |
Merge branch 'master' of github.com:PX4/Firmware into pwm_ioctls
Diffstat (limited to 'src/modules/segway/BlockSegwayController.cpp')
-rw-r--r-- | src/modules/segway/BlockSegwayController.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/modules/segway/BlockSegwayController.cpp b/src/modules/segway/BlockSegwayController.cpp index b1dc39445..96a443c6e 100644 --- a/src/modules/segway/BlockSegwayController.cpp +++ b/src/modules/segway/BlockSegwayController.cpp @@ -26,7 +26,7 @@ void BlockSegwayController::update() { _actuators.control[i] = 0.0f; // only update guidance in auto mode - if (_status.state_machine == SYSTEM_STATE_AUTO) { + if (_status.main_state == MAIN_STATE_AUTO) { // update guidance } @@ -34,17 +34,18 @@ void BlockSegwayController::update() { float spdCmd = -th2v.update(_att.pitch) - q2v.update(_att.pitchspeed); // handle autopilot modes - if (_status.state_machine == SYSTEM_STATE_AUTO || - _status.state_machine == SYSTEM_STATE_STABILIZED) { + if (_status.main_state == MAIN_STATE_AUTO || + _status.main_state == MAIN_STATE_SEATBELT || + _status.main_state == MAIN_STATE_EASY) { _actuators.control[0] = spdCmd; _actuators.control[1] = spdCmd; - } else if (_status.state_machine == SYSTEM_STATE_MANUAL) { - if (_status.manual_control_mode == VEHICLE_MANUAL_CONTROL_MODE_DIRECT) { + } else if (_status.main_state == MAIN_STATE_MANUAL) { + if (_status.navigation_state == NAVIGATION_STATE_DIRECT) { _actuators.control[CH_LEFT] = _manual.throttle; _actuators.control[CH_RIGHT] = _manual.pitch; - } else if (_status.manual_control_mode == VEHICLE_MANUAL_CONTROL_MODE_SAS) { + } else if (_status.navigation_state == NAVIGATION_STATE_STABILIZE) { _actuators.control[0] = spdCmd; _actuators.control[1] = spdCmd; } |