Public Member Functions | Protected Attributes | Static Protected Attributes
motoman::controller::Controller Class Reference

Class encapsulates the motoman controller interface. It also handles higher level functions such as maintining the current motion state. This class is meant to be a Singleton, but that is not explicitly enforced. Only one instance of this object should be instantiated. More...

#include <controller.h>

List of all members.

Public Member Functions

 Controller ()
 Default controller.
 Controller ()
 Default controller.
void delayTicks (int ticks)
 Stops motion job on the controller. Disables motion.
void delayTicks (int ticks)
 Stops motion job on the controller. Disables motion.
void disableMotion (void)
 Disables motion on the robot controller. Turns off servo power, turns on hold status.
void disableMotion (void)
 Disables motion on the robot controller. Turns off servo power, turns on hold status.
void enableMotion (void)
 Enables motion on the robot controller. Turns on servo power, turns off hold status.
void enableMotion (void)
 Enables motion on the robot controller. Turns on servo power, turns off hold status.
int getInteger (int index)
 Read integer data from the controller integer data table. Function blocks until data is read.
int getInteger (int index)
 Read integer data from the controller integer data table. Function blocks until data is read.
double getVelocityLimit ()
 Returns the velocity limit set for the controller. This is stored within the integer data table at VELOCITY_LIMIT_INDEX.
double getVelocityLimit ()
 Returns the velocity limit set for the controller. This is stored within the integer data table at VELOCITY_LIMIT_INDEX.
bool isJobStarted (void)
 return true if jos has been started (Based on internal class state not MotoPlus call)
bool isJobStarted (void)
 return true if jos has been started (Based on internal class state not MotoPlus call)
bool isMotionEnabled (void)
 return true if motion is enabled (Based on internal class state not MotoPlus call)
bool isMotionEnabled (void)
 return true if motion is enabled (Based on internal class state not MotoPlus call)
bool loadJob (char *path, char *job)
 Utility function for loading a job file from temporary DRAM (the memory supported by all controllers) WARNING: This function is limited to the DRAM root directory.
bool loadJob (char *path, char *job)
 Utility function for loading a job file from temporary DRAM (the memory supported by all controllers) WARNING: This function is limited to the DRAM root directory.
void setDigitalOut (int bit_offset, bool value)
 Utility function for setting a digital output in the Universal output data table (most IO is accessible there).
void setDigitalOut (int bit_offset, bool value)
 Utility function for setting a digital output in the Universal output data table (most IO is accessible there).
void setInteger (int index, int value)
 Write integer data to the controller integer data table. Function blocks until data is written.
void setInteger (int index, int value)
 Write integer data to the controller integer data table. Function blocks until data is written.
void startMotionJob (char *job_name)
 Starts motion job on the controller. Enables motion (Job cannot be started if motion is not enabled).
void startMotionJob (char *job_name)
 Starts motion job on the controller. Enables motion (Job cannot be started if motion is not enabled).
void stopMotionJob (char *job_name)
 Stops motion job on the controller. Disables motion.
void stopMotionJob (char *job_name)
 Stops motion job on the controller. Disables motion.
void waitDigitalIn (int bit_offset, bool wait_value)
 Utility function for waiting for a digital input in the Universal input data tabel (most IO is accessible there).
void waitDigitalIn (int bit_offset, bool wait_value)
 Utility function for waiting for a digital input in the Universal input data tabel (most IO is accessible there).
bool writeJob (char *path, char *job)
 Utility function for writing a job file in temporary DRAM (the memory supported by all controllers)
bool writeJob (char *path, char *job)
 Utility function for writing a job file in temporary DRAM (the memory supported by all controllers)
 ~Controller ()
 Destructor (disables motion and stops current job);.
 ~Controller ()
 Destructor (disables motion and stops current job);.

Protected Attributes

MP_HOLD_SEND_DATA hold_data
MP_STD_RSP_DATA hold_error
MP_DELETE_JOB_SEND_DATA job_delete_data
MP_STD_RSP_DATA job_error
MP_START_JOB_SEND_DATA job_start_data
bool jobStarted
 True if job started.
bool motionEnabled
 True if motion enabled.
MP_SERVO_POWER_SEND_DATA servo_power_data
MP_STD_RSP_DATA servo_power_error

Static Protected Attributes

static const int MP_ERROR = -1
 Typical MP function call return on error.
