mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 06:23:33 +08:00
had the wrong variable and wrong setpoint type
This commit is contained in:
@@ -379,6 +379,7 @@ MavlinkReceiver::handle_message_quad_swarm_roll_pitch_yaw_thrust(mavlink_message
|
|||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
ml_mode = OFFBOARD_CONTROL_MODE_DIRECT_POSITION;
|
ml_mode = OFFBOARD_CONTROL_MODE_DIRECT_POSITION;
|
||||||
|
ml_armed = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ private:
|
|||||||
struct position_setpoint_triplet_s _pos_sp_triplet; /**< vehicle global position setpoint triplet */
|
struct position_setpoint_triplet_s _pos_sp_triplet; /**< vehicle global position setpoint triplet */
|
||||||
struct vehicle_local_position_setpoint_s _local_pos_sp; /**< vehicle local position setpoint */
|
struct vehicle_local_position_setpoint_s _local_pos_sp; /**< vehicle local position setpoint */
|
||||||
struct vehicle_global_velocity_setpoint_s _global_vel_sp; /**< vehicle global velocity setpoint */
|
struct vehicle_global_velocity_setpoint_s _global_vel_sp; /**< vehicle global velocity setpoint */
|
||||||
struct offboard_control_setpoint_s _offboard_control_pos_sp; /**< offboard control position setpoint
|
struct vehicle_local_position_setpoint_s _offboard_control_pos_sp; /**< offboard control position setpoint */
|
||||||
|
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
@@ -532,7 +532,7 @@ MulticopterPositionControl::task_main()
|
|||||||
_arming_sub = orb_subscribe(ORB_ID(actuator_armed));
|
_arming_sub = orb_subscribe(ORB_ID(actuator_armed));
|
||||||
_local_pos_sub = orb_subscribe(ORB_ID(vehicle_local_position));
|
_local_pos_sub = orb_subscribe(ORB_ID(vehicle_local_position));
|
||||||
_pos_sp_triplet_sub = orb_subscribe(ORB_ID(position_setpoint_triplet));
|
_pos_sp_triplet_sub = orb_subscribe(ORB_ID(position_setpoint_triplet));
|
||||||
_offboard_control_pos_sp_sub = orb_subscribe(ORB_ID(offboard_control_setpoint));
|
_offboard_control_pos_sp_sub = orb_subscribe(ORB_ID(vehicle_local_position_setpoint));
|
||||||
|
|
||||||
parameters_update(true);
|
parameters_update(true);
|
||||||
|
|
||||||
@@ -676,15 +676,15 @@ MulticopterPositionControl::task_main()
|
|||||||
orb_check(_offboard_control_pos_sp_sub, &updated);
|
orb_check(_offboard_control_pos_sp_sub, &updated);
|
||||||
|
|
||||||
if (updated) {
|
if (updated) {
|
||||||
orb_copy(ORB_ID(offboard_control_setpoint), _offboard_control_pos_sp_sub,
|
orb_copy(ORB_ID(vehicle_local_position_setpoint), _offboard_control_pos_sp_sub,
|
||||||
&_offboard_control_pos_sp);
|
&_offboard_control_pos_sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hopefully no one dies from this */
|
/* Hopefully no one dies from this */
|
||||||
pos(0) = _offboard_control_pos_sp.p1;
|
_pos_sp(0) = _offboard_control_pos_sp.x;
|
||||||
pos(1) = _offboard_control_pos_sp.p2;
|
_pos_sp(1) = _offboard_control_pos_sp.y;
|
||||||
pos(2) = _offboard_control_pos_sp.p4;
|
_pos_sp(2) = _offboard_control_pos_sp.z;
|
||||||
_att_sp.yaw_body = _offboard_control_pos_sp.p3;
|
_att_sp.yaw_body = _offboard_control_pos_sp.yaw;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* AUTO */
|
/* AUTO */
|
||||||
|
|||||||
Reference in New Issue
Block a user