Reverse: sensors: publish manual controls on actuator_controls_1 topic instead of actuator_controls_3

This commit is contained in:
Anton Babushkin 2014-03-05 00:00:17 +04:00
parent a50957c3ce
commit 529013ae1c
1 changed files with 14 additions and 14 deletions

View File

@ -195,7 +195,7 @@ private:
orb_advert_t _sensor_pub; /**< combined sensor data topic */
orb_advert_t _manual_control_pub; /**< manual control signal topic */
orb_advert_t _actuator_group_1_pub; /**< manual control as actuator topic */
orb_advert_t _actuator_group_3_pub; /**< manual control as actuator topic */
orb_advert_t _rc_pub; /**< raw r/c control topic */
orb_advert_t _battery_pub; /**< battery status */
orb_advert_t _airspeed_pub; /**< airspeed */
@ -459,7 +459,7 @@ Sensors::Sensors() :
/* publications */
_sensor_pub(-1),
_manual_control_pub(-1),
_actuator_group_1_pub(-1),
_actuator_group_3_pub(-1),
_rc_pub(-1),
_battery_pub(-1),
_airspeed_pub(-1),
@ -1279,7 +1279,7 @@ Sensors::rc_poll()
return;
struct manual_control_setpoint_s manual_control;
struct actuator_controls_s actuator_group_1;
struct actuator_controls_s actuator_group_3;
/* initialize to default values */
manual_control.roll = NAN;
@ -1460,14 +1460,14 @@ Sensors::rc_poll()
}
/* copy from mapped manual control to control group 3 */
actuator_group_1.control[0] = manual_control.roll;
actuator_group_1.control[1] = manual_control.pitch;
actuator_group_1.control[2] = manual_control.yaw;
actuator_group_1.control[3] = manual_control.throttle;
actuator_group_1.control[4] = manual_control.flaps;
actuator_group_1.control[5] = manual_control.aux1;
actuator_group_1.control[6] = manual_control.aux2;
actuator_group_1.control[7] = manual_control.aux3;
actuator_group_3.control[0] = manual_control.roll;
actuator_group_3.control[1] = manual_control.pitch;
actuator_group_3.control[2] = manual_control.yaw;
actuator_group_3.control[3] = manual_control.throttle;
actuator_group_3.control[4] = manual_control.flaps;
actuator_group_3.control[5] = manual_control.aux1;
actuator_group_3.control[6] = manual_control.aux2;
actuator_group_3.control[7] = manual_control.aux3;
/* check if ready for publishing */
if (_rc_pub > 0) {
@ -1487,11 +1487,11 @@ Sensors::rc_poll()
}
/* check if ready for publishing */
if (_actuator_group_1_pub > 0) {
orb_publish(ORB_ID(actuator_controls_1), _actuator_group_1_pub, &actuator_group_1);
if (_actuator_group_3_pub > 0) {
orb_publish(ORB_ID(actuator_controls_3), _actuator_group_3_pub, &actuator_group_3);
} else {
_actuator_group_1_pub = orb_advertise(ORB_ID(actuator_controls_1), &actuator_group_1);
_actuator_group_3_pub = orb_advertise(ORB_ID(actuator_controls_3), &actuator_group_3);
}
}