TraveSim Adapters  0.1
Protobuf adapters for TraveSim project
travesim::EntityState Class Reference

Data structure to hold the state of a entity in the simulation. More...

#include "entity_state.hpp"

Inheritance diagram for travesim::EntityState:
Collaboration diagram for travesim::EntityState:

Public Member Functions

 EntityState ()
 Construct a new Entity State object. More...
 
 EntityState (Vector2D position, double angular_position, Vector2D velocity, double angular_velocity)
 Construct a new Entity State object. More...
 
virtual ~EntityState ()=default
 

Public Attributes

Vector2D position
 Position in meters. More...
 
Vector2D velocity
 Velocity in m/s. More...
 
double angular_position
 Angular position in radinans. More...
 
double angular_velocity
 Angular velocity in rad/s. More...
 

Friends

std::ostream & operator<< (std::ostream &output, const EntityState &entity_state)
 Output stream operator overloading. More...
 

Detailed Description

Data structure to hold the state of a entity in the simulation.

Definition at line 56 of file entity_state.hpp.

Constructor & Destructor Documentation

◆ EntityState() [1/2]

travesim::EntityState::EntityState ( )

Construct a new Entity State object.

Definition at line 46 of file entity_state.cpp.

46  : EntityState(Vector2D(), 0.0, Vector2D(), 0.0) {
47 }
EntityState()
Construct a new Entity State object.

◆ EntityState() [2/2]

travesim::EntityState::EntityState ( Vector2D  position,
double  angular_position,
Vector2D  velocity,
double  angular_velocity 
)

Construct a new Entity State object.

Parameters
positionPosition in meters
angular_positionAngular position in radinans
velocityVelocity in m/s
angular_velocityAngular velocity in rad/s

Definition at line 49 of file entity_state.cpp.

49  {
50  this->position = position;
52  this->velocity = velocity;
54 }
double angular_velocity
Angular velocity in rad/s.
Vector2D velocity
Velocity in m/s.
double angular_position
Angular position in radinans.
Vector2D position
Position in meters.

References angular_position, angular_velocity, position, and velocity.

◆ ~EntityState()

virtual travesim::EntityState::~EntityState ( )
virtualdefault

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  output,
const EntityState entity_state 
)
friend

Output stream operator overloading.

Definition at line 56 of file entity_state.cpp.

56  {
57  output << std::fixed << std::setprecision(PRINTING_DECIMAL_PRECISION);
58 
59  output << "POSITION: ";
60  output << entity_state.position << " | ";
61  output << "THETA: "<< std::setw(PRINTING_MIN_WIDTH) << entity_state.angular_position << std::endl;
62 
63  output << "VELOCITY: ";
64  output << entity_state.velocity << " | ";
65  output << "THETA: "<< std::setw(PRINTING_MIN_WIDTH) << entity_state.angular_velocity << std::endl;
66 
67  return output;
68 }
#define PRINTING_DECIMAL_PRECISION
Definition: data_common.hpp:22
#define PRINTING_MIN_WIDTH
Printing output configuration constants.
Definition: data_common.hpp:21

Member Data Documentation

◆ angular_position

double travesim::EntityState::angular_position

Angular position in radinans.

Definition at line 98 of file entity_state.hpp.

◆ angular_velocity

double travesim::EntityState::angular_velocity

Angular velocity in rad/s.

Definition at line 104 of file entity_state.hpp.

◆ position

Vector2D travesim::EntityState::position

Position in meters.

Definition at line 86 of file entity_state.hpp.

◆ velocity

Vector2D travesim::EntityState::velocity

Velocity in m/s.

Definition at line 92 of file entity_state.hpp.


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