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

The bodies of the other participants of a distributed simulation, in this participant's Chrono system. More...

#include <chrono_ghosts.h>

Public Member Functions

 CHRONO_Ghosts (chrono::ChSystem &system)
 ~CHRONO_Ghosts ()
void update (const std::vector< PeerState > &peers)
 Place the ghosts where the peers say their bodies are.
uint_t size () const noexcept
 The number of ghosts in the system.
std::shared_ptr< chrono::ChBody > get (const std::string &participant, const std::string &body) const
 The ghost of a body of a peer, or nullptr.

Detailed Description

The bodies of the other participants of a distributed simulation, in this participant's Chrono system.

A ghost is a fixed box of the body's size, placed where the body is. Fixed, so that Chrono's dynamics do not move it, but it collides: the sensors of this participant's robots see it, and its robots bump into it. update() creates the ghosts of new bodies, moves the others, and removes the ghosts of participants that left. A body without a size is not shown.

The ghosts do not push back, since this participant does not simulate them: it sees where the others are, not the forces between them. That suits robots that sense and avoid each other; robots that push each other belong in one participant.

Constructor & Destructor Documentation

◆ CHRONO_Ghosts()

bitsim::distributed::CHRONO_Ghosts::CHRONO_Ghosts ( chrono::ChSystem & system)
inlineexplicit

◆ ~CHRONO_Ghosts()

bitsim::distributed::CHRONO_Ghosts::~CHRONO_Ghosts ( )

Member Function Documentation

◆ get()

std::shared_ptr< chrono::ChBody > bitsim::distributed::CHRONO_Ghosts::get ( const std::string & participant,
const std::string & body ) const

The ghost of a body of a peer, or nullptr.

◆ size()

uint_t bitsim::distributed::CHRONO_Ghosts::size ( ) const
inlinenoexcept

The number of ghosts in the system.

◆ update()

void bitsim::distributed::CHRONO_Ghosts::update ( const std::vector< PeerState > & peers)

Place the ghosts where the peers say their bodies are.


The documentation for this class was generated from the following files: