44 #include "industrial_msgs/RobotMode.h" 45 #include "industrial_msgs/TriState.h" 52 namespace robot_status
97 return industrial_msgs::TriState::TRUE;
100 return industrial_msgs::TriState::FALSE;
112 RobotStatus::RobotStatus(
void)
116 RobotStatus::~RobotStatus(
void)
121 void RobotStatus::init()
130 this->setDrivesPowered(drivesPowered);
131 this->setEStopped(eStopped);
132 this->setErrorCode(errorCode);
133 this->setInError(inError);
134 this->setInMotion(inMotion);
136 this->setMotionPossible(motionPossible);
161 LOG_COMM(
"Executing robot status load");
163 if (buffer->
load(this->drives_powered_) && buffer->
load(this->e_stopped_) && buffer->
load(this->error_code_)
164 && buffer->
load(this->in_error_) && buffer->
load(this->in_motion_) && buffer->
load(this->mode_)
165 && buffer->
load(this->motion_possible_))
168 LOG_COMM(
"Robot status successfully loaded");
173 LOG_COMM(
"Robot status not loaded");
184 LOG_COMM(
"Executing robot status unload");
185 if (buffer->
unload(this->motion_possible_) && buffer->
unload(this->mode_) && buffer->
unload(this->in_motion_)
186 && buffer->
unload(this->in_error_) && buffer->
unload(this->error_code_) && buffer->
unload(this->e_stopped_)
187 && buffer->
unload(this->drives_powered_))
191 LOG_COMM(
"Robot status successfully unloaded");
196 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)