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");
TriState getMotionPossible()
industrial::shared_types::shared_int in_motion_
in motion state (see TriStates::TriState)
industrial::shared_types::shared_int motion_possible_
motion possible state (see TriStates::TriState)
industrial::shared_types::shared_int in_error_
in error state (see TriStates::TriState)
void init(const M_string &remappings)
Contains platform specific type definitions that guarantee the size of primitive data types...
industrial::shared_types::shared_int mode_
Operating mode (see RobotModes::RobotMode)
#define LOG_COMM(format,...)
Class encapsulated robot status data. The robot status data is meant to mirror the industrial_msgs/Ro...
bool load(industrial::shared_types::shared_bool value)
loads a boolean into the byte array
#define LOG_ERROR(format,...)
The byte array wraps a dynamic array of bytes (i.e. char).
industrial::shared_types::shared_int e_stopped_
E-stop state (see TriStates::TriState)
TriState getDrivesPowered()
industrial::shared_types::shared_int getErrorCode() const
bool unload(industrial::shared_types::shared_bool &value)
unloads a boolean value from the byte array
industrial::shared_types::shared_int error_code_
error code (non-zero is error)
industrial::shared_types::shared_int drives_powered_
Drive power state (see TriStates::TriState)