MipResources::MotionModule Class Reference
[Motion module]

Unycicle Motion Module (Pure virtual). More...

#include <MotionModule.h>

Inheritance diagram for MipResources::MotionModule:

MipResources::Resource MIPObject MipResources::RemoteMotionModule MipResources::Unicycle MipResources::DiffDrive MipResources::Korebot MipResources::KorebotROS MipResources::WebotsDiffDrive MipResources::WebotsKoremot

List of all members.

Public Member Functions

 MotionModule (int argc, const char *argv[])
 Options constructor.
virtual ResourcePlate getPlate () const =0
 Gets the plate of the resource.
MotionModuleTState getState ()
 Gets the current state (pose, velocities and timeStamp).
virtual MotionModuleTState getState (Time ts)
 Gets the state refferred to a certain timestamp, if inside the log may be interpolated, if after (but before now) a new state is got, otherwise fatal is called.
bool setState (MotionModuleState state, bool setPastTimeStamp=false, Time pastTimeStamp=Time())
 Sets the pose and velocities of the robot. If setPastTimeStamp is true and then it sets the pose and velocities referred pastTimeStamp and accordingly updates the current pose and velocities. If setPastTimeStamp is false it sets the current pose and velocities.
bool setState (MotionModuleState correctedState, MotionModuleState &finalState, bool setPastTimeStamp=false, Time pastTimeStamp=Time())
 Sets the pose and velocities of the robot. If setPastTimeStamp is true and then it sets the pose and velocities referred pastTimeStamp and accordingly updates the current pose and velocities. If setPastTimeStamp is false it sets the current pose and velocities.
void setCommands (Decimal drive, Decimal turnrate, bool scaled=true)
 Sets velocity commands.
void setCommands (Decimal drive, Decimal turnrate, MotionModuleTState &finalTState, bool scaled=true)
 Sets velocity commands.
void setCommandsAndTState (MotionModuleState correctedState, Decimal drive, Decimal turnrate, MotionModuleTState &finalTState, bool scaled=true, bool setPastTimeStamp=false, Time pastTimeStamp=Time())
 Sets velocity commands and TState.
virtual MotionModulePargetPar (void)
 Get parameters.
void getCurvature (Decimal &c, bool &infinity)
 Gets an estimate of the curvature of the current path on the basis of the localization.

Protected Member Functions

virtual MotionModuleTState _providedLocStep ()=0
virtual void _providedLocSet (MotionModuleState state)=0
virtual void _providedSetCommands (Decimal drive, Decimal turnrate)=0

Protected Attributes

MotionModuleTStateLog _varLog
MotionModulePar_par
MotionModuleTState_var
MotionModuleOptions _options


Detailed Description

Unycicle Motion Module (Pure virtual).

Author:
Antonio Franchi
Todo:
Implement the commands scaling.
Todo:
Make _var a mutexed resource.
Todo:
Implement the commands scaling.
Todo:
Change name in Unycicle and create a more abstract MotionModel.

Constructor & Destructor Documentation

MipResources::MotionModule::MotionModule ( int  argc,
const char *  argv[] 
)

Options constructor.


Member Function Documentation

virtual MotionModuleTState MipResources::MotionModule::_providedLocStep (  )  [protected, pure virtual]

virtual void MipResources::MotionModule::_providedLocSet ( MotionModuleState  state  )  [protected, pure virtual]

virtual void MipResources::MotionModule::_providedSetCommands ( Decimal  drive,
Decimal  turnrate 
) [protected, pure virtual]

virtual ResourcePlate MipResources::MotionModule::getPlate (  )  const [pure virtual]

MotionModuleTState MipResources::MotionModule::getState (  ) 

Gets the current state (pose, velocities and timeStamp).

Returns:
The state (pose and velocities).

MotionModuleTState MipResources::MotionModule::getState ( Time  ts  )  [virtual]

Gets the state refferred to a certain timestamp, if inside the log may be interpolated, if after (but before now) a new state is got, otherwise fatal is called.

Returns:
Returned TState.
Parameters:
[in] ts The returned TState must have this timestamp.

Reimplemented in MipResources::KorebotROS.

bool MipResources::MotionModule::setState ( MotionModuleState  state,
bool  setPastTimeStamp = false,
Time  pastTimeStamp = Time() 
)

