53 namespace simple_message
55 namespace motion_reply
95 return "Invalid message";
97 return "Controller alarm";
101 return "MotoPlus Error";
114 return "Invalid message size";
116 return "Invalid header";
118 return "Invalid message type";
120 return "Invalid robot ID";
122 return "Invalid sequence ID";
124 return "Invalid command";
126 return "Invalid data";
128 return "Trajectory start position doesn't match current robot position";
130 return "Invalid position data";
132 return "Invalid velocity data";
134 return "Invalid acceleration data";
136 return "Insufficient trajectory data. Must supply valid time, pos, and velocity fields.";
141 return "Controller alarm active";
143 return "Controller error";
145 return "E-Stop active";
147 return "Controller in TEACH mode";
149 return "Controller not in REMOTE mode";
151 return "Unable to enable drive power";
153 return "Controller in HOLD state";
155 return "MotoRos not started";
157 return "Waiting on ROS";
159 return "Waiting on SkillSend";
193 LOG_COMM(
"Executing MotionReply command load");
195 if (!buffer->
load(this->robot_id_))
197 LOG_ERROR(
"Failed to load MotionReply robot_id");
201 if (!buffer->
load(this->sequence_))
203 LOG_ERROR(
"Failed to load MotionReply sequence");
207 if (!buffer->
load(this->command_))
209 LOG_ERROR(
"Failed to load MotionReply command");
213 if (!buffer->
load(this->result_))
215 LOG_ERROR(
"Failed to load MotionReply result");
219 if (!buffer->
load(this->subcode_))
221 LOG_ERROR(
"Failed to load MotionReply subcode");
228 if (!buffer->
load(value))
230 LOG_ERROR(
"Failed to load MotionReply data element %d from data[%d]", static_cast<int>(i),
236 LOG_COMM(
"MotionReply data successfully loaded");
242 LOG_COMM(
"Executing MotionReply command unload");
247 if (!buffer->
unload(value))
249 LOG_ERROR(
"Failed to unload message data element: %d from data[%d]", static_cast<int>(i),
256 if (!buffer->
unload(this->subcode_))
258 LOG_ERROR(
"Failed to unload MotionReply subcode");
262 if (!buffer->
unload(this->result_))
264 LOG_ERROR(
"Failed to unload MotionReply result");
268 if (!buffer->
unload(this->command_))
270 LOG_ERROR(
"Failed to unload MotionReply command");
274 if (!buffer->
unload(this->sequence_))
276 LOG_ERROR(
"Failed to unload MotionReply sequence");
280 if (!buffer->
unload(this->robot_id_))
282 LOG_ERROR(
"Failed to unload MotionReply robot_id");
286 LOG_COMM(
"MotionReply data successfully unloaded");
industrial::shared_types::shared_int command_
Motion-control command (from corresponding MotionCtrl command)
bool unload(industrial::byte_array::ByteArray *buffer)
industrial::shared_types::shared_int robot_id_
Robot/group ID. 0 = 1st robot.
industrial::shared_types::shared_real getData(size_t idx) const
Returns reply data.
void clearData()
Clears reply data.
industrial::shared_types::shared_int getSubcode() const
Returns motion-control result sub-code.
void init()
Initializes a empty motion control reply.
void setResult(industrial::shared_types::shared_int result)
Sets motion-control result code.
#define LOG_COMM(format,...)
void setRobotID(industrial::shared_types::shared_int robot_id)
Sets robot_id.
bool load(industrial::shared_types::shared_bool value)
#define LOG_ERROR(format,...)
std::string getResultString() const
void copyFrom(MotionReply &src)
Copies the passed in value.
bool operator==(MotionReply &rhs)
== operator implementation
std::string getSubcodeString() const
MotionReply(void)
Default constructor.
float data[ROS_MAX_JOINT]
void setSequence(industrial::shared_types::shared_int sequence)
Sets motion-control reply's sequence number.
industrial::shared_types::shared_int getResult() const
Returns motion-control result code.
industrial::shared_types::shared_int sequence_
Message-tracking number (from corresponding MotionCtrl command)
void setData(size_t idx, industrial::shared_types::shared_real val)
Sets reply data.
industrial::shared_types::shared_int getSequence() const
Returns motion-control reply's sequence number.
void setCommand(industrial::shared_types::shared_int command)
Sets motion-control command (for reference)
Enumeration of motion control command codes.
Class encapsulated motion control reply data. These messages are sent by the FS100 controller in resp...
industrial::shared_types::shared_int result_
Command result.
unsigned int getBufferSize()
bool unload(industrial::shared_types::shared_bool &value)
void setSubcode(industrial::shared_types::shared_int subcode)
Sets motion-control result sub-code.
static const size_t MAX_DATA_CNT
Maximum length (# of float elements) of data buffer.
industrial::shared_types::shared_int subcode_
Command result sub-code (more detailed status)
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_int getRobotID() const
Returns target robot/group # for this reply.
bool load(industrial::byte_array::ByteArray *buffer)
industrial::shared_types::shared_int getCommand() const
Returns motion-control command.
~MotionReply(void)
Destructor.