- removed unnecessary process function calls

- use one function call to fill actuator outputs
This commit is contained in:
tumbili
2015-08-12 19:18:20 +02:00
parent 5a4df66f52
commit 4ecde8661f
@@ -43,7 +43,6 @@
* @author Thomas Gubler <thomasgubler@gmail.com> * @author Thomas Gubler <thomasgubler@gmail.com>
* *
*/ */
#include "vtol_att_control_main.h" #include "vtol_att_control_main.h"
namespace VTOL_att_control namespace VTOL_att_control
@@ -493,13 +492,11 @@ void VtolAttitudeControl::task_main()
// vehicle is in rotary wing mode // vehicle is in rotary wing mode
_vtol_vehicle_status.vtol_in_rw_mode = true; _vtol_vehicle_status.vtol_in_rw_mode = true;
_vtol_type->update_mc_state();
// got data from mc attitude controller // got data from mc attitude controller
if (fds[0].revents & POLLIN) { if (fds[0].revents & POLLIN) {
orb_copy(ORB_ID(actuator_controls_virtual_mc), _actuator_inputs_mc, &_actuators_mc_in); orb_copy(ORB_ID(actuator_controls_virtual_mc), _actuator_inputs_mc, &_actuators_mc_in);
_vtol_type->process_mc_data(); _vtol_type->update_mc_state();
fill_mc_att_rates_sp(); fill_mc_att_rates_sp();
} }
@@ -507,14 +504,12 @@ void VtolAttitudeControl::task_main()
// vehicle is in fw mode // vehicle is in fw mode
_vtol_vehicle_status.vtol_in_rw_mode = false; _vtol_vehicle_status.vtol_in_rw_mode = false;
_vtol_type->update_fw_state();
// got data from fw attitude controller // got data from fw attitude controller
if (fds[1].revents & POLLIN) { if (fds[1].revents & POLLIN) {
orb_copy(ORB_ID(actuator_controls_virtual_fw), _actuator_inputs_fw, &_actuators_fw_in); orb_copy(ORB_ID(actuator_controls_virtual_fw), _actuator_inputs_fw, &_actuators_fw_in);
vehicle_manual_poll(); vehicle_manual_poll();
_vtol_type->process_fw_data(); _vtol_type->update_fw_state();
fill_fw_att_rates_sp(); fill_fw_att_rates_sp();
} }
@@ -534,8 +529,6 @@ void VtolAttitudeControl::task_main()
// update transition state if got any new data // update transition state if got any new data
if (got_new_data) { if (got_new_data) {
_vtol_type->update_transition_state(); _vtol_type->update_transition_state();
_vtol_type->process_mc_data();
fill_mc_att_rates_sp(); fill_mc_att_rates_sp();
} }
@@ -544,6 +537,7 @@ void VtolAttitudeControl::task_main()
_vtol_type->update_external_state(); _vtol_type->update_external_state();
} }
_vtol_type->fill_actuator_outputs();
/* Only publish if the proper mode(s) are enabled */ /* Only publish if the proper mode(s) are enabled */
if(_v_control_mode.flag_control_attitude_enabled || if(_v_control_mode.flag_control_attitude_enabled ||