Public Member Functions | Private Attributes | List of all members
industrial::joint_message::JointMessage Class Reference

Class encapsulated joint message generation methods (either to or from a SimpleMessage type. This message represents the joint position data. NOTE: In earlier versions this was simply referred to as JOINT message. This caused confusion as there are many types of joint messages (position, velocity, feedback). To remove confusion, this message was changed to JOINT_POSITION. Other types of messages will have to be created for velocity and other feedback. More...

#include <joint_message.h>

Inheritance diagram for industrial::joint_message::JointMessage:
Inheritance graph
[legend]

Public Member Functions

unsigned int byteLength ()
 Virtual method returns the object size when packed into a ByteArray. More...
 
industrial::joint_data::JointDatagetJoints ()
 returns reference to underlying joint class More...
 
industrial::shared_types::shared_int getSequence ()
 returns the maximum message sequence number More...
 
bool init (industrial::simple_message::SimpleMessage &msg)
 Initializes message from a simple message. More...
 
void init (industrial::shared_types::shared_int seq, industrial::joint_data::JointData &joints)
 Initializes message from a joint structure. More...
 
void init ()
 Initializes a new joint message. More...
 
 JointMessage (void)
 Default constructor. More...
 
bool load (industrial::byte_array::ByteArray *buffer)
 Virtual method for loading an object into a ByteArray. More...
 
void setSequence (industrial::shared_types::shared_int sequence)
 Sets message sequence number. More...
 
bool unload (industrial::byte_array::ByteArray *buffer)
 Virtual method for unloading an object from a ByteArray. More...
 
 ~JointMessage (void)
 Destructor. More...
 
- Public Member Functions inherited from industrial::typed_message::TypedMessage
int getCommType () const
 Gets the communication type of the message. More...
 
int getMessageType () const
 gets message type (enumeration) More...
 
virtual bool toReply (industrial::simple_message::SimpleMessage &msg, industrial::simple_message::ReplyType reply)
 creates a simple_message reply More...
 
virtual bool toRequest (industrial::simple_message::SimpleMessage &msg)
 creates a simple_message request More...
 
virtual bool toTopic (industrial::simple_message::SimpleMessage &msg)
 creates a simple_message topic More...
 

Private Attributes

industrial::joint_data::JointData joints_
 maximum number of joints positions that can be held in the message. More...
 
industrial::shared_types::shared_int sequence_
 sequence number (for those joints messages that require it) More...
 

Additional Inherited Members

- Protected Member Functions inherited from industrial::typed_message::TypedMessage
void setCommType (int comm_type=industrial::simple_message::CommTypes::INVALID)
 Sets the communication type of the message. More...
 
void setMessageType (int message_type=industrial::simple_message::StandardMsgTypes::INVALID)
 sets message type More...
 

Detailed Description

Class encapsulated joint message generation methods (either to or from a SimpleMessage type. This message represents the joint position data. NOTE: In earlier versions this was simply referred to as JOINT message. This caused confusion as there are many types of joint messages (position, velocity, feedback). To remove confusion, this message was changed to JOINT_POSITION. Other types of messages will have to be created for velocity and other feedback.

The byte representation of a joint message is as follow (in order lowest index to highest). The standard sizes are given, but can change based on type sizes:

member: type size sequence (industrial::shared_types::shared_int) 4 bytes joints (industrial::joint_data) 40 bytes

THIS CLASS IS NOT THREAD-SAFE

Definition at line 85 of file joint_message.h.

Constructor & Destructor Documentation

◆ JointMessage()

industrial::joint_message::JointMessage::JointMessage ( void  )

Default constructor.

This method creates an empty message.

Definition at line 54 of file joint_message.cpp.

◆ ~JointMessage()

industrial::joint_message::JointMessage::~JointMessage ( void  )

Destructor.

Definition at line 60 of file joint_message.cpp.

Member Function Documentation

◆ byteLength()

unsigned int industrial::joint_message::JointMessage::byteLength ( )
inlinevirtual

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

Returns
object size (in bytes)

Implements industrial::simple_serialize::SimpleSerialize.

Definition at line 155 of file joint_message.h.

◆ getJoints()

industrial::joint_data::JointData& industrial::joint_message::JointMessage::getJoints ( )
inline

returns reference to underlying joint class

Returns
reference to joint class

Definition at line 146 of file joint_message.h.

◆ getSequence()

industrial::shared_types::shared_int industrial::joint_message::JointMessage::getSequence ( )
inline

returns the maximum message sequence number

Returns
message sequence number

Definition at line 136 of file joint_message.h.

◆ init() [1/3]

bool industrial::joint_message::JointMessage::init ( industrial::simple_message::SimpleMessage msg)
virtual

Initializes message from a simple message.

Parameters
simplemessage to construct from
Returns
true if message successfully initialized, otherwise false

Implements industrial::typed_message::TypedMessage.

Definition at line 65 of file joint_message.cpp.

◆ init() [2/3]

void industrial::joint_message::JointMessage::init ( industrial::shared_types::shared_int  seq,
industrial::joint_data::JointData joints 
)

Initializes message from a joint structure.

Parameters
sequencenumber
joints

Definition at line 96 of file joint_message.cpp.

◆ init() [3/3]

void industrial::joint_message::JointMessage::init ( )
virtual

Initializes a new joint message.

Implements industrial::typed_message::TypedMessage.

Definition at line 102 of file joint_message.cpp.

◆ load()

bool industrial::joint_message::JointMessage::load ( industrial::byte_array::ByteArray buffer)
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

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

Implements industrial::simple_serialize::SimpleSerialize.

Definition at line 108 of file joint_message.cpp.

◆ setSequence()

void industrial::joint_message::JointMessage::setSequence ( industrial::shared_types::shared_int  sequence)

Sets message sequence number.

Parameters
messagesequence number

Definition at line 91 of file joint_message.cpp.

◆ unload()

bool industrial::joint_message::JointMessage::unload ( industrial::byte_array::ByteArray buffer)
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)

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

Implements industrial::simple_serialize::SimpleSerialize.

Definition at line 133 of file joint_message.cpp.

Member Data Documentation

◆ joints_

industrial::joint_data::JointData industrial::joint_message::JointMessage::joints_
private

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

Definition at line 168 of file joint_message.h.

◆ sequence_

industrial::shared_types::shared_int industrial::joint_message::JointMessage::sequence_
private

sequence number (for those joints messages that require it)

Definition at line 164 of file joint_message.h.


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


simple_message
Author(s): Shaun Edwards
autogenerated on Mon Feb 28 2022 22:34:36