diff options
author | Julian Oes <julian@oes.ch> | 2013-06-18 15:35:26 +0200 |
---|---|---|
committer | Julian Oes <julian@oes.ch> | 2013-06-18 15:35:26 +0200 |
commit | 202792294ac8a4d0db2c0e64d944be8e95608930 (patch) | |
tree | e4c39e482d20ac53d8cf09b6df4454a617c522e5 /src/modules/commander/state_machine_helper.c | |
parent | 34c197c7cc77de0317112530eb60aa5f3ba5687d (diff) | |
parent | c3a8f177b6316a9cefd814e312742f47d3049739 (diff) | |
download | px4-firmware-202792294ac8a4d0db2c0e64d944be8e95608930.tar.gz px4-firmware-202792294ac8a4d0db2c0e64d944be8e95608930.tar.bz2 px4-firmware-202792294ac8a4d0db2c0e64d944be8e95608930.zip |
Merge remote-tracking branch 'upstream/io_fixes' into new_state_machine
Conflicts:
src/drivers/px4io/px4io.cpp
src/modules/commander/commander.c
src/modules/commander/state_machine_helper.c
src/modules/commander/state_machine_helper.h
src/modules/px4iofirmware/mixer.cpp
src/modules/uORB/topics/actuator_controls.h
src/modules/uORB/topics/vehicle_status.h
Diffstat (limited to 'src/modules/commander/state_machine_helper.c')
-rw-r--r-- | src/modules/commander/state_machine_helper.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/modules/commander/state_machine_helper.c b/src/modules/commander/state_machine_helper.c index 394ee67cc..87aad6270 100644 --- a/src/modules/commander/state_machine_helper.c +++ b/src/modules/commander/state_machine_helper.c @@ -54,9 +54,25 @@ #include <mavlink/mavlink_log.h> #include "state_machine_helper.h" +#include "commander.h" + +bool is_multirotor(const struct vehicle_status_s *current_status) +{ + return ((current_status->system_type == VEHICLE_TYPE_QUADROTOR) || + (current_status->system_type == VEHICLE_TYPE_HEXAROTOR) || + (current_status->system_type == VEHICLE_TYPE_OCTOROTOR) || + (current_status->system_type == VEHICLE_TYPE_TRICOPTER)); +} + +bool is_rotary_wing(const struct vehicle_status_s *current_status) +{ + return is_multirotor(current_status) || (current_status->system_type == VEHICLE_TYPE_HELICOPTER) + || (current_status->system_type == VEHICLE_TYPE_COAXIAL); +} int arming_state_transition(int status_pub, struct vehicle_status_s *current_state, arming_state_t new_arming_state, int safety_pub, struct actuator_safety_s *safety, const int mavlink_fd) { - + + int ret = ERROR; /* only check transition if the new state is actually different from the current one */ @@ -717,7 +733,6 @@ void state_machine_publish(int status_pub, struct vehicle_status_s *current_stat // } - ///* END SUBSYSTEM/EMERGENCY FUNCTIONS*/ // //int update_state_machine_mode_request(int status_pub, struct vehicle_status_s *current_status, const int mavlink_fd, uint8_t mode) |