mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 18:47:21 +08:00
Enable offboard actuator setpoints
This commit is contained in:
@@ -7,3 +7,4 @@ bool velocity
|
|||||||
bool acceleration
|
bool acceleration
|
||||||
bool attitude
|
bool attitude
|
||||||
bool body_rate
|
bool body_rate
|
||||||
|
bool actuator
|
||||||
|
|||||||
@@ -4066,12 +4066,13 @@ Commander::offboard_control_update()
|
|||||||
old.velocity != ocm.velocity ||
|
old.velocity != ocm.velocity ||
|
||||||
old.acceleration != ocm.acceleration ||
|
old.acceleration != ocm.acceleration ||
|
||||||
old.attitude != ocm.attitude ||
|
old.attitude != ocm.attitude ||
|
||||||
old.body_rate != ocm.body_rate) {
|
old.body_rate != ocm.body_rate ||
|
||||||
|
old.actuator != ocm.actuator) {
|
||||||
|
|
||||||
_status_changed = true;
|
_status_changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ocm.position || ocm.velocity || ocm.acceleration || ocm.attitude || ocm.body_rate) {
|
if (ocm.position || ocm.velocity || ocm.acceleration || ocm.attitude || ocm.body_rate || ocm.actuator) {
|
||||||
offboard_available = true;
|
offboard_available = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1271,6 +1271,7 @@ MavlinkReceiver::handle_message_set_actuator_control_target(mavlink_message_t *m
|
|||||||
//bool ignore_setpoints = bool(actuator_target.group_mlx != 2);
|
//bool ignore_setpoints = bool(actuator_target.group_mlx != 2);
|
||||||
|
|
||||||
offboard_control_mode_s offboard_control_mode{};
|
offboard_control_mode_s offboard_control_mode{};
|
||||||
|
offboard_control_mode.actuator = true;
|
||||||
offboard_control_mode.timestamp = hrt_absolute_time();
|
offboard_control_mode.timestamp = hrt_absolute_time();
|
||||||
_offboard_control_mode_pub.publish(offboard_control_mode);
|
_offboard_control_mode_pub.publish(offboard_control_mode);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user