mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 16:51:16 +08:00
fix(gimbal): set angular_velocity to NaN for test angle command
The test input's angle branch set only the quaternion, leaving angular_velocity at its stale (zero) value. A downstream that prioritizes rate over angle - e.g. the SITL gz gimbal, which holds position on a finite near-zero rate - then ignores the commanded angle, so 'gimbal test pitch X' did not move the gimbal. Set the rates to NaN for angle commands, matching InputRC's angle mode. Signed-off-by: Julian Oes <julian@oes.ch>
This commit is contained in:
1 parent
bc79cfb2fa
commit
7a538d55d1
1 file changed
+7
@@ -66,6 +66,13 @@ InputTest::UpdateResult InputTest::update(unsigned int timeout_ms, ControlData &
|
||||
matrix::Quatf q(euler);
|
||||
q.copyTo(control_data.type_data.angle.q);
|
||||
|
||||
// Angle command: no rate. Must be set explicitly, otherwise a stale
|
||||
// angular_velocity is forwarded and a downstream that prioritizes rate
|
||||
// (e.g. a device holding position on zero rate) ignores the angle.
|
||||
control_data.type_data.angle.angular_velocity[0] = NAN;
|
||||
control_data.type_data.angle.angular_velocity[1] = NAN;
|
||||
control_data.type_data.angle.angular_velocity[2] = NAN;
|
||||
|
||||
} else {
|
||||
control_data.type_data.angle.frames[0] = ControlData::TypeData::TypeAngle::Frame::AngularRate;
|
||||
control_data.type_data.angle.frames[1] = ControlData::TypeData::TypeAngle::Frame::AngularRate;
|
||||
|
||||
Reference in new issue
Block a user