mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 12:33:34 +08:00
FlightTasks: small refactor for review comments
This commit is contained in:
@@ -26,8 +26,7 @@ int FlightTask::update()
|
||||
_time = (_time_stamp_current - _time_stamp_activate) / 1e6f;
|
||||
_deltatime = math::min((_time_stamp_current - _time_stamp_last), _timeout) / 1e6f;
|
||||
_time_stamp_last = _time_stamp_current;
|
||||
int ret = _evaluate_vehicle_position();
|
||||
return ret;
|
||||
return _evaluate_vehicle_position();
|
||||
}
|
||||
|
||||
int FlightTask::_evaluate_vehicle_position()
|
||||
|
||||
@@ -64,9 +64,9 @@ public:
|
||||
virtual bool initializeSubscriptions(SubscriptionArray &subscription_array);
|
||||
|
||||
/**
|
||||
* Call once on the event where you switch to the task
|
||||
* @return 0 on success, <0 on error
|
||||
*/
|
||||
* Call once on the event where you switch to the task
|
||||
* @return 0 on success, <0 on error
|
||||
*/
|
||||
virtual int activate();
|
||||
|
||||
virtual ~FlightTask() = default;
|
||||
@@ -109,7 +109,7 @@ protected:
|
||||
void _set_acceleration_setpoint(const matrix::Vector3f &acceleration_setpoint) { acceleration_setpoint.copyToRaw(&_vehicle_local_position_setpoint.acc_x); }
|
||||
|
||||
/* Put the yaw angle produced by the task into the setpoint message */
|
||||
void _set_yaw_setpoint(const float &yaw) { _vehicle_local_position_setpoint.yaw = yaw; }
|
||||
void _set_yaw_setpoint(const float yaw) { _vehicle_local_position_setpoint.yaw = yaw; }
|
||||
|
||||
/* Put the yaw anglular rate produced by the task into the setpoint message */
|
||||
void _set_yawspeed_setpoint(const float &yawspeed) { _vehicle_local_position_setpoint.yawspeed = yawspeed; }
|
||||
|
||||
Reference in New Issue
Block a user