46 namespace joint_feedback
49 JointFeedback::JointFeedback(
void)
53 JointFeedback::~JointFeedback(
void)
58 void JointFeedback::init()
61 this->valid_fields_ = 0;
63 this->positions_.init();
64 this->velocities_.init();
65 this->accelerations_.init();
75 this->setRobotID(robot_id);
77 this->setPositions(positions);
78 this->setVelocities(velocities);
79 this->setAccelerations(accelerations);
80 this->valid_fields_ = valid_fields;
95 return this->robot_id_ == rhs.
robot_id_ &&
105 LOG_COMM(
"Executing joint feedback load");
107 if (!buffer->
load(this->robot_id_))
109 LOG_ERROR(
"Failed to load joint feedback robot_id");
113 if (!buffer->
load(this->valid_fields_))
115 LOG_ERROR(
"Failed to load joint feedback valid fields");
119 if (!buffer->
load(this->time_))
121 LOG_ERROR(
"Failed to load joint feedback time");
125 if (!this->positions_.load(buffer))
127 LOG_ERROR(
"Failed to load joint feedback positions");
131 if (!this->velocities_.load(buffer))
133 LOG_ERROR(
"Failed to load joint feedback velocities");
137 if (!this->accelerations_.load(buffer))
139 LOG_ERROR(
"Failed to load joint feedback accelerations");
143 LOG_COMM(
"Joint feedback successfully loaded");
149 LOG_COMM(
"Executing joint feedback unload");
151 if (!this->accelerations_.unload(buffer))
153 LOG_ERROR(
"Failed to unload joint feedback accelerations");
157 if (!this->velocities_.unload(buffer))
159 LOG_ERROR(
"Failed to unload joint feedback velocities");
163 if (!this->positions_.unload(buffer))
165 LOG_ERROR(
"Failed to unload joint feedback positions");
169 if (!buffer->
unload(this->time_))
171 LOG_ERROR(
"Failed to unload joint feedback time");
175 if (!buffer->
unload(this->valid_fields_))
177 LOG_ERROR(
"Failed to unload joint feedback valid fields");
181 if (!buffer->
unload(this->robot_id_))
183 LOG_ERROR(
"Faild to unload joint feedback robot_id");
187 LOG_COMM(
"Joint feedback successfully unloaded");
bool getTime(industrial::shared_types::shared_real &time)
Returns joint feedback timestamp.
bool getPositions(industrial::joint_data::JointData &dest)
Returns a copy of the position data.
void init(const M_string &remappings)
Contains platform specific type definitions that guarantee the size of primitive data types...
industrial::shared_types::shared_int robot_id_
robot group # (0-based) for controllers that support multiple axis-groups
industrial::joint_data::JointData positions_
joint feedback positional data
industrial::joint_data::JointData accelerations_
joint feedback acceleration data
#define LOG_COMM(format,...)
industrial::joint_data::JointData velocities_
joint feedback velocity data
bool load(industrial::shared_types::shared_bool value)
loads a boolean into the byte array
#define LOG_ERROR(format,...)
bool getAccelerations(industrial::joint_data::JointData &dest)
Returns a copy of the acceleration data.
The byte array wraps a dynamic array of bytes (i.e. char).
Class encapsulated joint data (positions, accelerations, velocity, torque, and/or effort)...
industrial::shared_types::shared_int valid_fields_
bit-mask of (optional) fields that have been initialized with valid data
bool getVelocities(industrial::joint_data::JointData &dest)
Returns a copy of the velocity data.
Class encapsulated joint feedback data. This data represents the current state of each robot joint...
bool unload(industrial::shared_types::shared_bool &value)
unloads a boolean value from the byte array
industrial::shared_types::shared_int getRobotID()
Gets robot_id. Robot group # (0-based), for controllers with multiple axis-groups.
industrial::shared_types::shared_real time_
joint data timestamp Typically, time since controller booted (in seconds)