1#ifndef BITSIM_DISTRIBUTED_STATE_MESSAGE_H
2#define BITSIM_DISTRIBUTED_STATE_MESSAGE_H
30 std::array<real_t, 3>
size{0.0, 0.0, 0.0};
38 const std::array<real_t, 3> &
size = {0.0, 0.0, 0.0});
82 std::string
encode()
const;
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
Definition chrono_ghosts.cpp:12
real_t wall_time_now()
The wall-clock time now, in seconds since the epoch of std::chrono::system_clock.
Definition state_message.cpp:118
Definition dc_motor_backend_base.h:9
std::size_t uint_t
uint_t
Definition bitsim_types.h:40
double real_t
real_t
Definition bitsim_types.h:20
The state of one body of a participant: where it is, how it moves, and how big it is.
Definition state_message.h:24
real_t yaw() const noexcept
The rotation about z of the orientation.
Definition state_message.cpp:27
BodyState extrapolated(real_t dt) const
Where the body would be dt seconds later, moving as it moves now.
Definition state_message.cpp:33
std::array< real_t, 3 > position
Definition state_message.h:26
std::string name
Definition state_message.h:25
std::array< real_t, 3 > linear_velocity
Definition state_message.h:28
static BodyState planar(const std::string &name, real_t x, real_t y, real_t yaw, real_t vx=0.0, real_t vy=0.0, real_t wz=0.0, const std::array< real_t, 3 > &size={0.0, 0.0, 0.0})
A body that moves in the plane: at (x, y), turned yaw about z, moving with (vx, vy) and turning at wz...
Definition state_message.cpp:14
std::array< real_t, 3 > size
Definition state_message.h:30
std::array< real_t, 3 > angular_velocity
Definition state_message.h:29
std::array< real_t, 4 > orientation
Definition state_message.h:27
What a participant of a distributed simulation sends: the state of its bodies at one step,...
Definition state_message.h:64
static StateMessage decode(const std::string &bytes)
Read a message that encode() wrote.
Definition state_message.cpp:84
real_t time
Definition state_message.h:74
Kind kind
Definition state_message.h:71
uint_t step
Definition state_message.h:73
std::vector< real_t > values
Definition state_message.h:77
std::string participant
Definition state_message.h:72
std::string encode() const
The message in MessagePack, for a transport.
Definition state_message.cpp:58
real_t stamp
Definition state_message.h:75
Kind
Definition state_message.h:66
@ STATE
the state of the bodies at step
Definition state_message.h:67
std::vector< BodyState > bodies
Definition state_message.h:76