Autopysta
Loading...
Searching...
No Matches
road_object Class Referenceabstract

Abstract base class representing any object on the road. More...

#include <vehicle.h>

Inheritance diagram for road_object:
fixed_object vehicle

Public Member Functions

virtual ~road_object ()
 Virtual destructor for the road_object class.
 
virtual pointcurrent ()=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

modelm = nullptr
 Pointer to the model associated with the object (optional).
 
generalized_trajectorytraj = 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.
 

Detailed Description

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.

Member Function Documentation

◆ current()

virtual point * road_object::current ( )
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.

Returns
A pointer to the current point representing the object's state.

Implemented in fixed_object, and vehicle.

◆ update()

virtual void road_object::update ( road_object * leader)
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.

Parameters
leaderA pointer to the road object that may influence this object’s state.

Implemented in fixed_object, and vehicle.


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