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

In "rec/robotino/com/c/Manipulator.h" you can find functions for controlling Robotino's manipulator. 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_MANIPULATORID   -1

Typedefs

typedef int ManipulatorId

Functions

DLLEXPORT ManipulatorId Manipulator_construct ()
DLLEXPORT BOOL Manipulator_destroy (ManipulatorId id)
DLLEXPORT BOOL Manipulator_setComId (ManipulatorId id, ComId comId)
DLLEXPORT BOOL Manipulator_grab (ManipulatorId id)
DLLEXPORT BOOL Manipulator_getReadings (ManipulatorId id, unsigned int *seq, float *angles, unsigned int *numAngles, float *speeds, unsigned int *numSpeeds, int *errors, unsigned int *numErrors, int *motors_enabled, int *store_current_position, float *cwAxesLimits, unsigned int *numCwAxesLimits, float *ccwAxesLimits, unsigned int *numCcwAxesLimits)
DLLEXPORT BOOL Manipulator_setAxis (ManipulatorId id, unsigned int axis, float angle, float speed)
DLLEXPORT BOOL Manipulator_setAxes (ManipulatorId id, const float *angles, unsigned int numAngles, const float *speeds, unsigned int numSpeeds)
DLLEXPORT BOOL Manipulator_setPowerEnabled (ManipulatorId id, unsigned int channel, int enable)
DLLEXPORT BOOL Manipulator_toggleTorque (ManipulatorId id)


Detailed Description

In "rec/robotino/com/c/Manipulator.h" you can find functions for controlling Robotino's manipulator.

Use Manipulator_construct() to create a new manipulator object. Associate the manipulator object with a com object using Manipulator_setComId(). Use Manipulator_setAxis() to drive one axis to the desired position. Use Manipulator_getReadings() to get sensor readings from Robotino's manipulator.


Function Documentation

DLLEXPORT ManipulatorId Manipulator_construct (  ) 

Construct an Manipulator object

Returns:
Returns the ID of the newly constructed Manipulator object.

DLLEXPORT BOOL Manipulator_destroy ( ManipulatorId  id  ) 

Destroy the Manipulator object assigned to id

Parameters:
id The id of the Manipulator object to be destroyed
Returns:
Returns TRUE (1) on success. Returns FALSE (0) if the given ManipulatorId is invalid.

DLLEXPORT BOOL Manipulator_getReadings ( ManipulatorId  id,
unsigned int *  seq,
float *  angles,
unsigned int *  numAngles,
float *  speeds,
unsigned int *  numSpeeds,
int *  errors,
unsigned int *  numErrors,
int *  motors_enabled,
int *  store_current_position,
float *  cwAxesLimits,
unsigned int *  numCwAxesLimits,
float *  ccwAxesLimits,
unsigned int *  numCcwAxesLimits 
)

Get readings from Robotino's manipulator. Do not forget to call Manipulator_grab first. Conditions to be met:

  • sizeof(angles) must be 9*sizeof(float)
  • sizeof(speeds) must be 9*sizeof(float)
  • sizeof(cwAxesLimits) must be 9*sizeof(float)
  • sizeof(ccwAxesLimits) must be 9*sizeof(float) Simply create array like float angles[9]; float speeds[9]; float cwAxesLimits[9]; float ccwAxesLimits[9];
    Parameters:
    id The manipulator id.
    seq The sequenze number.
    angles Array storing the current axes positions in degrees.
    numAngles The number of elemets stored in angles. This is equal to the number of axes.
    speeds Array storing the current axes speeds in rpm.
    numSpeeds The number of elemets stored in speeds. This is equal to the number of axes.
    errors Error code of axes.
    numErrors The number of elemets stored in errors. This is equal to the number of axes.
    motors_enabled Is 1 if the motors are enabled. Otherwise 0.
    store_current_position Is 1 if the store position button is pressed. Otherwise 0.
    cwAxesLimits Array storing the current axes limits in degrees.
    numCwAxesLimits The number of elemets stored in cwAxesLimits. If axes limits had been received this is equal to the number of axes. Otherwise 0.
    ccwAxesLimits Array storing the current axes limits in degrees.
    numCcwAxesLimits The number of elemets stored in ccwAxesLimits. If axes limits had been received this is equal to the number of axes. Otherwise 0.
    Returns:
    Returns TRUE (1) on success. Returns FALSE (0) if the given ManipulatorId is invalid.
    See also:
    Manipulator_grab

DLLEXPORT BOOL Manipulator_grab ( ManipulatorId  id  ) 

Grab image.

Parameters:
id The manipulator id.
Returns:
Returns TRUE (1) if a new sensor readings are available since the last call of Manipulator_grab. Returns FALSE (0) otherwise.

DLLEXPORT BOOL Manipulator_setAxes ( ManipulatorId  id,
const float *  angles,
unsigned int  numAngles,
const float *  speeds,
unsigned int  numSpeeds 
)

Set position and speed of one axis.

Parameters:
id The manipulator id.
angles Array containing the set-points in deg
numAngles Number of elements in angles
speeds Array containing the speed set-points in rpm
numSpeeds Number of elements in speeds
Returns:
Returns TRUE (1) on success. Returns FALSE (0) if the given ManipulatorId is invalid.

DLLEXPORT BOOL Manipulator_setAxis ( ManipulatorId  id,
unsigned int  axis,
float  angle,
float  speed 
)

Set position and speed of one axis.

Parameters:
id The manipulator id.
axis Axis number. Axes are counted starting with 0.
angle This is the position set-point in deg
speed This is the speed set-point in rpm
Returns:
Returns TRUE (1) on success. Returns FALSE (0) if the given ManipulatorId is invalid.

DLLEXPORT BOOL Manipulator_setComId ( ManipulatorId  id,
ComId  comId 
)

Associated an Manipulator object with a communication interface, i.e. binding the Manipulator to a specific Robotino

Returns:
Returns TRUE (1) on success. Returns FALSE (0) if the given ManipulatorId is invalid.

DLLEXPORT BOOL Manipulator_setPowerEnabled ( ManipulatorId  id,
unsigned int  channel,
int  enable 
)

Enabled/Disable power of one channel

Parameters:
id The manipulator id.
channel The channel at which to enable/disable power.
int If 1 power is enabled. 0 to disable power
Returns:
Returns TRUE (1) on success. Returns FALSE (0) if the given ManipulatorId is invalid.

DLLEXPORT BOOL Manipulator_toggleTorque ( ManipulatorId  id  ) 

Toggle the power state of all servos' motors.

Parameters:
id The manipulator id.
Returns:
Returns TRUE (1) on success. Returns FALSE (0) if the given ManipulatorId is invalid.


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