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.
Controller Class Reference
controller class More...
#include <Controller.h>
Public Member Functions | |
| Controller (PwmOut &pwm0, PwmOut &pwm1, PwmOut &pwm2, EncoderCounter &counter1, EncoderCounter &counter2, EncoderCounter &counter3, IMU &imu) | |
| Create and initialize a robot controller object. | |
| virtual | ~Controller () |
| Delete the robot controller object and release all allocated resources. | |
| void | setY (float y) |
| Sets the actual y coordinate of the robots position. | |
| float | getX () |
| Gets the actual x coordinate of the robots position. | |
| float | getY () |
| Gets the actual y coordinate of the robots position. | |
| float | sign (float v) |
| This method is called by the ticker timer interrupt service routine. | |
Detailed Description
controller class
Definition at line 25 of file Controller.h.
Constructor & Destructor Documentation
| Controller | ( | PwmOut & | pwm0, |
| PwmOut & | pwm1, | ||
| PwmOut & | pwm2, | ||
| EncoderCounter & | counter1, | ||
| EncoderCounter & | counter2, | ||
| EncoderCounter & | counter3, | ||
| IMU & | imu | ||
| ) |
Create and initialize a robot controller object.
- Parameters:
-
pwm0 a pwm output object to set the duty cycle for the first motor. pwm1 a pwm output object to set the duty cycle for the second motor. pwm2 a pwm output object to set the duty cycle for the third motor. counter1
Definition at line 37 of file Controller.cpp.
| ~Controller | ( | ) | [virtual] |
Delete the robot controller object and release all allocated resources.
Definition at line 152 of file Controller.cpp.
Member Function Documentation
| float getX | ( | ) |
Gets the actual x coordinate of the robots position.
- Returns:
- the x coordinate of the position, given in [m].
Definition at line 226 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 236 of file Controller.cpp.
| void setY | ( | float | y ) |
Sets the actual y coordinate of the robots position.
- Parameters:
-
y the y coordinate of the position, given in [m].
Definition at line 202 of file Controller.cpp.
| float sign | ( | float | v ) |
This method is called by the ticker timer interrupt service routine.
It sends a signal to the thread to make it run again.
Definition at line 251 of file Controller.cpp.
Generated on Tue Jul 12 2022 18:19:03 by
1.7.2