bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitsim::distributed Namespace Reference

Classes

class  CHRONO_Ghosts
 The bodies of the other participants of a distributed simulation, in this participant's Chrono system. More...
class  MQTT_Transport
 Participants in several processes, on one machine or several, that meet on an MQTT broker. More...
struct  BodyState
 The state of one body of a participant: where it is, how it moves, and how big it is. More...
struct  StateMessage
 What a participant of a distributed simulation sends: the state of its bodies at one step, or that it leaves. More...
struct  SynchroniserConfig
 The settings of Synchroniser. More...
struct  PeerState
 What a participant knows of another at a step. More...
class  Synchroniser
 Keeps the participants of a distributed simulation in step. More...
class  InProcessBus
 Participants that are threads of one process, joined by queues. More...
class  Transport
 How the participants of a distributed simulation reach each other: everything one publishes, every other receives. More...
class  LossyTransport
 A transport that delays and loses some of the messages of another, as a network would. More...

Enumerations

enum class  SyncMode { LOCKSTEP , WALL_CLOCK }
 How the participants of a distributed simulation keep time. More...

Functions

BodyState chrono_body_state (const std::string &name, const chrono::ChBody &body, const std::array< real_t, 3 > &size)
 The state of a Chrono body, to send to the other participants.
real_t wall_time_now ()
 The wall-clock time now, in seconds since the epoch of std::chrono::system_clock.

Enumeration Type Documentation

◆ SyncMode

enum class bitsim::distributed::SyncMode
strong

How the participants of a distributed simulation keep time.

Enumerator
LOCKSTEP 

Every participant waits at each step until it has the state of every other at that step. The simulation is as fast as its slowest participant, and repeatable: every run gives the same result, however the messages are delayed.

WALL_CLOCK 

Every participant keeps pace with the wall clock and uses the newest state it has of each other, moved forward by the time since it was sent. Nobody waits, so participants that cannot wait, real robots, can join; the result depends on the delays.

Function Documentation

◆ chrono_body_state()

BodyState bitsim::distributed::chrono_body_state ( const std::string & name,
const chrono::ChBody & body,
const std::array< real_t, 3 > & size )

The state of a Chrono body, to send to the other participants.

Parameters
sizethe extent of the body's box along its own axes

◆ wall_time_now()

real_t bitsim::distributed::wall_time_now ( )

The wall-clock time now, in seconds since the epoch of std::chrono::system_clock.