Skip to content
Snippets Groups Projects
Commit 76c94b08 authored by Beat Küng's avatar Beat Küng Committed by Lorenz Meier
Browse files

PositionControl: use constant references instead of pass-by-value for structs

parent 5cc450c7
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,7 @@ PositionControl::PositionControl()
_setParams();
};
void PositionControl::updateState(const struct vehicle_local_position_s state, const Vector3f &vel_dot)
void PositionControl::updateState(const vehicle_local_position_s &state, const Vector3f &vel_dot)
{
_pos = Vector3f(&state.x);
_vel = Vector3f(&state.vx);
......@@ -79,7 +79,7 @@ void PositionControl::updateState(const struct vehicle_local_position_s state, c
_vel_dot = vel_dot;
}
void PositionControl::updateSetpoint(struct vehicle_local_position_setpoint_s setpoint)
void PositionControl::updateSetpoint(const vehicle_local_position_setpoint_s &setpoint)
{
_pos_sp = Vector3f(&setpoint.x);
_vel_sp = Vector3f(&setpoint.vx);
......
......@@ -64,8 +64,8 @@ public:
~PositionControl() {};
void updateState(const struct vehicle_local_position_s state, const matrix::Vector3f &vel_dot);
void updateSetpoint(struct vehicle_local_position_setpoint_s setpoint);
void updateState(const vehicle_local_position_s &state, const matrix::Vector3f &vel_dot);
void updateSetpoint(const vehicle_local_position_setpoint_s &setpoint);
void updateConstraints(const Controller::Constraints &constraints);
void generateThrustYawSetpoint(const float &dt);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment