Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RT100 Class Reference

#include <Devices/rt100.H>

Inheritance diagram for RT100:

Inheritance graph
[legend]
Collaboration diagram for RT100:

Collaboration graph
[legend]
List of all members.

Detailed Description

Interface to a serial-servo-controller.

Definition at line 50 of file rt100.H.

Public Types

enum  MOTOR_STATUS {
  TASK_IN_PROGRESS = 0, TASK_COMPLETE = 1, ERROR_LIMIT_EXCEEDED = 2, NO_MOVEMENT = 3,
  MODE_ABSOLUTE_RELATIVE = 4, MODE_POSITION_FORCE = 5
}
enum  IP { IP0 = 0, IP1 = 1 }
enum  PARAM {
  CP_ERROR, CURRENT_POSITION, ERROR_LIMIT, NEW_POSITION,
  SPEED, KP, KI, KD,
  DEAD_BAND, OFFSET, MAX_FORCE, CURRENT_FORCE,
  ACCELERATION_TIME, USER_RAM, USER_IO, ACTUAL_POSITION
}
enum  IP0MOTORS {
  IP0BASE1, IP0BASE2, IP0WRIST1, IP0WRIST2,
  IP0SENSOR
}
enum  IP1MOTORS {
  IP1ELBOW, IP1SHOLDER, IP1ZED, IP1YAW,
  IP1GRIPPER
}
enum  JOINTS {
  BASE1, BASE2, WRIST1, WRIST2,
  ROLL_WRIST, TILT_WRIST, SENSOR, ELBOW,
  SHOLDER, ZED, YAW, GRIPPER
}
enum  MOTORS_TOGGLES { FORCE_POSITION, ABSOLUTE_RELATIVE, USER_INPUTOUTPUT }
enum  MOTORES_STOP { DEAD_STOP, RAMP_STOP, FREE_STOP, FREE_OFF }

Public Member Functions

 RT100 (OptionManager &mgr, const std::string &descrName="UMI RT100 Robot Arm Controller", const std::string &tagName="RT100Controller", const char *defdev="/dev/ttyS0")
 Default constructor; see ModelComponent.H.
 ~RT100 ()
 Destructor.
int init ()
 initalize the arm and set default values;
int shutdown ()
 shutdown the arm and switch off all motors
int getNumJoints ()
 get the number of joints
int setJointPosition (JOINTS joint, short int position, bool immediate=false)
 set the joint position, if immediate is true, then initiate a move command
int getJointPosition (JOINTS joint, short int *position)
 get the current joints position
int setJointParam (JOINTS joint, PARAM param, short int val)
 set the joint parameter
int moveArm (bool waitUntilComplete=false)
 move the arm to the new position
bool moveComplete ()
 return if the move arm completed
int interpolationMove (std::vector< short int > &moveVals)
 move the arm in interpolation mode
int deferredWrite (IP ipID, unsigned int ctrl, PARAM param, short int val)
 deferred write param to a particuler ctrl (done in 2 transactions)
int deferredRead (IP ipID, unsigned int ctrl, PARAM param, short int *val)
 deferred read param from a particuler ctrl (done in 2 transactions)
int immediateRead (IP ipID, unsigned int ctrl, PARAM param, short int *val)
 immediate read param from a particuler ctrl (done in 1 transactions)
int immediateWrite (IP ipID, unsigned int ctrl, PARAM param, short int val)
 immediate write param to a particuler ctrl (done in 1 transactions)
int rawCommand (IP ip, unsigned char cmdType, unsigned char *resCode, short int *results=NULL)
 send raw commands to the arm (one byte command)
int rawCommand (IP ipID, unsigned char cmdType, unsigned char *resCode, unsigned char *byte1, unsigned char *byte2)
 send raw commands to the arm (one byte command)
int rawCommand (IP ip, unsigned char cmdType, unsigned char byte1, unsigned char byte2, unsigned char *resCode)
 send raw commands to the arm (three byte command)
void initZed ()
 initalize zed to home position and reset counters
void initGripper ()
 initalize gripper to home position and reset counters
void initWrist ()
 initalize wrist to home position and reset counters
void initSholder ()
 initalize sholder to home position and reset counters
void initElbowYaw ()
 initalize elbow and yaw to home position and reset counters
void gotoHomePosition ()
 move the arm to home position

Static Public Attributes

static const int RT100_OK = 0
static const int RT100_FAIL = 1
static const unsigned char EMERGENCY_STOP = 0x24
static const unsigned int NUM_JOINTS = 12

Protected Member Functions

int switchIP (IP ipID)

Protected Attributes

nub::soft_ref< SerialitsPort
 Serial port to use.


Constructor & Destructor Documentation

RT100::RT100 OptionManager mgr,
const std::string descrName = "UMI RT100 Robot Arm Controller",
const std::string tagName = "RT100Controller",
const char *  defdev = "/dev/ttyS0"
 

Default constructor; see ModelComponent.H.

Definition at line 44 of file rt100.C.

References ModelComponent::addSubComponent(), and itsPort.

RT100::~RT100  ) 
 

Destructor.

Definition at line 60 of file rt100.C.


Member Function Documentation

int RT100::deferredRead IP  ipID,
unsigned int  ctrl,
PARAM  param,
short int *  val
 

deferred read param from a particuler ctrl (done in 2 transactions)

Definition at line 656 of file rt100.C.

References itsPort, LDEBUG, LFATAL, RT100_OK, and switchIP().

int RT100::deferredWrite IP  ipID,
unsigned int  ctrl,
PARAM  param,
short int  val
 

deferred write param to a particuler ctrl (done in 2 transactions)

Definition at line 696 of file rt100.C.

