Zürcher Eliteeinheit / Mbed 2 deprecated ROME2_P6

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Controller Class Reference

Controller Class Reference

This class implements the coordinate transformation, speed control and the position estimation of a mobile robot with differential drive. More...

#include <Controller.h>

Public Member Functions

 Controller (PwmOut &pwmLeft, PwmOut &pwmRight, EncoderCounter &counterLeft, EncoderCounter &counterRight)
 Creates and initializes a Controller object.
virtual ~Controller ()
 Deletes the Controller object and releases all allocated resources.
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 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.
void correctPoseWithBeacon (float xActual, float yActual, float xMeasured, float yMeasured)
 Correct the pose with given actual and measured coordinates of a beacon.

Detailed Description

This class implements the coordinate transformation, speed control and the position estimation of a mobile robot with differential drive.

Definition at line 20 of file Controller.h.


Constructor & Destructor Documentation

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

Creates and initializes a Controller object.

Parameters:
pwmLefta pwm output object to set the duty cycle for the left motor.
pwmRighta pwm output object to set the duty cycle for the right motor.
counterLeftan encoder counter object to read the position of the left motor.
counterRightan encoder counter object to read the position of the right motor.

Definition at line 35 of file Controller.cpp.

~Controller (  ) [virtual]

Deletes the Controller object and releases all allocated resources.

Definition at line 97 of file Controller.cpp.


Member Function Documentation

void correctPoseWithBeacon ( float  xActual,
float  yActual,
float  xMeasured,
float  yMeasured 
)

Correct the pose with given actual and measured coordinates of a beacon.

Parameters:
xActualthe actual x coordinate of the beacon, given in [m].
yActualthe actual y coordinate of the beacon, given in [m].
xMeasuredthe x coordinate of the beacon measured with a sensor(i.e. a laser scanner), given in [m].
yMeasuredthe y coordinate of the beacon measured with a sensor(i.e. a laser scanner), given in [m].

Definition at line 199 of file Controller.cpp.

float getActualRotationalVelocity (  )

Gets the actual rotational velocity of the robot.

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

Definition at line 133 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 124 of file Controller.cpp.

float getAlpha (  )

Gets the actual orientation of the robot.

Returns:
the orientation, given in [rad].

Definition at line 187 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 151 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 169 of file Controller.cpp.

void setAlpha ( float  alpha )

Sets the actual orientation of the robot.

Parameters:
alphathe orientation, given in [rad].

Definition at line 178 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 115 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 106 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 142 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 160 of file Controller.cpp.