|
PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <StraightLine.hpp>
Public Member Functions | |
| StraightLine (const matrix::Vector3f &pos) | |
| ~StraightLine ()=default | |
| void | setLineFromTo (const matrix::Vector3f &start, const matrix::Vector3f &end) |
| void | setSpeed (const float &speed) |
| void | generateSetpoints (matrix::Vector3f &position_setpoint, matrix::Vector3f &velocity_setpoint) |
| Generate setpoints on a straight line according to parameters. More... | |
| bool | isEndReached () |
| Check if the end was reached. More... | |
Private Attributes | |
| const matrix::Vector3f & | _position |
| vehicle position (dependency injection) More... | |
| matrix::Vector3f | _start |
| Start point of the straight line. More... | |
| matrix::Vector3f | _end |
| End point of the straight line. More... | |
| float | _speed = 1.f |
| desired speed between accelerating and decelerating More... | |
| bool | end_reached = true |
| Flag to lock further movement when end is reached. More... | |
Definition at line 46 of file StraightLine.hpp.
|
inline |
Definition at line 49 of file StraightLine.hpp.
References setLineFromTo(), start(), and ~StraightLine().
|
default |
| void StraightLine::generateSetpoints | ( | matrix::Vector3f & | position_setpoint, |
| matrix::Vector3f & | velocity_setpoint | ||
| ) |
Generate setpoints on a straight line according to parameters.
| position_setpoint | reference to the 3D vector with the position setpoint to update |
| velocity_setpoint | reference to the 3D vector with the velocity setpoint to update |
Definition at line 44 of file StraightLine.cpp.
References f(), math::min(), matrix::Vector< Type, M >::norm(), matrix::Matrix< Type, M, N >::setNaN(), matrix::Vector< Type, M >::unit_or_zero(), and velocity.
Referenced by FlightTaskOrbit::generate_circle_approach_setpoints(), and setSpeed().
|
inline |
Check if the end was reached.
Definition at line 69 of file StraightLine.hpp.
References end_reached.
Referenced by FlightTaskOrbit::generate_circle_approach_setpoints().
| void StraightLine::setLineFromTo | ( | const matrix::Vector3f & | start, |
| const matrix::Vector3f & | end | ||
| ) |
Definition at line 83 of file StraightLine.cpp.
References matrix::Vector< Type, M >::norm_squared(), and start().
Referenced by FlightTaskOrbit::generate_circle_approach_setpoints(), and StraightLine().
|
inline |
Definition at line 54 of file StraightLine.hpp.
References _speed, and generateSetpoints().
Referenced by FlightTaskOrbit::generate_circle_approach_setpoints().
|
private |
End point of the straight line.
Definition at line 75 of file StraightLine.hpp.
|
private |
vehicle position (dependency injection)
Definition at line 72 of file StraightLine.hpp.
|
private |
desired speed between accelerating and decelerating
Definition at line 76 of file StraightLine.hpp.
Referenced by setSpeed().
|
private |
Start point of the straight line.
Definition at line 74 of file StraightLine.hpp.
|
private |
Flag to lock further movement when end is reached.
Definition at line 78 of file StraightLine.hpp.
Referenced by isEndReached().