References itsPort, LDEBUG, LFATAL, RT100_OK, and switchIP().

Referenced by gotoHomePosition(), initElbowYaw(), initGripper(), initSholder(), initWrist(), initZed(), setJointParam(), and setJointPosition().

int RT100::getJointPosition JOINTS  joint,
short int *  position
 

get the current joints position

Definition at line 188 of file rt100.C.

References ASSERT, immediateRead(), LFATAL, and RT100_OK.

int RT100::getNumJoints  ) 
 

get the number of joints

Definition at line 65 of file rt100.C.

References NUM_JOINTS.

void RT100::gotoHomePosition  ) 
 

move the arm to home position

Definition at line 398 of file rt100.C.

References deferredWrite(), and rawCommand().

Referenced by init().

int RT100::immediateRead IP  ipID,
unsigned int  ctrl,
PARAM  param,
short int *  val
 

immediate read param from a particuler ctrl (done in 1 transactions)

Definition at line 735 of file rt100.C.

References itsPort, LDEBUG, LFATAL, RT100_OK, and switchIP().

Referenced by getJointPosition().

int RT100::immediateWrite IP  ipID,
unsigned int  ctrl,
PARAM  param,
short int  val
 

immediate write param to a particuler ctrl (done in 1 transactions)

Definition at line 770 of file rt100.C.

References itsPort, LDEBUG, LFATAL, RT100_OK, and switchIP().

Referenced by init().

int RT100::init  ) 
 

initalize the arm and set default values;

Definition at line 352 of file rt100.C.

References EMERGENCY_STOP, gotoHomePosition(), immediateWrite(), initElbowYaw(), initGripper(), initSholder(), initWrist(), initZed(), itsPort, LINFO, rawCommand(), and RT100_OK.

void RT100::initElbowYaw  ) 
 

initalize elbow and yaw to home position and reset counters

Definition at line 609 of file rt100.C.

References deferredWrite(), EMERGENCY_STOP, i, LFATAL, and rawCommand().

Referenced by init().

void RT100::initGripper  ) 
 

initalize gripper to home position and reset counters

Definition at line 449 of file rt100.C.

References deferredWrite(), EMERGENCY_STOP, i, LFATAL, and rawCommand().

Referenced by init().

void RT100::initSholder  ) 
 

initalize sholder to home position and reset counters

Definition at line 574 of file rt100.C.

References deferredWrite(), EMERGENCY_STOP, i, LFATAL, and rawCommand().

Referenced by init().

void RT100::initWrist  ) 
 

initalize wrist to home position and reset counters

Definition at line 512 of file rt100.C.

References deferredWrite(), EMERGENCY_STOP, i, LFATAL, and rawCommand().

Referenced by init().

void RT100::initZed  ) 
 

initalize zed to home position and reset counters

Definition at line 418 of file rt100.C.

References deferredWrite(), EMERGENCY_STOP, i, LFATAL, and rawCommand().

Referenced by init().

int RT100::interpolationMove std::vector< short int > &  moveVals  ) 
 

move the arm in interpolation mode

Definition at line 271 of file rt100.C.

References ASSERT, LDEBUG, LFATAL, LINFO, NUM_JOINTS, rawCommand(), and RT100_OK.

int RT100::moveArm bool  waitUntilComplete = false  ) 
 

move the arm to the new position

Definition at line 235 of file rt100.C.

References i, rawCommand(), and RT100_OK.

bool RT100::moveComplete  ) 
 

return if the move arm completed

Definition at line 258 of file rt100.C.

References rawCommand().

int RT100::rawCommand IP  ip,
unsigned char  cmdType,
unsigned char  byte1,
unsigned char  byte2,
unsigned char *  resCode
 

send raw commands to the arm (three byte command)

Definition at line 889 of file rt100.C.

References itsPort, LDEBUG, LFATAL, RT100_OK, and switchIP().

int RT100::rawCommand IP  ipID,
unsigned char  cmdType,
unsigned char *  resCode,
unsigned char *  byte1,
unsigned char *  byte2
 

send raw commands to the arm (one byte command)

Definition at line 857 of file rt100.C.

References itsPort, LDEBUG, LFATAL, n, RT100_OK, and switchIP().

int RT100::rawCommand IP  ip,
unsigned char  cmdType,
unsigned char *  resCode,
short int *  results = NULL
 

send raw commands to the arm (one byte command)

Definition at line 831 of file rt100.C.

References itsPort, LDEBUG, LFATAL, n, RT100_OK, and switchIP().

Referenced by gotoHomePosition(), init(), initElbowYaw(), initGripper(), initSholder(), initWrist(), initZed(), interpolationMove(), moveArm(), moveComplete(), and setJointPosition().

int RT100::setJointParam JOINTS  joint,
PARAM  param,
short int  val
 

set the joint parameter

Definition at line 71 of file rt100.C.

References deferredWrite(), LFATAL, and RT100_OK.

int RT100::setJointPosition JOINTS  joint,
short int  position,
bool  immediate = false
 

set the joint position, if immediate is true, then initiate a move command

Definition at line 121 of file rt100.C.

References deferredWrite(), LFATAL, rawCommand(), and RT100_OK.

int RT100::shutdown  ) 
 

shutdown the arm and switch off all motors

Definition at line 650 of file rt100.C.

References RT100_OK.


Member Data Documentation

nub::soft_ref<Serial> RT100::itsPort [protected]
 

Serial port to use.

Definition at line 166 of file rt100.H.

Referenced by deferredRead(), deferredWrite(), immediateRead(), immediateWrite(), init(), rawCommand(), RT100(), and switchIP().


The documentation for this class was generated from the following files:
Generated on Mon Nov 23 15:50:55 2009 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4