Framework Libre Air
flair::filter::TrajectoryGenerator1D Class Reference

Class generating a trajectory in 1D. More...

#include <TrajectoryGenerator1D.h>

+ Inheritance diagram for flair::filter::TrajectoryGenerator1D:

Public Member Functions

 TrajectoryGenerator1D (const gui::LayoutPosition *position, std::string name, std::string unit="")
 Constructor. More...
 ~TrajectoryGenerator1D ()
 Destructor. More...
void StartTraj (float start_pos, float end_pos)
 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...
core::cvmatrixMatrix (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...
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 ObjectParent (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 }
- Public Attributes inherited from flair::core::IODevice
Time lastUpdate
- Protected Member Functions inherited from flair::core::IODevice
void ProcessUpdate (io_data *data)
 Process the childs of type IODevice, and log if needed. More...

Detailed Description

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().

Constructor & Destructor Documentation

flair::filter::TrajectoryGenerator1D::TrajectoryGenerator1D ( const gui::LayoutPosition position,
std::string  name,
std::string  unit = "" 


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.

positionposition to display settings
unitunit of the position (for exemple m, deg, etc). Its only used for display on ground station.
flair::filter::TrajectoryGenerator1D::~TrajectoryGenerator1D ( )


Member Function Documentation

void flair::filter::TrajectoryGenerator1D::StartTraj ( float  start_pos,
float  end_pos 

Start trajectory.

start_posstart position
end_posend position
void flair::filter::TrajectoryGenerator1D::StopTraj ( void  )

Stop trajectory.

void flair::filter::TrajectoryGenerator1D::Reset ( void  )


Reset all outputs to 0. This can be done only when IsRunning()==false.

bool flair::filter::TrajectoryGenerator1D::IsRunning ( void  ) const

Is trajectory running?

true if trajectory is running
void flair::filter::TrajectoryGenerator1D::SetPositionOffset ( float  value)

Set position offset.

valueposition offset
void flair::filter::TrajectoryGenerator1D::SetSpeedOffset ( float  value)

Set speed offset.

valuespeed offset
void flair::filter::TrajectoryGenerator1D::Update ( core::Time  time)

Update using provided datas.

Uses values specified by StartTraj(), SetPositionOffset() and SetSpeedOffset().

timetime of the update
float flair::filter::TrajectoryGenerator1D::Position ( void  ) const


float flair::filter::TrajectoryGenerator1D::Speed ( void  ) const


core::cvmatrix* flair::filter::TrajectoryGenerator1D::Matrix ( void  ) const

Output matrix.