Skip to content

Commit

Permalink
VTOL rate control architecture improvements (#10819)
Browse files Browse the repository at this point in the history
* attitude and rate setpoint message: use 3D array for thrust demand
* FixedWingAttitudeControl: rework airspeed scaling
  * move airspeed and scaling calculation into separate method
  * if vtol in hover and airspeed disabled use minimum airspeed instead of trim airspeed
  • Loading branch information
RomanBapst authored and dagar committed Nov 22, 2018
1 parent 75c1396 commit 90bfdb6
Show file tree
Hide file tree
Showing 28 changed files with 382 additions and 409 deletions.
2 changes: 0 additions & 2 deletions Tools/uorb_graph/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,8 @@ def __init__(self, module_whitelist=[], topic_blacklist=[]):

('mc_pos_control', r'mc_pos_control_main\.cpp$', r'\b_attitude_setpoint_id=([^,)]+)', r'^_attitude_setpoint_id$'),

('mc_att_control', r'mc_att_control_main\.cpp$', r'\b_rates_sp_id=([^,)]+)', r'^_rates_sp_id$'),
('mc_att_control', r'mc_att_control_main\.cpp$', r'\b_actuators_id=([^,)]+)', r'^_actuators_id$'),

('fw_att_control', r'FixedwingAttitudeControl\.cpp$', r'\b_rates_sp_id=([^,)]+)', r'^_rates_sp_id$'),
('fw_att_control', r'FixedwingAttitudeControl\.cpp$', r'\b_actuators_id=([^,)]+)', r'^_actuators_id$'),
('fw_att_control', r'FixedwingAttitudeControl\.cpp$', r'\b_attitude_setpoint_id=([^,)]+)', r'^_attitude_setpoint_id$'),

Expand Down
4 changes: 3 additions & 1 deletion msg/vehicle_attitude_setpoint.msg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ float32 yaw_sp_move_rate # rad/s (commanded by user)
float32[4] q_d # Desired quaternion for quaternion control
bool q_d_valid # Set to true if quaternion vector is valid

float32 thrust # Thrust in Newton the power system should generate
# For clarification: For multicopters thrust_body[0] and thrust[1] are usually 0 and thrust[2] is the negative throttle demand.
# For fixed wings thrust_x is the throttle demand and thrust_y, thrust_z will usually be zero.
float32[3] thrust_body # Normalized thrust command in body NED frame [-1,1]

bool roll_reset_integral # Reset roll integral part (navigation logic change)
bool pitch_reset_integral # Reset pitch integral part (navigation logic change)
Expand Down
5 changes: 3 additions & 2 deletions msg/vehicle_rates_setpoint.msg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ uint64 timestamp # time since system start (microseconds)
float32 roll # body angular rates in NED frame
float32 pitch # body angular rates in NED frame
float32 yaw # body angular rates in NED frame
float32 thrust # thrust normalized to 0..1

# TOPICS vehicle_rates_setpoint mc_virtual_rates_setpoint fw_virtual_rates_setpoint
# For clarification: For multicopters thrust_body[0] and thrust[1] are usually 0 and thrust[2] is the negative throttle demand.
# For fixed wings thrust_x is the throttle demand and thrust_y, thrust_z will usually be zero.
float32[3] thrust_body # Normalized thrust command in body NED frame [-1,1]
2 changes: 1 addition & 1 deletion src/examples/rover_steering_control/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void control_attitude(const struct vehicle_attitude_setpoint_s *att_sp, const st
actuators->control[2] = yaw_err * pp.yaw_p;

/* copy throttle */
actuators->control[3] = att_sp->thrust;
actuators->control[3] = att_sp->thrust_body[0];

actuators->timestamp = hrt_absolute_time();
}
Expand Down
Loading

0 comments on commit 90bfdb6

Please sign in to comment.