mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-16 04:17:37 +08:00
cs_check: const where possible
This commit is contained in:
@@ -533,8 +533,8 @@ void ControlAllocator::preflight_check_start(vehicle_command_s &cmd, hrt_abstime
|
||||
preflight_check_abort(now);
|
||||
}
|
||||
|
||||
int axis = (uint8_t) lroundf(cmd.param1);
|
||||
float input = cmd.param2;
|
||||
const int axis = (uint8_t) lroundf(cmd.param1);
|
||||
const float input = cmd.param2;
|
||||
|
||||
_preflight_check_running = true;
|
||||
_preflight_check_axis = axis;
|
||||
@@ -624,14 +624,14 @@ void ControlAllocator::preflight_check_overwrite_torque_sp(matrix::Vector<float,
|
||||
|
||||
void ControlAllocator::preflight_check_handle_tilt_control(hrt_abstime now)
|
||||
{
|
||||
bool is_tiltrotor = _effectiveness_source_id == EffectivenessSource::TILTROTOR_VTOL;
|
||||
const bool is_tiltrotor = _effectiveness_source_id == EffectivenessSource::TILTROTOR_VTOL;
|
||||
|
||||
if (_preflight_check_running) {
|
||||
|
||||
if (_preflight_check_axis == vehicle_command_s::AXIS_COLLECTIVE_TILT) {
|
||||
|
||||
if (is_tiltrotor) {
|
||||
float modified_tilt_control = math::constrain(_preflight_check_input, 0.f, 1.f);
|
||||
const float modified_tilt_control = math::constrain(_preflight_check_input, 0.f, 1.f);
|
||||
|
||||
_actuator_effectiveness->overrideCollectiveTilt(true, modified_tilt_control);
|
||||
|
||||
|
||||
@@ -147,14 +147,14 @@ private:
|
||||
void publish_actuator_controls();
|
||||
|
||||
void preflight_check_overwrite_torque_sp(matrix::Vector<float, NUM_AXES> (&c)[ActuatorEffectiveness::MAX_NUM_MATRICES],
|
||||
bool is_vtol);
|
||||
void preflight_check_handle_command(hrt_abstime now);
|
||||
void preflight_check_update_state(hrt_abstime now);
|
||||
void preflight_check_handle_tilt_control(hrt_abstime now);
|
||||
void preflight_check_start(vehicle_command_s &cmd, hrt_abstime now);
|
||||
void preflight_check_send_ack(uint8_t result, hrt_abstime now);
|
||||
void preflight_check_abort(hrt_abstime now);
|
||||
void preflight_check_finish(hrt_abstime now);
|
||||
const bool is_vtol);
|
||||
void preflight_check_handle_command(const hrt_abstime now);
|
||||
void preflight_check_update_state(const hrt_abstime now);
|
||||
void preflight_check_handle_tilt_control(const hrt_abstime now);
|
||||
void preflight_check_start(vehicle_command_s &cmd, const hrt_abstime now);
|
||||
void preflight_check_send_ack(uint8_t result, const hrt_abstime now);
|
||||
void preflight_check_abort(const hrt_abstime now);
|
||||
void preflight_check_finish(const hrt_abstime now);
|
||||
|
||||
AllocationMethod _allocation_method_id{AllocationMethod::NONE};
|
||||
ControlAllocation *_control_allocation[ActuatorEffectiveness::MAX_NUM_MATRICES] {}; ///< class for control allocation calculations
|
||||
|
||||
Reference in New Issue
Block a user