PositionControl: publish NAN jerk

because the controller does not read or write jerk
This commit is contained in:
Matthias Grob 2022-04-06 17:38:37 +02:00
parent 5055fec796
commit cb484c5ac7
2 changed files with 2 additions and 1 deletions

View File

@ -246,6 +246,7 @@ void PositionControl::getLocalPositionSetpoint(vehicle_local_position_setpoint_s
local_position_setpoint.vy = _vel_sp(1);
local_position_setpoint.vz = _vel_sp(2);
_acc_sp.copyTo(local_position_setpoint.acceleration);
nans<3, 1>().copyTo(local_position_setpoint.jerk);
_thr_sp.copyTo(local_position_setpoint.thrust);
}

View File

@ -52,7 +52,7 @@ TEST(PositionControlTest, EmptySetpoint)
EXPECT_FLOAT_EQ(output_setpoint.vy, 0.f);
EXPECT_FLOAT_EQ(output_setpoint.vz, 0.f);
EXPECT_EQ(Vector3f(output_setpoint.acceleration), Vector3f(0.f, 0.f, 0.f));
EXPECT_EQ(Vector3f(output_setpoint.jerk), Vector3f(0.f, 0.f, 0.f));
EXPECT_EQ(Vector3f(output_setpoint.jerk), Vector3f(NAN, NAN, NAN));
EXPECT_EQ(Vector3f(output_setpoint.thrust), Vector3f(0, 0, 0));
vehicle_attitude_setpoint_s attitude{};