Roboid Control for C++
Loading...
Searching...
No Matches
PoseMsg.h
1#pragma once
2#include "IMessage.h"
3#include "Thing.h"
4
5namespace RoboidControl {
6
10class PoseMsg : public IMessage {
11 public:
13 static const unsigned char id = 0x10;
15 unsigned char length = 4 + 4 + 4;
16
18 unsigned char networkId;
20 unsigned char thingId;
21
23 unsigned char poseType;
25 static const unsigned char Pose_Position = 0x01;
27 static const unsigned char Pose_Orientation = 0x02;
29 static const unsigned char Pose_LinearVelocity = 0x04;
31 static const unsigned char Pose_AngularVelocity = 0x08;
32
34 Spherical position;
36 SwingTwist orientation;
39 Spherical linearVelocity;
41 Spherical angularVelocity;
42
47 PoseMsg(unsigned char networkId, Thing* thing, bool force = false);
48
50 PoseMsg(const char* buffer);
52 virtual ~PoseMsg();
53
55 virtual unsigned char Serialize(char* buffer) override;
56};
57
58} // namespace RoboidControl
Root structure for all communcation messages.
Definition IMessage.h:6
Message to communicate the pose of the thing The pose is in local space relative to the parent....
Definition PoseMsg.h:10
static const unsigned char Pose_Position
Bit pattern for a pose with position.
Definition PoseMsg.h:25
Spherical angularVelocity
The angular velocity of the thing in local space.
Definition PoseMsg.h:41
SwingTwist orientation
The orientation of the thing in local space.
Definition PoseMsg.h:36
static const unsigned char Pose_AngularVelocity
Bit pattern for a pose with angular velocity.
Definition PoseMsg.h:31
unsigned char networkId
The network ID of the thing.
Definition PoseMsg.h:18
virtual ~PoseMsg()
Destructor for the message.
Definition PoseMsg.cpp:42
static const unsigned char Pose_Orientation
Bit pattern for a pose with orientation.
Definition PoseMsg.h:27
Spherical linearVelocity
The linear velocity of the thing in local space in meters per second.
Definition PoseMsg.h:39
virtual unsigned char Serialize(char *buffer) override
Serialize the message into a byte array for sending.
Definition PoseMsg.cpp:44
unsigned char thingId
The ID of the thing.
Definition PoseMsg.h:20
unsigned char length
The length of the message in bytes.
Definition PoseMsg.h:15
Spherical position
The position of the thing in local space in meters.
Definition PoseMsg.h:34
static const unsigned char Pose_LinearVelocity
Bit pattern for a pose with linear velocity.
Definition PoseMsg.h:29
unsigned char poseType
Bit pattern stating which pose components are available.
Definition PoseMsg.h:23
A thing is the primitive building block.
Definition Thing.h:20