Sets the pose and velocities of the robot. If setPastTimeStamp is true and then it sets the pose and velocities referred pastTimeStamp and accordingly updates the current pose and velocities. If setPastTimeStamp is false it sets the current pose and velocities.

Returns:
true if ok, false if the timestamp refers to the future or other errors occurred.
Parameters:
[in] &state Pose velocities to set and timeStamp they refer to.
[in] &setPastTimeStamp If true it sets the pose and velocities referred pastTimeStamp and accordingly updates the current pose and velocities. If false it sets the current pose and velocities.
[in] &pastTimeStamp Time stamp in the past, make sense only if setPastTimeStamp is true .
Todo:
To implement the check on future.
Todo:
To implement the prediction on all the following states of the log and on the velocities.

bool MipResources::MotionModule::setState ( MotionModuleState  correctedState,
MotionModuleState finalState,
bool  setPastTimeStamp = false,
Time  pastTimeStamp = Time() 
)

Sets the pose and velocities of the robot. If setPastTimeStamp is true and then it sets the pose and velocities referred pastTimeStamp and accordingly updates the current pose and velocities. If setPastTimeStamp is false it sets the current pose and velocities.

Returns:
true if ok, false if the timestamp refers to the future or other errors occurred.
Parameters:
[in] &state Pose velocities to set and timeStamp they refer to.
[out] &finalState Actual MotionModuleTState after the correction.
[in] &setPastTimeStamp If true it sets the pose and velocities referred pastTimeStamp and accordingly updates the current pose and velocities. If false it sets the current pose and velocities.
[in] &pastTimeStamp Time stamp in the past, make sense only if setPastTimeStamp is true .
Todo:
To implement the check on future.
Todo:
To implement the prediction on all the following states of the log and on the velocities.

void MipResources::MotionModule::setCommands ( Decimal  drive,
Decimal  turnrate,
bool  scaled = true 
)

Sets velocity commands.

Note:
This method must be implemented by the derived class on the basis of the real structure of the module.
Parameters:
drive Linear velocity command.
turnrate Sngular velocity command.
scaled If true the actual velocity commands are scaled whenever a saturation is detected.

void MipResources::MotionModule::setCommands ( Decimal  drive,
Decimal  turnrate,
MotionModuleTState finalTState,
bool  scaled = true 
)

Sets velocity commands.

Note:
This method must be implemented by the derived class on the basis of the real structure of the module.
Parameters:
[in] drive Linear velocity command.
[in] turnrate Angular velocity command.
[out] &finalTState Actual MotionModuleTState.
[in] scaled If true the actual velocity commands are scaled whenever a saturation is detected.

void MipResources::MotionModule::setCommandsAndTState ( MotionModuleState  correctedState,
Decimal  drive,
Decimal  turnrate,
MotionModuleTState finalTState,
bool  scaled = true,
bool  setPastTimeStamp = false,
Time  pastTimeStamp = Time() 
)

Sets velocity commands and TState.

Note:
This method must be implemented by the derived class on the basis of the real structure of the module.
Parameters:
[in] correctedState Pose velocities to set and timeStamp they refer to.
[in] drive Linear velocity command.
[in] turnrate Angular velocity command.
[out] &finalSTtate Actual MotionModuleTState after the correction.
[in] scaled If true the actual velocity commands are scaled whenever a saturation is detected.
[in] &setPastTimeStamp If true it sets the pose and velocities referred pastTimeStamp and accordingly updates the current pose and velocities. If false it sets the current pose and velocities.
[in] &pastTimeStamp Time stamp in the past, make sense only if setPastTimeStamp is true .

virtual MotionModulePar* MipResources::MotionModule::getPar ( void   )  [inline, virtual]

Get parameters.

Returns:
Pointer to the Unicycle parameters

Reimplemented in MipResources::DiffDrive.

void MipResources::MotionModule::getCurvature ( Decimal c,
bool &  infinity 
)

Gets an estimate of the curvature of the current path on the basis of the localization.

Parameters:
[out] &c Current curvature estimate, it is valid only if infinity is true.
[out] &infinity true if the estimated curvature is infinite false if it is finite.


Member Data Documentation


The documentation for this class was generated from the following files:

Generated on Mon Feb 20 07:01:12 2017 for MIP by  doxygen 1.5.6