Flair
Framework Libre Air
flair::filter::TrajectoryGenerator2DCircle Class Reference

Class generating a circle trajectory in 2D. More...

#include <TrajectoryGenerator2DCircle.h>

+ Inheritance diagram for flair::filter::TrajectoryGenerator2DCircle:

Public Member Functions

 TrajectoryGenerator2DCircle (const gui::LayoutPosition *position, std::string name)
 Constructor. More...
 
 ~TrajectoryGenerator2DCircle ()
 Destructor. More...
 
void StartTraj (const core::Vector2Df &start_pos, float nb_lap=-1)
 Start trajectory. More...
 
void StopTraj (void)
 Stop trajectory. More...
 
void FinishTraj (void)
 Finish trajectory. More...
 
void SetCenter (const core::Vector2Df &value)
 Set center position. More...
 
void SetCenterSpeed (const core::Vector2Df &value)
 Set center speed. More...
 
void Update (core::Time time)
 Update using provided datas. More...
 
void GetPosition (core::Vector2Df &point) const
 Position. More...
 
void GetSpeed (core::Vector2Df &point) const
 Speed. More...
 
core::MatrixGetMatrix (void) const
 Output matrix. More...
 
bool IsRunning (void) const
 Is trajectory running? 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 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 }
 
- 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...
 

Detailed Description

Class generating a circle trajectory in 2D.

This class generates position and velocity references, given a maximum velocity and an absolute acceleration, for a circle.
When trajectory is started (StartTraj), position and velocity will increase at the given acceleration untill maximum velocity is reached.
When trajectory is asked to be finished (see FinishTraj()), position and velocity will decrease at the given acceleration untill null velocity is reached.
Position and velocity of the center of the circle can be manually changed through SetCenter() and SetCenterSpeed().

Constructor & Destructor Documentation

flair::filter::TrajectoryGenerator2DCircle::TrajectoryGenerator2DCircle ( const gui::LayoutPosition position,
std::string  name 
)

Constructor.

Construct a TrajectoryGenerator2DCircle at position.
The TrajectoryGenerator2DCircle will automatically be child of position->getLayout() Layout. After calling this function, position will be deleted as it is no longer usefull.

Parameters
positionposition to display settings
namename
flair::filter::TrajectoryGenerator2DCircle::~TrajectoryGenerator2DCircle ( )

Destructor.

Member Function Documentation

void flair::filter::TrajectoryGenerator2DCircle::StartTraj ( const core::Vector2Df start_pos,
float  nb_lap = -1 
)

Start trajectory.

Parameters
start_posstart position
nb_lapnumber of laps, -1 for infinite
void flair::filter::TrajectoryGenerator2DCircle::StopTraj ( void  )

Stop trajectory.

Stop abruptly the trajectory.

void flair::filter::TrajectoryGenerator2DCircle::FinishTraj ( void  )

Finish trajectory.

Finish smoothly the trajectory.

void flair::filter::TrajectoryGenerator2DCircle::SetCenter ( const core::Vector2Df value)

Set center position.

Parameters
valuecenter position
void flair::filter::TrajectoryGenerator2DCircle::SetCenterSpeed ( const core::Vector2Df value)

Set center speed.

Parameters
valuecenter speed
void flair::filter::TrajectoryGenerator2DCircle::Update ( core::Time  time)

Update using provided datas.

Uses values specified by StartTraj(), SetCenter() and SetCenterSpeed().

Parameters
timetime of the update
void flair::filter::TrajectoryGenerator2DCircle::GetPosition ( core::Vector2Df point) const

Position.

Parameters
pointreturned position
void flair::filter::TrajectoryGenerator2DCircle::GetSpeed ( core::Vector2Df point) const

Speed.

Parameters
pointreturned speed
core::Matrix* flair::filter::TrajectoryGenerator2DCircle::GetMatrix ( void  ) const

Output matrix.

Returns
matrix
bool flair::filter::TrajectoryGenerator2DCircle::IsRunning ( void  ) const

Is trajectory running?

Returns
true if trajectory is running