#include <MotionModule.h>
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 MotionModulePar * | getPar (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 |
MipResources::MotionModule::MotionModule | ( | int | argc, | |
const char * | argv[] | |||
) |
Options constructor.
virtual MotionModuleTState MipResources::MotionModule::_providedLocStep | ( | ) | [protected, pure virtual] |
Implemented in MipResources::DiffDrive, and MipResources::RemoteMotionModule.
virtual void MipResources::MotionModule::_providedLocSet | ( | MotionModuleState | state | ) | [protected, pure virtual] |
Implemented in MipResources::DiffDrive, and MipResources::RemoteMotionModule.
virtual void MipResources::MotionModule::_providedSetCommands | ( | Decimal | drive, | |
Decimal | turnrate | |||
) | [protected, pure virtual] |
Implemented in MipResources::DiffDrive, and MipResources::RemoteMotionModule.
virtual ResourcePlate MipResources::MotionModule::getPlate | ( | ) | const [pure virtual] |
Gets the plate of the resource.
Implements MipResources::Resource.
Implemented in MipResources::Korebot, MipResources::KorebotROS, MipResources::Unicycle, MipResources::DiffDrive, MipResources::RemoteMotionModule, and MipResources::WebotsKoremot.
MotionModuleTState MipResources::MotionModule::getState | ( | ) |
Gets the current state (pose, velocities and timeStamp).
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.
[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.
[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 . |
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.
[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 . |
void MipResources::MotionModule::setCommands | ( | Decimal | drive, | |
Decimal | turnrate, | |||
bool | scaled = true | |||
) |
Sets velocity commands.
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.
[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.
[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.
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.
[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. |
MotionModulePar* MipResources::MotionModule::_par [protected] |
MotionModuleTState* MipResources::MotionModule::_var [protected] |