mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-12 21:00:35 +08:00
move takeoff state machine flight_mode_manager -> mc_pos_control
This commit is contained in:
committed by
Matthias Grob
parent
823c6078d9
commit
266ea377da
@@ -82,11 +82,6 @@ public:
|
||||
_position_control.setTiltLimit(1.f);
|
||||
_position_control.setHoverThrust(.5f);
|
||||
|
||||
_contraints.tilt = 1.f;
|
||||
_contraints.speed_xy = NAN;
|
||||
_contraints.speed_up = NAN;
|
||||
_contraints.speed_down = NAN;
|
||||
|
||||
resetInputSetpoint();
|
||||
}
|
||||
|
||||
@@ -106,7 +101,6 @@ public:
|
||||
|
||||
bool runController()
|
||||
{
|
||||
_position_control.setConstraints(_contraints);
|
||||
_position_control.setInputSetpoint(_input_setpoint);
|
||||
const bool ret = _position_control.update(.1f);
|
||||
_position_control.getLocalPositionSetpoint(_output_setpoint);
|
||||
@@ -115,7 +109,6 @@ public:
|
||||
}
|
||||
|
||||
PositionControl _position_control;
|
||||
vehicle_constraints_s _contraints{};
|
||||
vehicle_local_position_setpoint_s _input_setpoint{};
|
||||
vehicle_local_position_setpoint_s _output_setpoint{};
|
||||
vehicle_attitude_setpoint_s _attitude{};
|
||||
@@ -168,12 +161,14 @@ TEST_F(PositionControlBasicTest, TiltLimit)
|
||||
EXPECT_GT(angle, 0.f);
|
||||
EXPECT_LE(angle, 1.f);
|
||||
|
||||
_contraints.tilt = .5f;
|
||||
_position_control.setTiltLimit(0.5f);
|
||||
EXPECT_TRUE(runController());
|
||||
body_z = Quatf(_attitude.q_d).dcm_z();
|
||||
angle = acosf(body_z.dot(Vector3f(0.f, 0.f, 1.f)));
|
||||
EXPECT_GT(angle, 0.f);
|
||||
EXPECT_LE(angle, .50001f);
|
||||
|
||||
_position_control.setTiltLimit(1.f); // restore original
|
||||
}
|
||||
|
||||
TEST_F(PositionControlBasicTest, VelocityLimit)
|
||||
|
||||
Reference in New Issue
Block a user