In "rec/robotino/api2/c/Motor.h" you can find functions for reading Robotino's bumper.
More...
#include "rec/robotino/api2/c/globals.h"
#include "rec/robotino/api2/c/Com.h"
Go to the source code of this file.
In "rec/robotino/api2/c/Motor.h" you can find functions for reading Robotino's bumper.
Use Motor_construct() to create a new motor object. Associate the motor object with a com object using Motor_setComId(). Use Motor_setSetPointSpeed() to set the motor's speed.
#define INVALID_MOTORID -1 |
DLLEXPORT int Motor_actualPosition |
( |
MotorId |
id | ) |
|
Retrieves the actual position of this motor.
- Parameters
-
id | The id of the motor object. |
- Returns
- actual position
DLLEXPORT float Motor_actualSpeed |
( |
MotorId |
id | ) |
|
Retrieves the actual speed of this motor.
- Parameters
-
id | The id of the motor object. |
- Returns
- Speed in rpm.
-
Returns TRUE (1) on success. Returns FALSE (0) if the given MotorId is invalid.
DLLEXPORT MotorId Motor_construct |
( |
unsigned int |
number | ) |
|
Construct an motor object
- Parameters
-
- Returns
- Returns the ID of the newly constructed motor object.
DLLEXPORT BOOL Motor_destroy |
( |
MotorId |
id | ) |
|
Destroy the motor object assigned to id
- Parameters
-
id | The id of the motor object to be destroyed |
- Returns
- Returns TRUE (1) on success. Returns FALSE (0) if the given MotorId is invalid.
DLLEXPORT float Motor_motorCurrent |
( |
MotorId |
id | ) |
|
Retrieves the current of this motor.
- Parameters
-
id | The id of the motor object. |
- Returns
- motor current in A.
DLLEXPORT float Motor_rawCurrentMeasurment |
( |
MotorId |
id | ) |
|
The current is measured by a 10 bit adc and is not converted into A.
- Parameters
-
id | The id of the motor object. |
- Returns
- The current delivered by to this motor. Range from 0 to 1023.
DLLEXPORT BOOL Motor_resetPosition |
( |
MotorId |
id | ) |
|
Resets the position of this motor.
- Parameters
-
id | The id of the motor object. |
- Returns
- Returns TRUE (1) on success. Returns FALSE (0) if the given MotorId is invalid.
DLLEXPORT BOOL Motor_setBrake |
( |
MotorId |
id, |
|
|
BOOL |
brake |
|
) |
| |
Controls the brakes of this motor.
- Parameters
-
id | The id of the motor object. |
brake | If set to TRUE, this will activate the brake. If set to FALSE, the brake is released. |
- Returns
- Returns TRUE (1) on success. Returns FALSE (0) if the given MotorId is invalid.
Associated a motor object with a communication interface, i.e. binding the motor to a specific Robotino
- Returns
- Returns TRUE (1) on success. Returns FALSE (0) if the given MotorId or ComId is invalid.
DLLEXPORT BOOL Motor_setMotorNumber |
( |
MotorId |
id, |
|
|
unsigned int |
number |
|
) |
| |
Sets the number of this motor.
- Parameters
-
id | The id of the motor object to be set |
number | number of this motor |
- Exceptions
-
RobotinoException | if the current communication object is invalid. |
DLLEXPORT BOOL Motor_setPID |
( |
MotorId |
id, |
|
|
float |
kp, |
|
|
float |
ki, |
|
|
float |
kd |
|
) |
| |
Sets the proportional, integral and differential constant of the PID controller.
- Parameters
-
id | The id of the motor object. |
kp | proportional constant. Robotino v2: Typical value 200. Robotino v3: Typical value is 0.1. |
ki | integral constant. Robotino v2: Typical value 10. Robotino v3: Typical value is 0.005. |
kd | differential constant. Robotino v2: Typical value 0. Robotino v3: Not used. |
- Returns
- Returns TRUE (1) on success. Returns FALSE (0) if the given MotorId is invalid.
DLLEXPORT BOOL Motor_setSetPointSpeed |
( |
MotorId |
id, |
|
|
float |
speed |
|
) |
| |
Sets the setpoint speed of this motor.
- Parameters
-
id | The id of the motor object. |
speed | Set point speed in rpm. |
- Returns
- Returns TRUE (1) on success. Returns FALSE (0) if the given MotorId is invalid.
DLLEXPORT unsigned int numMotors |
( |
| ) |
|
- Returns
- Returns the number of drive motors on Robotino