TraveSim Adapters  0.1
Protobuf adapters for TraveSim project
robot_state.hpp
Go to the documentation of this file.
1 /**
2  * @file robot_state.hpp
3  *
4  * @brief Robot state data structure
5  *
6  * @author Lucas Haug <lucas.haug@thunderatz.org>
7  *
8  * @date 04/2021
9  */
10 
11 #ifndef __ROBOT_STATE_H__
12 #define __ROBOT_STATE_H__
13 
14 #include <iostream>
15 
17 
18 namespace travesim {
19 /**
20  * @brief Data structure to hold the state of a robot in the simulation
21  *
22  */
23 class RobotState :
24  public EntityState {
25  public:
26  /**
27  * @brief Construct a new Robot State object
28  *
29  */
30  RobotState();
31 
32  /**
33  * @brief Construct a new Robot State object
34  *
35  * @param position Position in meters
36  * @param angular_position Angular position in radinans
37  * @param velocity Velocity in m/s
38  * @param angular_velocity Angular velocity in rad/s
39  * @param is_yellow Wheter the robot is from the yellow team or not
40  * @param id Identification number
41  */
43  bool is_yellow, int id);
44 
45  /**
46  * @brief Construct a new Robot State object from EntityState object
47  *
48  * @param entity_state Object to be promoted
49  * @param is_yellow Wheter the robot is from the yellow team or not
50  * @param id Identification number
51  */
52  RobotState(EntityState* entity_state, bool is_yellow, int id);
53 
54  /**
55  * @brief Output stream operator overloading
56  *
57  */
58  friend std::ostream& operator <<(std::ostream& output, const RobotState& robot_state);
59 
60  /**
61  * @brief Public attributes
62  *
63  */
64  bool is_yellow;
65  int id;
66 };
67 }
68 
69 #endif // __ROBOT_STATE_H__
RobotState()
Construct a new Robot State object.
Definition: robot_state.cpp:20
Entity state data structure.
double angular_velocity
Angular velocity in rad/s.
Vector2D velocity
Velocity in m/s.
Data structure to hold a two dimensional vector.
Data structure to hold the state of a robot in the simulation.
Definition: robot_state.hpp:23
double angular_position
Angular position in radinans.
Vector2D position
Position in meters.
bool is_yellow
Public attributes.
Definition: robot_state.hpp:64
Data structure to hold the state of a entity in the simulation.
friend std::ostream & operator<<(std::ostream &output, const RobotState &robot_state)
Output stream operator overloading.
Definition: robot_state.cpp:39