42 #if defined(SIMPLE_MESSAGE_USE_ROS) || defined(ROS)
45 #include "industrial_msgs/RobotMode.h"
46 #include "industrial_msgs/TriState.h"
53 namespace robot_status
60 #if defined(SIMPLE_MESSAGE_USE_ROS) || defined(ROS)
89 #if defined(SIMPLE_MESSAGE_USE_ROS) || defined(ROS)
100 return industrial_msgs::TriState::TRUE;
103 return industrial_msgs::TriState::FALSE;
115 RobotStatus::RobotStatus(
void)
119 RobotStatus::~RobotStatus(
void)
124 void RobotStatus::init()
133 this->setDrivesPowered(drivesPowered);
134 this->setEStopped(eStopped);
135 this->setErrorCode(errorCode);
136 this->setInError(inError);
137 this->setInMotion(inMotion);
139 this->setMotionPossible(motionPossible);
164 LOG_COMM(
"Executing robot status load");
166 if (buffer->
load(this->drives_powered_) && buffer->
load(this->e_stopped_) && buffer->
load(this->error_code_)
167 && buffer->
load(this->in_error_) && buffer->
load(this->in_motion_) && buffer->
load(this->mode_)
168 && buffer->
load(this->motion_possible_))
171 LOG_COMM(
"Robot status successfully loaded");
176 LOG_COMM(
"Robot status not loaded");
187 LOG_COMM(
"Executing robot status unload");
188 if (buffer->
unload(this->motion_possible_) && buffer->
unload(this->mode_) && buffer->
unload(this->in_motion_)
189 && buffer->
unload(this->in_error_) && buffer->
unload(this->error_code_) && buffer->
unload(this->e_stopped_)
190 && buffer->
unload(this->drives_powered_))
194 LOG_COMM(
"Robot status successfully unloaded");
199 LOG_ERROR(
"Failed to unload robot status");