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

The state of one body of a participant: where it is, how it moves, and how big it is. More...

#include <state_message.h>

Public Member Functions

real_t yaw () const noexcept
 The rotation about z of the orientation.
BodyState extrapolated (real_t dt) const
 Where the body would be dt seconds later, moving as it moves now.

Static Public Member Functions

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.

Public Attributes

std::string name
std::array< real_t, 3 > position {0.0, 0.0, 0.0}
std::array< real_t, 4 > orientation {1.0, 0.0, 0.0, 0.0}
std::array< real_t, 3 > linear_velocity {0.0, 0.0, 0.0}
std::array< real_t, 3 > angular_velocity {0.0, 0.0, 0.0}
std::array< real_t, 3 > size {0.0, 0.0, 0.0}

Detailed Description

The state of one body of a participant: where it is, how it moves, and how big it is.

The others use it to draw the body, to sense it, and to avoid it: a participant that receives it from another process can place a ghost of the body in its own world, see CHRONO_Ghosts. The orientation is a unit quaternion {w, x, y, z}; size is the extent of the body's box along its own axes, {0, 0, 0} if unknown.

Member Function Documentation

◆ extrapolated()

BodyState bitsim::distributed::BodyState::extrapolated ( real_t dt) const

Where the body would be dt seconds later, moving as it moves now.

◆ planar()

BodyState bitsim::distributed::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} )
static

A body that moves in the plane: at (x, y), turned yaw about z, moving with (vx, vy) and turning at wz.

◆ yaw()

real_t bitsim::distributed::BodyState::yaw ( ) const
noexcept

The rotation about z of the orientation.

Member Data Documentation

◆ angular_velocity

std::array<real_t, 3> bitsim::distributed::BodyState::angular_velocity {0.0, 0.0, 0.0}

◆ linear_velocity

std::array<real_t, 3> bitsim::distributed::BodyState::linear_velocity {0.0, 0.0, 0.0}

◆ name

std::string bitsim::distributed::BodyState::name

◆ orientation

std::array<real_t, 4> bitsim::distributed::BodyState::orientation {1.0, 0.0, 0.0, 0.0}

◆ position

std::array<real_t, 3> bitsim::distributed::BodyState::position {0.0, 0.0, 0.0}

◆ size

std::array<real_t, 3> bitsim::distributed::BodyState::size {0.0, 0.0, 0.0}

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