Roboid Control for C++
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Passer::RoboidControl::PoseMsg Class Reference

Detailed Description

Message to communicate the pose of the thing The pose is in local space relative to the parent. If there is not parent (the thing is a root thing), the pose will be in world space.

#include <PoseMsg.h>

Inheritance diagram for Passer::RoboidControl::PoseMsg:
Passer::RoboidControl::IMessage

Public Member Functions

 PoseMsg (unsigned char networkId, unsigned char thingId, unsigned char poseType, Spherical16 position, SwingTwist16 orientation, Spherical16 linearVelocity=Spherical16(), Spherical16 angularVelocity=Spherical16())
 Create a new message for sending.
 
 PoseMsg (const char *buffer)
 Create a message for receiving.
 
virtual ~PoseMsg ()
 Destructor for the message.
 
virtual unsigned char Serialize (char *buffer) override
 Serialize the message into a byte array for sending.
 

Public Attributes

unsigned char length = 4 + 4 + 4
 The length of the message.
 
unsigned char networkId
 The network ID of the thing.
 
unsigned char thingId
 The ID of the thing.
 
unsigned char poseType
 Bit pattern stating which pose components are available.
 
Spherical16 position
 The position of the thing in local space in meters.
 
SwingTwist16 orientation
 The orientation of the thing in local space.
 
Spherical16 linearVelocity
 The linear velocity of the thing in local space in meters per second.
 
Spherical16 angularVelocity
 The angular velocity of the thing in local space.
 

Static Public Attributes

static const unsigned char id = 0x10
 The message ID.
 
static const unsigned char Pose_Position = 0x01
 Bit pattern for a pose with position.
 
static const unsigned char Pose_Orientation = 0x02
 Bit pattern for a pose with orientation.
 
static const unsigned char Pose_LinearVelocity = 0x04
 Bit pattern for a pose with linear velocity.
 
static const unsigned char Pose_AngularVelocity = 0x08
 Bit pattern for a pose with angular velocity.
 

Constructor & Destructor Documentation

◆ PoseMsg() [1/2]

PoseMsg::PoseMsg ( unsigned char  networkId,
unsigned char  thingId,
unsigned char  poseType,
Spherical16  position,
SwingTwist16  orientation,
Spherical16  linearVelocity = Spherical16(),
Spherical16  angularVelocity = Spherical16() 
)

Create a new message for sending.

Parameters
networkIdThe network ID of the thing
thingIdThe ID of the thing
poseTypeBit pattern stating which pose components are available
positionThe position of the thing in local space in meters
orientationThe orientation of the thing in local space
linearVelocityThe linear velocity of the thing in local space in meters per second
angularVelocityThe angular velocity of the thing in local space

◆ PoseMsg() [2/2]

PoseMsg::PoseMsg ( const char *  buffer)

Create a message for receiving.

Parameters
bufferThe byte array to parse

Member Function Documentation

◆ Serialize()

unsigned char PoseMsg::Serialize ( char *  buffer)
overridevirtual

Serialize the message into a byte array for sending.

Parameters
bufferThe buffer to serilize into
Returns
The length of the message in the buffer

Reimplemented from Passer::RoboidControl::IMessage.