Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Library by
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. |
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:
-
pwmLeft a pwm output object to set the duty cycle for the left motor. pwmRight a pwm output object to set the duty cycle for the right motor. counterLeft an encoder counter object to read the position of the left motor. counterRight an encoder counter object to read the position of the right motor.
Definition at line 31 of file Controller.cpp.
~Controller | ( | ) | [virtual] |
Deletes the Controller object and releases all allocated resources.
Definition at line 79 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 115 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 106 of file Controller.cpp.
void setRotationalVelocity | ( | float | velocity ) |
Sets the desired rotational velocity of the robot.
- Parameters:
-
velocity the desired rotational velocity, given in [rad/s].
Definition at line 97 of file Controller.cpp.
void setTranslationalVelocity | ( | float | velocity ) |
Sets the desired translational velocity of the robot.
- Parameters:
-
velocity the desired translational velocity, given in [m/s].
Definition at line 88 of file Controller.cpp.
Generated on Fri Jul 22 2022 18:07:55 by
