49 namespace simple_message
99 LOG_COMM(
"Executing MotionCtrl command load");
101 if (!buffer->
load(this->robot_id_))
103 LOG_ERROR(
"Failed to load MotionCtrl robot_id");
107 if (!buffer->
load(this->sequence_))
109 LOG_ERROR(
"Failed to load MotionCtrl sequence");
113 if (!buffer->
load(this->command_))
115 LOG_ERROR(
"Failed to load MotionCtrl command");
122 if (!buffer->
load(value))
124 LOG_ERROR(
"Failed to load MotionCtrl data element %d from data[%d]", static_cast<int>(i),
130 LOG_COMM(
"MotionCtrl data successfully loaded");
136 LOG_COMM(
"Executing MotionCtrl command unload");
141 if (!buffer->
unload(value))
143 LOG_ERROR(
"Failed to unload message data element: %d from data[%d]", static_cast<int>(i),
150 if (!buffer->
unload(this->command_))
152 LOG_ERROR(
"Failed to unload MotionCtrl command");
156 if (!buffer->
unload(this->sequence_))
158 LOG_ERROR(
"Failed to unload MotionCtrl sequence");
162 if (!buffer->
unload(this->robot_id_))
164 LOG_ERROR(
"Failed to unload MotionCtrl robot_id");
168 LOG_COMM(
"MotionCtrl data successfully unloaded");
industrial::shared_types::shared_int command_
Motion-control command.
void setCommand(MotionControlCmd command)
Sets motion control command.
void setSequence(industrial::shared_types::shared_int sequence)
Sets control command's sequence number.
industrial::shared_types::shared_int getRobotID()
Returns target robot/group # for this command.
#define LOG_COMM(format,...)
bool load(industrial::shared_types::shared_bool value)
#define LOG_ERROR(format,...)
industrial::shared_types::shared_real data_[MAX_DATA_CNT]
Motion-control command data Contents of data-buffer are specific to each command. ...
industrial::shared_types::shared_real getData(size_t idx)
Returns command data.
MotionCtrl(void)
Default constructor.
bool unload(industrial::byte_array::ByteArray *buffer)
void setData(size_t idx, industrial::shared_types::shared_real val)
Sets command data.
MotionControlCmd getCommand()
Returns motion control command.
~MotionCtrl(void)
Destructor.
float data[ROS_MAX_JOINT]
bool operator==(MotionCtrl &rhs)
== operator implementation
industrial::shared_types::shared_int sequence_
Message-tracking number that will be echoed back in reply message.
void setRobotID(industrial::shared_types::shared_int robot_id)
Sets robot_id.
industrial::shared_types::shared_int robot_id_
Robot/group ID. 0 = 1st robot.
unsigned int getBufferSize()
void clearData()
Clears command data.
void init()
Initializes a empty motion control command.
bool unload(industrial::shared_types::shared_bool &value)
static const size_t MAX_DATA_CNT
Maximum length (# of float elements) of data buffer.
void copyFrom(MotionCtrl &src)
Copies the passed in value.
bool load(industrial::byte_array::ByteArray *buffer)
industrial::shared_types::shared_int getSequence()
Returns control command's sequence number.
Class encapsulated motion control data. These control messages are required to download command-traje...