Roboid Control for C++
Loading...
Searching...
No Matches
PoseMsg.h
1#include "Messages.h"
2
3namespace Passer {
4namespace RoboidControl {
5
9class PoseMsg : public IMessage {
10 public:
12 static const unsigned char id = 0x10;
14 unsigned char length = 4 + 4 + 4;
15
17 unsigned char networkId;
19 unsigned char thingId;
20
22 unsigned char poseType;
24 static const unsigned char Pose_Position = 0x01;
26 static const unsigned char Pose_Orientation = 0x02;
28 static const unsigned char Pose_LinearVelocity = 0x04;
30 static const unsigned char Pose_AngularVelocity = 0x08;
31
33 Spherical16 position;
35 SwingTwist16 orientation;
37 Spherical16 linearVelocity;
39 Spherical16 angularVelocity;
40
49 PoseMsg(unsigned char networkId,
50 unsigned char thingId,
51 unsigned char poseType,
52 Spherical16 position,
53 SwingTwist16 orientation,
54 Spherical16 linearVelocity = Spherical16(),
55 Spherical16 angularVelocity = Spherical16());
57 PoseMsg(const char* buffer);
59 virtual ~PoseMsg();
60
62 virtual unsigned char Serialize(char* buffer) override;
63};
64
65} // namespace RoboidControl
66} // namespace Passer
Root structure for all communcation messages.
Definition Messages.h:12
Message to communicate the pose of the thing The pose is in local space relative to the parent....
Definition PoseMsg.h:9
Spherical16 linearVelocity
The linear velocity of the thing in local space in meters per second.
Definition PoseMsg.h:37
virtual ~PoseMsg()
Destructor for the message.
Definition PoseMsg.cpp:26
unsigned char networkId
The network ID of the thing.
Definition PoseMsg.h:17
SwingTwist16 orientation
The orientation of the thing in local space.
Definition PoseMsg.h:35
unsigned char thingId
The ID of the thing.
Definition PoseMsg.h:19
static const unsigned char Pose_Position
Bit pattern for a pose with position.
Definition PoseMsg.h:24
Spherical16 position
The position of the thing in local space in meters.
Definition PoseMsg.h:33
static const unsigned char Pose_LinearVelocity
Bit pattern for a pose with linear velocity.
Definition PoseMsg.h:28
unsigned char length
The length of the message.
Definition PoseMsg.h:14
Spherical16 angularVelocity
The angular velocity of the thing in local space.
Definition PoseMsg.h:39
virtual unsigned char Serialize(char *buffer) override
Serialize the message into a byte array for sending.
Definition PoseMsg.cpp:28
static const unsigned char Pose_Orientation
Bit pattern for a pose with orientation.
Definition PoseMsg.h:26
unsigned char poseType
Bit pattern stating which pose components are available.
Definition PoseMsg.h:22
static const unsigned char Pose_AngularVelocity
Bit pattern for a pose with angular velocity.
Definition PoseMsg.h:30