Flair
Framework Libre Air
|
Class generating a trajectory in 1D. More...
#include <TrajectoryGenerator1D.h>
Public Member Functions | |
TrajectoryGenerator1D (const gui::LayoutPosition *position, std::string name, std::string unit="") | |
Constructor. More... | |
~TrajectoryGenerator1D () | |
Destructor. More... | |
void | StartTraj (float startPosition, float endPosition, float startVelocity=0) |
Start trajectory. More... | |
void | StopTraj (void) |
Stop trajectory. More... | |
void | Reset (void) |
Reset. More... | |
bool | IsRunning (void) const |
Is trajectory running? More... | |
void | SetPositionOffset (float value) |
Set position offset. More... | |
void | SetSpeedOffset (float value) |
Set speed offset. More... | |
void | Update (core::Time time) |
Update using provided datas. More... | |
float | Position (void) const |
Position. More... | |
float | Speed (void) const |
Speed. More... | |
float | GetPercentageOfCompletion (void) const |
Get percentage of completion. More... | |
core::Matrix * | GetMatrix (void) const |
Output matrix. More... | |
Public Member Functions inherited from flair::core::IODevice | |
IODevice (const Object *parent, std::string name) | |
Constructor. More... | |
virtual | ~IODevice () |
Destructor. More... | |
void | AddDeviceToLog (const IODevice *device) |
Add an IODevice to the logs. More... | |
void | AddDataToLog (const io_data *data) |
Add an io_data to the log. More... | |
void | OutputToShMem (bool enabled) |
Send the output to a shared memory. More... | |
bool | IsReady (void) const |
is device ready More... | |
virtual DataType const & | GetInputDataType () const |
virtual DataType const & | GetOutputDataType () const |
Public Member Functions inherited from flair::core::Object | |
Object (const Object *parent=NULL, std::string name="", std::string type="") | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
std::string | ObjectName (void) const |
Name. More... | |
std::string | ObjectType (void) const |
Type. More... | |
const Object * | Parent (void) const |
Parent. More... | |
std::vector< const Object * > * | TypeChilds (void) const |
Childs of the same type. More... | |
std::vector< const Object * > * | Childs (void) const |
Childs. More... | |
void | Information (const char *function, int line, const char *format,...) const |
Formatted information. More... | |
void | Warning (const char *function, const char *format,...) const |
Formatted warning. More... | |
void | Error (const char *function, const char *format,...) const |
Formatted error. More... | |
bool | ErrorOccured (bool recursive=true) const |
Has an errror occured? More... | |
Additional Inherited Members | |
Public Types inherited from flair::core::Object | |
enum | color_t { Auto = 0, Red = 31, Green = 32, Orange = 33 } |
Protected Member Functions inherited from flair::core::IODevice | |
void | ProcessUpdate (io_data *data) |
Process the childs of type IODevice, and log if needed. More... | |
void | SetIsReady (bool status) |
set is ready More... | |
Class generating a trajectory in 1D.
This class generates position and velocity references, given an absolute maximum velocity and an absolute acceleration.
When trajectory is started (see StartTraj()), position and velocity will increase at the given acceleration. If the maximum velocity is reached, velocity will not increase anymore. Then, velocity will decrease according to the given acceleration until velocity is null and final position is reached.
Manual inputs can be introduced using SetPositionOffset() and SetSpeedOffset().
flair::filter::TrajectoryGenerator1D::TrajectoryGenerator1D | ( | const gui::LayoutPosition * | position, |
std::string | name, | ||
std::string | unit = "" |
||
) |
Constructor.
Construct a TrajectoryGenerator1D at given position.
The TrajectoryGenerator1D will automatically be child of position->getLayout() Layout. After calling this function, position will be deleted as it is no longer usefull.
position | position to display settings |
name | name |
unit | unit of the position (for exemple m, deg, etc). Its only used for display on ground station. |
flair::filter::TrajectoryGenerator1D::~TrajectoryGenerator1D | ( | ) |
Destructor.
void flair::filter::TrajectoryGenerator1D::StartTraj | ( | float | startPosition, |
float | endPosition, | ||
float | startVelocity = 0 |
||
) |
Start trajectory.
startPosition | start position |
endPosition | end position |
startVelocity | start velocity, should be actual velocity. This value will be saturated max velocity defined in GCS. |
void flair::filter::TrajectoryGenerator1D::StopTraj | ( | void | ) |
Stop trajectory.
void flair::filter::TrajectoryGenerator1D::Reset | ( | void | ) |
Reset.
Reset all outputs to 0. This can be done only when IsRunning()==false.
bool flair::filter::TrajectoryGenerator1D::IsRunning | ( | void | ) | const |
Is trajectory running?
void flair::filter::TrajectoryGenerator1D::SetPositionOffset | ( | float | value | ) |
Set position offset.
value | position offset |
void flair::filter::TrajectoryGenerator1D::SetSpeedOffset | ( | float | value | ) |
Set speed offset.
value | speed offset |
void flair::filter::TrajectoryGenerator1D::Update | ( | core::Time | time | ) |
Update using provided datas.
Uses values specified by StartTraj(), SetPositionOffset() and SetSpeedOffset().
time | time of the update |
float flair::filter::TrajectoryGenerator1D::Position | ( | void | ) | const |
Position.
float flair::filter::TrajectoryGenerator1D::Speed | ( | void | ) | const |
Speed.
float flair::filter::TrajectoryGenerator1D::GetPercentageOfCompletion | ( | void | ) | const |
Get percentage of completion.
Value is between 0 and 100.
core::Matrix* flair::filter::TrajectoryGenerator1D::GetMatrix | ( | void | ) | const |
Output matrix.