multicopter position controller use const references

This commit is contained in:
Daniel Agar
2018-08-31 14:37:49 -04:00
parent e26bfd2e79
commit 223dacee64
6 changed files with 48 additions and 52 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ const vehicle_trajectory_waypoint_s FlightTasks::getAvoidanceWaypoint()
}
}
const vehicle_trajectory_waypoint_s FlightTasks::getEmptyAvoidanceWaypoint()
const vehicle_trajectory_waypoint_s &FlightTasks::getEmptyAvoidanceWaypoint()
{
return FlightTask::empty_trajectory_waypoint;
}
+1 -1
View File
@@ -87,7 +87,7 @@ public:
* Get empty avoidance desired waypoints
* @return empty triplets in the mc_pos_control
*/
const vehicle_trajectory_waypoint_s getEmptyAvoidanceWaypoint();
const vehicle_trajectory_waypoint_s &getEmptyAvoidanceWaypoint();
/**
* Switch to the next task in the available list (for testing)
@@ -81,7 +81,7 @@ public:
* To be called to adopt parameters from an arrived vehicle command
* @return true if accepted, false if declined
*/
virtual bool applyCommandParameters(const vehicle_command_s &command) { return true; };
virtual bool applyCommandParameters(const vehicle_command_s &command) { return true; }
/**
* Call before activate() or update()
@@ -106,13 +106,13 @@ public:
* The constraints can vary with task.
* @return constraints
*/
const vehicle_constraints_s getConstraints() {return _constraints;};
const vehicle_constraints_s &getConstraints() { return _constraints; }
/**
* Get avoidance desired waypoint
* @return desired waypoints
*/
const vehicle_trajectory_waypoint_s getAvoidanceWaypoint() {return _desired_waypoint;};
const vehicle_trajectory_waypoint_s &getAvoidanceWaypoint() { return _desired_waypoint; }
/**
* Empty setpoint.