Add support for offboard ActuatorControl set points to RoverPositionControl (fixes #13192) (#13314)

* fix formatting

* RoverPositionControl: Support Actuator Control Setpoints (fixes #13192)

* RoverPositonControl: remove control modes, that aren't currently implemented

* RoverPositionControl: use new Publication API
This commit is contained in:
Jannik Beyerstedt
2019-11-20 15:01:51 +01:00
committed by Julian Oes
parent 16f663ad52
commit 4ce03dfc1e
2 changed files with 17 additions and 22 deletions
@@ -462,12 +462,7 @@ RoverPositionControl::run()
pos_ctrl_status.timestamp = hrt_absolute_time();
if (_pos_ctrl_status_pub != nullptr) {
orb_publish(ORB_ID(position_controller_status), _pos_ctrl_status_pub, &pos_ctrl_status);
} else {
_pos_ctrl_status_pub = orb_advertise(ORB_ID(position_controller_status), &pos_ctrl_status);
}
_pos_ctrl_status_pub.publish(pos_ctrl_status);
}
@@ -518,13 +513,12 @@ RoverPositionControl::run()
//orb_copy(ORB_ID(vehicle_attitude), _vehicle_attitude_sub, &_vehicle_att);
_act_controls.timestamp = hrt_absolute_time();
if (_actuator_controls_pub != nullptr) {
//PX4_INFO("Publishing actuator from pos control");
orb_publish(ORB_ID(actuator_controls_0), _actuator_controls_pub, &_act_controls);
} else {
_actuator_controls_pub = orb_advertise(ORB_ID(actuator_controls_0), &_act_controls);
/* Only publish if any of the proper modes are enabled */
if (_control_mode.flag_control_velocity_enabled ||
_control_mode.flag_control_attitude_enabled ||
manual_mode) {
/* publish the actuator controls */
_actuator_controls_pub.publish(_act_controls);
}
}