|
bitsim
Model, simulate, estimate and control robots in C++
|
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. | |
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.
|
inlineexplicit |
| bitsim::distributed::CHRONO_Ghosts::~CHRONO_Ghosts | ( | ) |
| 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.
|
inlinenoexcept |
The number of ghosts in the system.
| void bitsim::distributed::CHRONO_Ghosts::update | ( | const std::vector< PeerState > & | peers | ) |
Place the ghosts where the peers say their bodies are.