Class encapsulated joint data (positions, accelerations, velocity, torque, and/or effort). More...
#include <joint_data.h>
Public Member Functions | |
unsigned int | byteLength () |
Virtual method returns the object size when packed into a ByteArray. More... | |
void | copyFrom (JointData &src) |
Copies the passed in value. More... | |
industrial::shared_types::shared_real | getJoint (industrial::shared_types::shared_int index) const |
Gets a joint value within the buffer (Only use this form if you are sure the index is within bounds). More... | |
bool | getJoint (industrial::shared_types::shared_int index, industrial::shared_types::shared_real &value) const |
Gets a joint value within the buffer. More... | |
int | getMaxNumJoints () const |
returns the maximum number of joints the message holds More... | |
void | init () |
Initializes a empty joint data. More... | |
JointData (void) | |
Default constructor. More... | |
bool | load (industrial::byte_array::ByteArray *buffer) |
Virtual method for loading an object into a ByteArray. More... | |
bool | operator== (JointData &rhs) |
== operator implementation More... | |
bool | setJoint (industrial::shared_types::shared_int index, industrial::shared_types::shared_real value) |
Sets a joint value within the buffer. More... | |
bool | unload (industrial::byte_array::ByteArray *buffer) |
Virtual method for unloading an object from a ByteArray. More... | |
~JointData (void) | |
Destructor. More... | |
Private Attributes | |
industrial::shared_types::shared_real | joints_ [MAX_NUM_JOINTS] |
internal data buffer More... | |
Static Private Attributes | |
static const industrial::shared_types::shared_int | MAX_NUM_JOINTS = 10 |
maximum number of joints positions that can be held in the message. More... | |
Class encapsulated joint data (positions, accelerations, velocity, torque, and/or effort).
For simplicity and cross platform compliance, this is implemented as a fixed size array.
The byte representation of a joint data is as follows. The standard sizes are given, but can change based on type sizes:
member: type size joints (industrial::shared_types::shared_real) 4 * MAX_NUM_JOINTS
THIS CLASS IS NOT THREAD-SAFE
Definition at line 68 of file joint_data.h.
industrial::joint_data::JointData::JointData | ( | void | ) |
industrial::joint_data::JointData::~JointData | ( | void | ) |
Destructor.
Definition at line 52 of file joint_data.cpp.
|
inlinevirtual |
Virtual method returns the object size when packed into a ByteArray.
Implements industrial::simple_serialize::SimpleSerialize.
Definition at line 147 of file joint_data.h.
void industrial::joint_data::JointData::copyFrom | ( | JointData & | src | ) |
Copies the passed in value.
src | (value to copy) |
Definition at line 107 of file joint_data.cpp.
shared_real industrial::joint_data::JointData::getJoint | ( | industrial::shared_types::shared_int | index | ) | const |
Gets a joint value within the buffer (Only use this form if you are sure the index is within bounds).
joint | index |
Definition at line 99 of file joint_data.cpp.
bool industrial::joint_data::JointData::getJoint | ( | industrial::shared_types::shared_int | index, |
industrial::shared_types::shared_real & | value | ||
) | const |
Gets a joint value within the buffer.
joint | index |
joint | value (passed by reference) |
Definition at line 82 of file joint_data.cpp.
|
inline |
returns the maximum number of joints the message holds
Definition at line 132 of file joint_data.h.
void industrial::joint_data::JointData::init | ( | ) |
Initializes a empty joint data.
Definition at line 57 of file joint_data.cpp.
|
virtual |
Virtual method for loading an object into a ByteArray.
This method should load all the required data to reconstruct the class object into the buffer
buffer | pointer to ByteArray |
Implements industrial::simple_serialize::SimpleSerialize.
Definition at line 138 of file joint_data.cpp.
bool industrial::joint_data::JointData::operator== | ( | JointData & | rhs | ) |
bool industrial::joint_data::JointData::setJoint | ( | industrial::shared_types::shared_int | index, |
industrial::shared_types::shared_real | value | ||
) |
Sets a joint value within the buffer.
joint | index |
joint | value |
Definition at line 65 of file joint_data.cpp.
|
virtual |
Virtual method for unloading an object from a ByteArray.
This method should unload all the required data to reconstruct the class object (in place)
buffer | pointer to ByteArray |
Implements industrial::simple_serialize::SimpleSerialize.
Definition at line 157 of file joint_data.cpp.
|
private |
internal data buffer
Definition at line 161 of file joint_data.h.
|
staticprivate |
maximum number of joints positions that can be held in the message.
Definition at line 157 of file joint_data.h.