rec::robotino::api2 C interface
Macros | Typedefs | Functions
OmniDrive.h File Reference

In "rec/robotino/api2/c/OmniDrive.h" you can find functions for manipulating Robotino's omnidrive. More...

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

Go to the source code of this file.

Macros

#define INVALID_OMNIDRIVEID   -1
 

Typedefs

typedef int OmniDriveId
 

Functions

DLLEXPORT OmniDriveId OmniDrive_construct ()
 
DLLEXPORT BOOL OmniDrive_destroy (OmniDriveId id)
 
DLLEXPORT BOOL OmniDrive_setComId (OmniDriveId id, ComId comId)
 
DLLEXPORT BOOL OmniDrive_setVelocity (OmniDriveId id, float vx, float vy, float omega)
 
DLLEXPORT BOOL OmniDrive_project (OmniDriveId id, float *m1, float *m2, float *m3, float vx, float vy, float omega)
 
DLLEXPORT int OmniDrive_num_objects (void)
 

Detailed Description

In "rec/robotino/api2/c/OmniDrive.h" you can find functions for manipulating Robotino's omnidrive.

Use OmniDrive_construct() to create a new omnidrive object. Associate the omnidrive object with a com object using OmniDrive_setComId(). Use OmniDrive_setVelocity() to drive Robotino.

Macro Definition Documentation

#define INVALID_OMNIDRIVEID   -1

Invalid OmniDriveId is -1

Typedef Documentation

typedef int OmniDriveId

OmniDriveId

Function Documentation

DLLEXPORT OmniDriveId OmniDrive_construct ( )

Construct an OmniDrive object

Returns
Returns the ID of the newly constructed OmniDrive object.
DLLEXPORT BOOL OmniDrive_destroy ( OmniDriveId  id)

Destroy the OmniDrive object assigned to id

Parameters
idThe id of the OmniDrive object to be destroyed
Returns
Returns TRUE (1) on success. Returns FALSE (0) if the given OmniDriveId is invalid.
DLLEXPORT int OmniDrive_num_objects ( void  )

For debugging only.

DLLEXPORT BOOL OmniDrive_project ( OmniDriveId  id,
float *  m1,
float *  m2,
float *  m3,
float  vx,
float  vy,
float  omega 
)

Project the velocity of the robot in cartesian coordinates to single motor speeds.

Parameters
idThe omnidrive id
m1The resulting speed of motor 1 in rpm
m2The resulting speed of motor 2 in rpm
m3The resulting speed of motor 3 in rpm
vxVelocity in x-direction in mm/s
vyVelocity in y-direction in mm/s
omegaAngular velocity in deg/s
Returns
Returns TRUE (1) on success. Returns FALSE (0) if the given OmniDriveId is invalid.
DLLEXPORT BOOL OmniDrive_setComId ( OmniDriveId  id,
ComId  comId 
)

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

Returns
Returns TRUE (1) on success. Returns FALSE (0) if the given OmniDriveId or ComId is invalid.
DLLEXPORT BOOL OmniDrive_setVelocity ( OmniDriveId  id,
float  vx,
float  vy,
float  omega 
)

Drive Robotino associated with id

Parameters
idThe omnidrive id
vxVelocity in x-direction in m/s
vyVelocity in y-direction in m/s
omegaAngular velocity in rad/s
Returns
Returns TRUE (1) on success. Returns FALSE (0) if the given OmniDriveId is invalid.
Remarks
This function should be called about every 100ms.