Public Member Functions | Private Attributes | Static Private Attributes
industrial::joint_data::JointData Class Reference

Class encapsulated joint data (positions, accelerations, velocity, torque, and/or effort). More...

#include <joint_data.h>

Inheritance diagram for industrial::joint_data::JointData:
Inheritance graph
[legend]

List of all members.

Public Member Functions

unsigned int byteLength ()
 Virtual method returns the object size when packed into a ByteArray.
void copyFrom (JointData &src)
 Copies the passed in value.
bool getJoint (industrial::shared_types::shared_int index, industrial::shared_types::shared_real &value) const
 Gets a joint value within the buffer.
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).
int getMaxNumJoints () const
 returns the maximum number of joints the message holds
void init ()
 Initializes a empty joint data.
 JointData (void)
 Default constructor.
bool load (industrial::byte_array::ByteArray *buffer)
 Virtual method for loading an object into a ByteArray.
bool operator== (JointData &rhs)
 == operator implementation
bool setJoint (industrial::shared_types::shared_int index, industrial::shared_types::shared_real value)
 Sets a joint value within the buffer.
bool unload (industrial::byte_array::ByteArray *buffer)
 Virtual method for unloading an object from a ByteArray.
 ~JointData (void)
 Destructor.

Private Attributes

industrial::shared_types::shared_real joints_ [MAX_NUM_JOINTS]
 internal data buffer

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.

Detailed Description

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.


Constructor & Destructor Documentation

Default constructor.

This method creates empty data.

Definition at line 48 of file joint_data.cpp.

Destructor.

Definition at line 52 of file joint_data.cpp.


Member Function Documentation

unsigned int industrial::joint_data::JointData::byteLength ( ) [inline, virtual]

Virtual method returns the object size when packed into a ByteArray.

Returns:
object size (in bytes)

Implements industrial::simple_serialize::SimpleSerialize.

Definition at line 147 of file joint_data.h.

Copies the passed in value.

Parameters:
src(value to copy)

Definition at line 107 of file joint_data.cpp.

Gets a joint value within the buffer.

Parameters:
jointindex
jointvalue (passed by reference)
Returns:
true if value valid, otherwise false (index greater than max)

Definition at line 82 of file joint_data.cpp.

Gets a joint value within the buffer (Only use this form if you are sure the index is within bounds).

Parameters:
jointindex
Returns:
joint value (returns 0.0 if index is out of bounds)

Definition at line 99 of file joint_data.cpp.

returns the maximum number of joints the message holds

Returns:
max number of joints

Definition at line 132 of file joint_data.h.

Initializes a empty joint data.

Definition at line 57 of file joint_data.cpp.

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

Parameters:
bufferpointer to ByteArray
Returns:
true on success, false otherwise (buffer not large enough)

Implements industrial::simple_serialize::SimpleSerialize.

Definition at line 138 of file joint_data.cpp.

bool industrial::joint_data::JointData::operator== ( JointData rhs)

== operator implementation

Returns:
true if equal

Definition at line 118 of file joint_data.cpp.

Sets a joint value within the buffer.

Parameters:
jointindex
jointvalue
Returns:
true if value set, otherwise false (index greater than max)

Definition at line 65 of file joint_data.cpp.

Virtual method for unloading an object from a ByteArray.

This method should unload all the required data to reconstruct the class object (in place)

Parameters:
bufferpointer to ByteArray
Returns:
true on success, false otherwise (buffer not large enough)

Implements industrial::simple_serialize::SimpleSerialize.

Definition at line 157 of file joint_data.cpp.


Member Data Documentation

internal data buffer

Definition at line 161 of file joint_data.h.

maximum number of joints positions that can be held in the message.

Definition at line 157 of file joint_data.h.


The documentation for this class was generated from the following files:


simple_message
Author(s): Shaun Edwards
autogenerated on Tue Jan 17 2017 21:10:02