PositionControl: fix attitude setpoint timestamp

The plot of the attitude setpoint in the log did not show any values
because the message timestamp that the position control module sets
was overwritten by the PositionControl attitude generation.
This commit is contained in:
Matthias Grob
2019-11-04 19:11:54 +01:00
parent c6cc9f0902
commit b6de83117e
4 changed files with 7 additions and 9 deletions
@@ -44,9 +44,8 @@
using namespace matrix;
namespace ControlMath
{
vehicle_attitude_setpoint_s thrustToAttitude(const Vector3f &thr_sp, const float yaw_sp)
void thrustToAttitude(const Vector3f &thr_sp, const float yaw_sp, vehicle_attitude_setpoint_s &att_sp)
{
vehicle_attitude_setpoint_s att_sp = {};
att_sp.yaw_body = yaw_sp;
// desired body_z axis = -normalize(thrust_vector)
@@ -103,8 +102,6 @@ vehicle_attitude_setpoint_s thrustToAttitude(const Vector3f &thr_sp, const float
att_sp.roll_body = euler(0);
att_sp.pitch_body = euler(1);
att_sp.thrust_body[2] = -thr_sp.length();
return att_sp;
}
Vector2f constrainXY(const Vector2f &v0, const Vector2f &v1, const float &max)