|
Autopysta
|
Abstract base class representing any object on the road. More...
#include <vehicle.h>
Public Member Functions | |
| virtual | ~road_object () |
Virtual destructor for the road_object class. | |
| virtual point * | current ()=0 |
| Get the current point of the object. | |
| virtual void | update (road_object *leader)=0 |
| Update the object's state based on another road object. | |
Public Attributes | |
| model * | m = nullptr |
| Pointer to the model associated with the object (optional). | |
| generalized_trajectory * | traj = nullptr |
| Object's trajectory, which defines its movement and positions over time. | |
| std::queue< point * > | defined_t |
| A queue of defined trajectory points provided by the user. | |
Abstract base class representing any object on the road.
The road_object class serves as a general interface for objects on the road, whether they are moving vehicles or fixed objects. It handles the object's trajectory and allows updating based on interactions with other road objects.
|
pure virtual |
Get the current point of the object.
This pure virtual function must be implemented by derived classes to return the object's current position and state.
Implemented in fixed_object, and vehicle.
|
pure virtual |
Update the object's state based on another road object.
This pure virtual function must be implemented by derived classes. It updates the object’s state, such as position and speed, possibly considering the position of a leader or other objects on the road.
| leader | A pointer to the road object that may influence this object’s state. |
Implemented in fixed_object, and vehicle.