diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-09-02 11:33:52 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-09-02 11:33:52 +0200 |
commit | cae070c73e661f3242ec816cfae28bbeb37897da (patch) | |
tree | a34c62e576b52c642a3bf2e9ecd258e0aa555db0 /apps/multirotor_att_control/multirotor_att_control_main.c | |
parent | e9373752d1a651cc65555781b3c6c0ab6134ccc5 (diff) | |
download | px4-firmware-cae070c73e661f3242ec816cfae28bbeb37897da.tar.gz px4-firmware-cae070c73e661f3242ec816cfae28bbeb37897da.tar.bz2 px4-firmware-cae070c73e661f3242ec816cfae28bbeb37897da.zip |
Changed to publishing armed state in commander
Diffstat (limited to 'apps/multirotor_att_control/multirotor_att_control_main.c')
-rw-r--r-- | apps/multirotor_att_control/multirotor_att_control_main.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/apps/multirotor_att_control/multirotor_att_control_main.c b/apps/multirotor_att_control/multirotor_att_control_main.c index 9fbe4c3ca..4f5082bed 100644 --- a/apps/multirotor_att_control/multirotor_att_control_main.c +++ b/apps/multirotor_att_control/multirotor_att_control_main.c @@ -117,7 +117,6 @@ mc_thread_main(int argc, char *argv[]) actuators.control[i] = 0.0f; orb_advert_t actuator_pub = orb_advertise(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, &actuators); armed.armed = false; - orb_advert_t armed_pub = orb_advertise(ORB_ID(actuator_armed), &armed); orb_advert_t att_sp_pub = orb_advertise(ORB_ID(vehicle_attitude_setpoint), &att_sp); /* register the perf counter */ @@ -151,25 +150,13 @@ mc_thread_main(int argc, char *argv[]) att_sp.yaw_body = 0.0f; att_sp.thrust = 0.1f; } else { - if (state.flag_system_armed) { - att_sp.thrust = manual.throttle; - armed.armed = true; - - } else if (state.state_machine == SYSTEM_STATE_EMCY_CUTOFF) { - /* immediately cut off motors */ - armed.armed = false; - - } else { - /* limit motor throttle to zero for an unknown mode */ - armed.armed = false; - } + att_sp.thrust = manual.throttle; } - multirotor_control_attitude(&att_sp, &att, &state, &actuators, motor_test_mode); + multirotor_control_attitude(&att_sp, &att, &actuators); /* publish the result */ - orb_publish(ORB_ID(actuator_armed), armed_pub, &armed); orb_publish(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, actuator_pub, &actuators); orb_publish(ORB_ID(vehicle_attitude_setpoint), att_sp_pub, &att_sp); @@ -179,8 +166,6 @@ mc_thread_main(int argc, char *argv[]) printf("[multirotor att control] stopping, disarming motors.\n"); /* kill all outputs */ - armed.armed = false; - orb_publish(ORB_ID(actuator_armed), armed_pub, &armed); for (unsigned i = 0; i < NUM_ACTUATOR_CONTROLS; i++) actuators.control[i] = 0.0f; orb_publish(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, actuator_pub, &actuators); @@ -190,7 +175,6 @@ mc_thread_main(int argc, char *argv[]) close(state_sub); close(manual_sub); close(actuator_pub); - close(armed_pub); close(att_sp_pub); perf_print_counter(mc_loop_perf); |