mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 13:13:33 +08:00
FlightTasks: fix review comments
This commit is contained in:
@@ -67,7 +67,7 @@ public:
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the output data from the current task
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
const vehicle_local_position_setpoint_s &get_position_setpoint()
|
||||
{
|
||||
return _tasks[_current_task]->get_position_setpoint();
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this function initially to point all tasks to the general output data
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
inline const vehicle_local_position_setpoint_s &operator()()
|
||||
{
|
||||
return get_position_setpoint();
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch to the next task in the available list (for testing)
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
void switch_task()
|
||||
{
|
||||
switch_task(_current_task + 1);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch to a specific task (for normal usage)
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
/* something went wrong, no task running anymore */
|
||||
_current_task = -1;
|
||||
return 1;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the number of the active task
|
||||
|
||||
@@ -87,7 +87,7 @@ int FlightTaskManual::update()
|
||||
velocity_setpoint = velocity_setpoint.emult(vel_scale);
|
||||
|
||||
/* smooth out velocity setpoint by slewrate and return it */
|
||||
vel_sp_slewrate(velocity_setpoint, stick_xy, _sticks(3));
|
||||
vel_sp_slewrate(stick_xy, _sticks(3), velocity_setpoint);
|
||||
_set_velocity_setpoint(velocity_setpoint);
|
||||
|
||||
/* handle position and altitude hold */
|
||||
@@ -146,7 +146,7 @@ void FlightTaskManual::reset_slewrate_xy()
|
||||
_vel_sp_prev(1) = _velocity(1);
|
||||
}
|
||||
|
||||
void FlightTaskManual::vel_sp_slewrate(Vector3f &vel_sp, const Vector2f &stick_xy, const float &stick_z)
|
||||
void FlightTaskManual::vel_sp_slewrate(const Vector2f &stick_xy, const float &stick_z, Vector3f &vel_sp)
|
||||
{
|
||||
Vector2f vel_sp_xy(vel_sp(0), vel_sp(1));
|
||||
const Vector2f vel_sp_prev_xy(_vel_sp_prev(0), _vel_sp_prev(1));
|
||||
|
||||
@@ -133,7 +133,7 @@ private:
|
||||
math::LowPassFilter2p _filter_roll_stick;
|
||||
math::LowPassFilter2p _filter_pitch_stick;
|
||||
|
||||
void vel_sp_slewrate(matrix::Vector3f &vel_sp, const matrix::Vector2f &stick_xy, const float &stick_z);
|
||||
void vel_sp_slewrate(const matrix::Vector2f &stick_xy, const float &stick_z, matrix::Vector3f &vel_sp);
|
||||
|
||||
void reset_slewrate_xy();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user