mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-29 12:24:06 +08:00
vehicle local position setpoint: use array for thrust setpoint
This commit is contained in:
parent
a74c1116ee
commit
85a263c7bd
@ -12,6 +12,4 @@ float32 vz # in meters/sec
|
||||
float32 acc_x # in meters/(sec*sec)
|
||||
float32 acc_y # in meters/(sec*sec)
|
||||
float32 acc_z # in meters/(sec*sec)
|
||||
float32 thr_x # normalized
|
||||
float32 thr_y # normalized
|
||||
float32 thr_z # normalized
|
||||
float32[3] thr # normalized thrust vector in NED
|
||||
|
||||
@ -131,7 +131,7 @@ protected:
|
||||
void _setYawspeedSetpoint(const float &yawspeed) { _vehicle_local_position_setpoint.yawspeed = yawspeed; }
|
||||
|
||||
/* Put the thrust setpoint produced by the task into the setpoint message */
|
||||
void _setThrustSetpoint(const matrix::Vector3f &thrust_setpoint) { thrust_setpoint.copyToRaw(&_vehicle_local_position_setpoint.thr_x);}
|
||||
void _setThrustSetpoint(const matrix::Vector3f &thrust_setpoint) { thrust_setpoint.copyTo(_vehicle_local_position_setpoint.thr);}
|
||||
|
||||
private:
|
||||
uORB::Subscription<vehicle_local_position_s> *_sub_vehicle_local_position{nullptr};
|
||||
|
||||
@ -90,7 +90,7 @@ void PositionControl::updateSetpoint(struct vehicle_local_position_setpoint_s se
|
||||
_pos_sp = Data(&setpoint.x);
|
||||
_vel_sp = Data(&setpoint.vx);
|
||||
_acc_sp = Data(&setpoint.acc_x);
|
||||
_thr_sp = Data(&setpoint.thr_x);
|
||||
_thr_sp = Data(setpoint.thr);
|
||||
_yaw_sp = setpoint.yaw; //integrate
|
||||
_yawspeed_sp = setpoint.yawspeed;
|
||||
_interfaceMapping();
|
||||
@ -100,7 +100,7 @@ void PositionControl::updateSetpoint(struct vehicle_local_position_setpoint_s se
|
||||
*/
|
||||
_skipController = false;
|
||||
|
||||
if (PX4_ISFINITE(setpoint.thr_x) && PX4_ISFINITE(setpoint.thr_y) && PX4_ISFINITE(setpoint.thr_z)) {
|
||||
if (PX4_ISFINITE(setpoint.thr[0]) && PX4_ISFINITE(setpoint.thr[1]) && PX4_ISFINITE(setpoint.thr[2])) {
|
||||
_skipController = true;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user