/home/ciesla/projects/svn.openrobotino.org/openrobotino1/lib/rec/robotino/com/c/Motor.h File Reference

In "rec/robotino/com/c/Motor.h" you can find functions for reading Robotino's bumper. More...

#include "rec/robotino/com/c/globals.h"
#include "rec/robotino/com/c/Com.h"

Go to the source code of this file.

Defines

#define INVALID_MOTORID   -1

Typedefs

typedef int MotorId

Functions

DLLEXPORT MotorId Motor_construct (unsigned int number)
DLLEXPORT BOOL Motor_destroy (MotorId id)
DLLEXPORT BOOL Motor_setComId (MotorId id, ComId comId)
DLLEXPORT BOOL Motor_setMotorNumber (MotorId id, unsigned int number)
DLLEXPORT unsigned int numMotors ()
DLLEXPORT BOOL Motor_setSetPointSpeed (MotorId id, float speed)
DLLEXPORT BOOL Motor_resetPosition (MotorId id)
DLLEXPORT BOOL Motor_setBrake (MotorId id, BOOL brake)
DLLEXPORT BOOL Motor_setPID (MotorId id, unsigned char kp, unsigned char ki, unsigned char kd)
DLLEXPORT float Motor_actualSpeed (MotorId id)
DLLEXPORT int Motor_actualPosition (MotorId id)
DLLEXPORT float Motor_motorCurrent (MotorId id)
DLLEXPORT float Motor_rawCurrentMeasurment (MotorId id)


Detailed Description

In "rec/robotino/com/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.


Function Documentation

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:
number number of this motor. Range [0; numMotors()-1].
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.

DLLEXPORT BOOL Motor_setComId ( MotorId  id,
ComId  comId 
)

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,
unsigned char  kp,
unsigned char  ki,
unsigned char  kd 
)

Sets the proportional, integral and differential constant of the PID controller.

Parameters:
id The id of the motor object.
kp proportional constant. Typical value 200.
ki integral constant. Typical value 10.
kd differential constant. Typical value 0.
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


Generated on Fri Aug 17 15:09:42 2012 for rec_robotino_com_c by  doxygen 1.5.5