Skip to content
Snippets Groups Projects
Commit 85a263c7 authored by Dennis Mannhart's avatar Dennis Mannhart Committed by Beat Küng
Browse files

vehicle local position setpoint: use array for thrust setpoint

parent a74c1116
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment