Represents a single motor.
More...
#include <Motor.h>
Represents a single motor.
int rec::robotino::api2::Motor::actualPosition |
( |
| ) |
const |
Retrieves the actual position of this motor.
- Returns
- actual position
- Exceptions
-
float rec::robotino::api2::Motor::actualVelocity |
( |
| ) |
const |
Retrieves the actual speed of this motor.
- Returns
- Speed in rpm.
- Exceptions
-
float rec::robotino::api2::Motor::motorCurrent |
( |
| ) |
const |
Retrieves the current of this motor.
- Returns
- motor current in A.
- Exceptions
-
virtual void rec::robotino::api2::Motor::motorReadingsChanged |
( |
float |
velocity, |
|
|
int |
position, |
|
|
float |
current |
|
) |
| |
|
virtual |
static unsigned int rec::robotino::api2::Motor::numMotors |
( |
| ) |
|
|
static |
- Returns
- Returns the number of drive motors on Robotino
- Exceptions
-
void rec::robotino::api2::Motor::resetPosition |
( |
int |
position | ) |
|
Resets the position of this motor.
- Parameters
-
position | New position after reset. |
- Exceptions
-
void rec::robotino::api2::Motor::setBrake |
( |
bool |
brake | ) |
|
Controls the brakes of this motor.
- Parameters
-
brake | If set to TRUE, the speed set-point is constantly set to 0. If set to FALSE, the speed set-point can be set by setSpeedSetPoint. |
- Exceptions
-
void rec::robotino::api2::Motor::setComId |
( |
const ComId & |
id | ) |
|
Sets the associated communication object.
- Parameters
-
id | The id of the associated communication object. |
- Exceptions
-
void rec::robotino::api2::Motor::setMotorNumber |
( |
unsigned int |
number | ) |
|
Sets the number of this motor.
- Parameters
-
number | number of this motor |
- Exceptions
-
void rec::robotino::api2::Motor::setPID |
( |
float |
kp, |
|
|
float |
ki, |
|
|
float |
kd |
|
) |
| |
Sets the proportional, integral and differential constant of the PID controller. Robotino v2 The range of values is from 0 to 255. These values are scaled by the microcontroller firmware to match with the PID controller implementation. If value is given, the microcontroller firmware uses its build in default value.
Robotino v3 Parameters are floating point values used by the microcontroller directly. If parameter is less than 0 the default parameter is used.
- Parameters
-
kp | proportional constant. Typical value for Robotino v2 is 200. Typical value for Robotino v3 is 0.1. |
ki | integral constant. Typical value for Robotino v2 is 10. Typical value for Robotino v3 is 0.005. |
kd | differential constant. Typical value 0. Not used by Robotino v3. |
- Exceptions
-
void rec::robotino::api2::Motor::setSpeedSetPoint |
( |
float |
speed | ) |
|
Sets the setpoint speed of this motor.
- Parameters
-
speed | Set point speed in rpm. |
- Exceptions
-
The documentation for this class was generated from the following file:
- C:/srcs/git/openrobotino/api2/lib/rec/robotino/api2/Motor.h