static const int MP_OK = 0
 Typical MP function call return on OK (sometimes a value greater than zero is also returned if it has some meaning, like a file descriptor.
static const int UNIV_IN_DATA_START_ = 10
static const int UNIV_IO_DATA_SIZE_ = 2048
static const int UNIV_OUT_DATA_START_ = 10010
static const int VAR_POLL_DELAY_ = 10
 Poll delay (in ticks) when querying the motoplus api.
static const int VELOCITY_LIMIT_INDEX = 94
 Index within integer data table that holds velocity limit.

Detailed Description

Class encapsulates the motoman controller interface. It also handles higher level functions such as maintining the current motion state. This class is meant to be a Singleton, but that is not explicitly enforced. Only one instance of this object should be instantiated.

THIS CLASS IS NOT THREAD-SAFE (the methods that simply wrap motoplus calls can be considered thread safe). Some internal class state data is maintained, which is not thread safe. TODO: This class will likely be shared between threads, it should be made thread safe.

Definition at line 64 of file controller.h.


Constructor & Destructor Documentation

Default controller.

Definition at line 40 of file controller.cpp.

Destructor (disables motion and stops current job);.

Definition at line 46 of file controller.cpp.

Default controller.

Destructor (disables motion and stops current job);.


Member Function Documentation

void motoman::controller::Controller::delayTicks ( int  ticks) [inline]

Stops motion job on the controller. Disables motion.

Parameters:
of ticks to delay

Definition at line 169 of file controller.h.

void motoman::controller::Controller::delayTicks ( int  ticks) [inline]

Stops motion job on the controller. Disables motion.

Parameters:
of ticks to delay

Definition at line 169 of file output/controller.h.

Disables motion on the robot controller. Turns off servo power, turns on hold status.

Definition at line 109 of file controller.cpp.

Disables motion on the robot controller. Turns off servo power, turns on hold status.

Enables motion on the robot controller. Turns on servo power, turns off hold status.

Enables motion on the robot controller. Turns on servo power, turns off hold status.

Definition at line 85 of file controller.cpp.

Read integer data from the controller integer data table. Function blocks until data is read.

Parameters:
indexin data table
Returns:
integer value

Definition at line 68 of file controller.cpp.

Read integer data from the controller integer data table. Function blocks until data is read.

Parameters:
indexin data table
Returns:
integer value

Returns the velocity limit set for the controller. This is stored within the integer data table at VELOCITY_LIMIT_INDEX.

Returns:
velocity limit (%)

Definition at line 200 of file output/controller.h.

Returns the velocity limit set for the controller. This is stored within the integer data table at VELOCITY_LIMIT_INDEX.

Returns:
velocity limit (%)

Definition at line 200 of file controller.h.

return true if jos has been started (Based on internal class state not MotoPlus call)

Returns:
true if job has been stared

Definition at line 135 of file output/controller.h.

return true if jos has been started (Based on internal class state not MotoPlus call)

Returns:
true if job has been stared

Definition at line 135 of file controller.h.

return true if motion is enabled (Based on internal class state not MotoPlus call)

Returns:
true if motion enabled

Definition at line 127 of file controller.h.

return true if motion is enabled (Based on internal class state not MotoPlus call)

Returns:
true if motion enabled

Definition at line 127 of file output/controller.h.

bool motoman::controller::Controller::loadJob ( char *  path,
char *  job 
)

Utility function for loading a job file from temporary DRAM (the memory supported by all controllers) WARNING: This function is limited to the DRAM root directory.

Parameters:
pathof the file to load (pass "" if the root directory is used)
nameof file to load (may not work with a full path)
Returns:
true if job successfully loaded

Definition at line 245 of file controller.cpp.

bool motoman::controller::Controller::loadJob ( char *  path,
char *  job 
)

Utility function for loading a job file from temporary DRAM (the memory supported by all controllers) WARNING: This function is limited to the DRAM root directory.

Parameters:
pathof the file to load (pass "" if the root directory is used)
nameof file to load (may not work with a full path)
Returns:
true if job successfully loaded
void motoman::controller::Controller::setDigitalOut ( int  bit_offset,
bool  value 
)

Utility function for setting a digital output in the Universal output data table (most IO is accessible there).

Parameters:
bitoffset in data table (0-2047)
inincoming message
void motoman::controller::Controller::setDigitalOut ( int  bit_offset,
bool  value 
)

Utility function for setting a digital output in the Universal output data table (most IO is accessible there).

Parameters:
bitoffset in data table (0-2047)
inincoming message

Definition at line 285 of file controller.cpp.

void motoman::controller::Controller::setInteger ( int  index,
int  value 
)

Write integer data to the controller integer data table. Function blocks until data is written.

Parameters:
indexin data table
valueto write
void motoman::controller::Controller::setInteger ( int  index,
int  value 
)

Write integer data to the controller integer data table. Function blocks until data is written.

Parameters:
indexin data table
valueto write

Definition at line 52 of file controller.cpp.

Starts motion job on the controller. Enables motion (Job cannot be started if motion is not enabled).

Definition at line 122 of file controller.cpp.

Starts motion job on the controller. Enables motion (Job cannot be started if motion is not enabled).

Stops motion job on the controller. Disables motion.

Definition at line 145 of file controller.cpp.

Stops motion job on the controller. Disables motion.

void motoman::controller::Controller::waitDigitalIn ( int  bit_offset,
bool  wait_value 
)

Utility function for waiting for a digital input in the Universal input data tabel (most IO is accessible there).

Parameters:
bitoffset in data table (0-2047)
inincoming message

Definition at line 303 of file controller.cpp.

void motoman::controller::Controller::waitDigitalIn ( int  bit_offset,
bool  wait_value 
)

Utility function for waiting for a digital input in the Universal input data tabel (most IO is accessible there).

Parameters:
bitoffset in data table (0-2047)
inincoming message
bool motoman::controller::Controller::writeJob ( char *  path,
char *  job 
)

Utility function for writing a job file in temporary DRAM (the memory supported by all controllers)

Parameters:
fullpath and name of file to create
fulljob string
Returns:
true if file successfully opened
bool motoman::controller::Controller::writeJob ( char *  path,
char *  job 
)

Utility function for writing a job file in temporary DRAM (the memory supported by all controllers)

Parameters:
fullpath and name of file to create
fulljob string
Returns:
true if file successfully opened

Definition at line 164 of file controller.cpp.


Member Data Documentation

MP_HOLD_SEND_DATA motoman::controller::Controller::hold_data [protected]

Definition at line 244 of file controller.h.

MP_STD_RSP_DATA motoman::controller::Controller::hold_error [protected]

Definition at line 245 of file controller.h.

MP_DELETE_JOB_SEND_DATA motoman::controller::Controller::job_delete_data [protected]

Definition at line 239 of file controller.h.

MP_STD_RSP_DATA motoman::controller::Controller::job_error [protected]

Definition at line 240 of file controller.h.

MP_START_JOB_SEND_DATA motoman::controller::Controller::job_start_data [protected]

Definition at line 238 of file controller.h.

True if job started.

Definition at line 257 of file controller.h.

True if motion enabled.

Definition at line 252 of file controller.h.

static const int motoman::controller::Controller::MP_ERROR = -1 [static, protected]

Typical MP function call return on error.

Definition at line 216 of file controller.h.

static const int motoman::controller::Controller::MP_OK = 0 [static, protected]

Typical MP function call return on OK (sometimes a value greater than zero is also returned if it has some meaning, like a file descriptor.

Definition at line 223 of file controller.h.

MP_SERVO_POWER_SEND_DATA motoman::controller::Controller::servo_power_data [protected]

Definition at line 234 of file controller.h.

Definition at line 235 of file controller.h.

static const int motoman::controller::Controller::UNIV_IN_DATA_START_ = 10 [static, protected]

Definition at line 229 of file controller.h.

static const int motoman::controller::Controller::UNIV_IO_DATA_SIZE_ = 2048 [static, protected]

Definition at line 231 of file controller.h.

static const int motoman::controller::Controller::UNIV_OUT_DATA_START_ = 10010 [static, protected]

Definition at line 230 of file controller.h.

static const int motoman::controller::Controller::VAR_POLL_DELAY_ = 10 [static, protected]

Poll delay (in ticks) when querying the motoplus api.

Definition at line 228 of file controller.h.

static const int motoman::controller::Controller::VELOCITY_LIMIT_INDEX = 94 [static, protected]

Index within integer data table that holds velocity limit.

Definition at line 209 of file controller.h.


The documentation for this class was generated from the following files:


dx100
Author(s): Shaun Edwards (Southwest Research Institute)
autogenerated on Thu Jan 2 2014 11:29:36