ROME Praktikum 3 / Mbed 2 deprecated Praktikum3

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Controller Class Reference

Controller Class Reference

This class implements a controller that regulates the speed of the two motors of the ROME2 mobile robot. More...

#include <Controller.h>

Public Member Functions

 Controller (PwmOut &pwmLeft, PwmOut &pwmRight, EncoderCounter &counterLeft, EncoderCounter &counterRight)
 Creates and initialises the robot controller.
virtual ~Controller ()
 Deletes this Controller object.
void setTranslationalVelocity (float velocity)
 Sets the desired translational velocity of the robot.
void setRotationalVelocity (float velocity)
 Sets the desired rotational velocity of the robot.
float getActualTranslationalVelocity ()
 Gets the actual translational velocity of the robot.
float getActualRotationalVelocity ()
 Gets the actual rotational velocity of the robot.
void setDesiredSpeedLeft (float desiredSpeedLeft)
 Sets the desired speed of the left motor.
void setDesiredSpeedRight (float desiredSpeedRight)
 Sets the desired speed of the right motor.
float getActualSpeedLeft ()
 Gets the actual speed of the left motor.
float getActualSpeedRight ()
 Gets the actual speed of the right motor.
void setX (float x)
 Sets the actual x coordinate of the robots position.
float getX ()
 Gets the actual x coordinate of the robots position.
void setY (float y)
 Sets the actual y coordinate of the robots position.
float getY ()
 Gets the actual y coordinate of the robots position.
void setAlpha (float alpha)
 Sets the actual orientation of the robot.
float getAlpha ()
 Gets the actual orientation of the robot.

Detailed Description

This class implements a controller that regulates the speed of the two motors of the ROME2 mobile robot.

Definition at line 20 of file Controller.h.


Constructor & Destructor Documentation

Controller ( PwmOut &  pwmLeft,
PwmOut &  pwmRight,
EncoderCounter counterLeft,
EncoderCounter counterRight 
)

Creates and initialises the robot controller.

Parameters:
pwmLefta reference to the pwm output for the left motor.
pwmRighta reference to the pwm output for the right motor.
counterLefta reference to the encoder counter of the left motor.
counterRighta reference to the encoder counter of the right motor.

Definition at line 30 of file Controller.cpp.

~Controller (  ) [virtual]

Deletes this Controller object.

Definition at line 82 of file Controller.cpp.


Member Function Documentation

float getActualRotationalVelocity (  )

Gets the actual rotational velocity of the robot.

Returns:
the actual rotational velocity, given in [rad/s].

Definition at line 118 of file Controller.cpp.

float getActualSpeedLeft (  )

Gets the actual speed of the left motor.

Returns:
the actual speed given in [rpm].

Definition at line 145 of file Controller.cpp.

float getActualSpeedRight (  )

Gets the actual speed of the right motor.

Returns:
the actual speed given in [rpm].

Definition at line 154 of file Controller.cpp.

float getActualTranslationalVelocity (  )

Gets the actual translational velocity of the robot.

Returns:
the actual translational velocity, given in [m/s].

Definition at line 109 of file Controller.cpp.

float getAlpha (  )

Gets the actual orientation of the robot.

Returns:
the orientation, given in [rad].

Definition at line 208 of file Controller.cpp.

float getX (  )

Gets the actual x coordinate of the robots position.

Returns:
the x coordinate of the position, given in [m].

Definition at line 172 of file Controller.cpp.

float getY (  )

Gets the actual y coordinate of the robots position.

Returns:
the y coordinate of the position, given in [m].

Definition at line 190 of file Controller.cpp.

void setAlpha ( float  alpha )

Sets the actual orientation of the robot.

Parameters:
alphathe orientation, given in [rad].

Definition at line 199 of file Controller.cpp.

void setDesiredSpeedLeft ( float  desiredSpeedLeft )

Sets the desired speed of the left motor.

Parameters:
desiredSpeedLeftdesired speed given in [rpm].

Definition at line 127 of file Controller.cpp.

void setDesiredSpeedRight ( float  desiredSpeedRight )

Sets the desired speed of the right motor.

Parameters:
desiredSpeedRightdesired speed given in [rpm].

Definition at line 136 of file Controller.cpp.

void setRotationalVelocity ( float  velocity )

Sets the desired rotational velocity of the robot.

Parameters:
velocitythe desired rotational velocity, given in [rad/s].

Definition at line 100 of file Controller.cpp.

void setTranslationalVelocity ( float  velocity )

Sets the desired translational velocity of the robot.

Parameters:
velocitythe desired translational velocity, given in [m/s].

Definition at line 91 of file Controller.cpp.

void setX ( float  x )

Sets the actual x coordinate of the robots position.

Parameters:
xthe x coordinate of the position, given in [m].

Definition at line 163 of file Controller.cpp.

void setY ( float  y )

Sets the actual y coordinate of the robots position.

Parameters:
ythe y coordinate of the position, given in [m].

Definition at line 181 of file Controller.cpp.