$search
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>
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. | |
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.
| motoman::controller::Controller::Controller | ( | ) |
Default controller.
Definition at line 35 of file controller.cpp.
| motoman::controller::Controller::~Controller | ( | ) |
Destructor (disables motion and stops current job);.
Definition at line 41 of file controller.cpp.
| motoman::controller::Controller::Controller | ( | ) |
Default controller.
| motoman::controller::Controller::~Controller | ( | ) |
Destructor (disables motion and stops current job);.
| void motoman::controller::Controller::delayTicks | ( | int | ticks | ) | [inline] |
Stops motion job on the controller. Disables motion.
| of ticks to delay |
Definition at line 169 of file output/controller.h.
| void motoman::controller::Controller::delayTicks | ( | int | ticks | ) | [inline] |
Stops motion job on the controller. Disables motion.
| of ticks to delay |
Definition at line 169 of file controller.h.
| void motoman::controller::Controller::disableMotion | ( | void | ) |
Disables motion on the robot controller. Turns off servo power, turns on hold status.
| void motoman::controller::Controller::disableMotion | ( | void | ) |
Disables motion on the robot controller. Turns off servo power, turns on hold status.
Definition at line 104 of file controller.cpp.
| void motoman::controller::Controller::enableMotion | ( | void | ) |
Enables motion on the robot controller. Turns on servo power, turns off hold status.
| void motoman::controller::Controller::enableMotion | ( | void | ) |
Enables motion on the robot controller. Turns on servo power, turns off hold status.
Definition at line 80 of file controller.cpp.
| int motoman::controller::Controller::getInteger | ( | int | index | ) |
Read integer data from the controller integer data table. Function blocks until data is read.
| index | in data table |
| int motoman::controller::Controller::getInteger | ( | int | index | ) |
Read integer data from the controller integer data table. Function blocks until data is read.
| index | in data table |
Definition at line 63 of file controller.cpp.
| double motoman::controller::Controller::getVelocityLimit | ( | ) | [inline] |
Returns the velocity limit set for the controller. This is stored within the integer data table at VELOCITY_LIMIT_INDEX.
Definition at line 200 of file output/controller.h.
| double motoman::controller::Controller::getVelocityLimit | ( | ) | [inline] |
Returns the velocity limit set for the controller. This is stored within the integer data table at VELOCITY_LIMIT_INDEX.
Definition at line 200 of file controller.h.
| bool motoman::controller::Controller::isJobStarted | ( | void | ) | [inline] |
return true if jos has been started (Based on internal class state not MotoPlus call)
Definition at line 135 of file output/controller.h.
| bool motoman::controller::Controller::isJobStarted | ( | void | ) | [inline] |
return true if jos has been started (Based on internal class state not MotoPlus call)
Definition at line 135 of file controller.h.
| bool motoman::controller::Controller::isMotionEnabled | ( | void | ) | [inline] |
return true if motion is enabled (Based on internal class state not MotoPlus call)
Definition at line 127 of file output/controller.h.
| bool motoman::controller::Controller::isMotionEnabled | ( | void | ) | [inline] |
return true if motion is enabled (Based on internal class state not MotoPlus call)
Definition at line 127 of file 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.
| path | of the file to load (pass "" if the root directory is used) | |
| name | of file to load (may not work with a full path) |
| 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.
| path | of the file to load (pass "" if the root directory is used) | |
| name | of file to load (may not work with a full path) |
Definition at line 210 of file controller.cpp.
| 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).
| bit | offset in data table (0-2047) | |
| in | incoming 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).
| bit | offset in data table (0-2047) | |
| in | incoming message |
Definition at line 231 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.
| index | in data table | |
| value | to 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.
| index | in data table | |
| value | to write |
Definition at line 47 of file controller.cpp.
| void motoman::controller::Controller::startMotionJob | ( | char * | job_name | ) |
Starts motion job on the controller. Enables motion (Job cannot be started if motion is not enabled).
| void motoman::controller::Controller::startMotionJob | ( | char * | job_name | ) |
Starts motion job on the controller. Enables motion (Job cannot be started if motion is not enabled).
Definition at line 117 of file controller.cpp.
| void motoman::controller::Controller::stopMotionJob | ( | char * | job_name | ) |
Stops motion job on the controller. Disables motion.
| void motoman::controller::Controller::stopMotionJob | ( | char * | job_name | ) |
Stops motion job on the controller. Disables motion.
Definition at line 140 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).
| bit | offset in data table (0-2047) | |
| in | incoming message |
| 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).
| bit | offset in data table (0-2047) | |
| in | incoming message |
Definition at line 249 of file controller.cpp.
| 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).
| full | path and name of file to create | |
| full | job string |
| 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).
| full | path and name of file to create | |
| full | job string |
Definition at line 159 of file controller.cpp.
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.
bool motoman::controller::Controller::jobStarted [protected] |
True if job started.
Definition at line 257 of file controller.h.
bool motoman::controller::Controller::motionEnabled [protected] |
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.
MP_STD_RSP_DATA motoman::controller::Controller::servo_power_error [protected] |
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.