forked from Archive/PX4-Autopilot
sensors: publish manual controls on actuator_controls_1 topic instead of actuator_controls_3
This commit is contained in:
parent
9817922bf9
commit
046def571d
|
@ -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_3_pub; /**< manual control as actuator topic */
|
||||
orb_advert_t _actuator_group_1_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_3_pub(-1),
|
||||
_actuator_group_1_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_3;
|
||||
struct actuator_controls_s actuator_group_1;
|
||||
|
||||
/* 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_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;
|
||||
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;
|
||||
|
||||
/* check if ready for publishing */
|
||||
if (_rc_pub > 0) {
|
||||
|
@ -1487,11 +1487,11 @@ Sensors::rc_poll()
|
|||
}
|
||||
|
||||
/* check if ready for publishing */
|
||||
if (_actuator_group_3_pub > 0) {
|
||||
orb_publish(ORB_ID(actuator_controls_3), _actuator_group_3_pub, &actuator_group_3);
|
||||
if (_actuator_group_1_pub > 0) {
|
||||
orb_publish(ORB_ID(actuator_controls_1), _actuator_group_1_pub, &actuator_group_1);
|
||||
|
||||
} else {
|
||||
_actuator_group_3_pub = orb_advertise(ORB_ID(actuator_controls_3), &actuator_group_3);
|
||||
_actuator_group_1_pub = orb_advertise(ORB_ID(actuator_controls_1), &actuator_group_1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue