33 #ifndef TRAJECTORY_SIMULATOR_H 34 #define TRAJECTORY_SIMULATOR_H 45 class TrajectorySimulator;
69 LATTICE_ARC_EQ_DT = -2,
70 LATTICE_ARC_EQ_DS = -1,
111 :
LatticePoint(_arc, _statePtr), latticeType(_latticeType)
153 const double&
dt()
const;
159 const double&
ds()
const;
171 const std::vector<LatticePointType>&
simLattice()
const;
174 void setUserDefLattice(
const std::vector<std::vector<double*> >& _userDefLattices);
197 double _minArcLatticeVal) = 0;
202 void simAppendToSimPartLat(
const double& _arcNow,
const int& _latticePtType,
const std::size_t& _minArcLatCacheIdx);
205 void appendToPartLat(
const double& _arcNow,
const int& _latticePtType,
const std::size_t& _minArcLatCacheIdx);
283 #endif // TRAJECTORY_SIMULATOR_H StateSimPtr stateSim_
State simulator object.
const double & dt() const
Const reference to arc parametrization interval used for the equal arc-length lattice.
std::shared_ptr< std::vector< LatticePoint > > LatticeVecSPtr
LatticeVecSPtrVec partLattices_
Vector containing the ordered sequence of arc parametrizations for each of the used lattices...
std::vector< LatticePointType > simulationLattice_
Lattice requesting each simulated trajectory state.
void populateTrajSimPartLattice(const size_t &_firstLaticeInvalidIdx)
Main function that performs resizing, reserving and calls the proper population function.
void setBeginEndArcsToLattices(const double &_arcBegin, const double &_arcEnd)
Sets begin and end arcs to all partial lattices on the first and last container positions.
std::vector< int > partLatIdxCache_
Vector containing cached container indices for each partial lattice related to the the highest arc lo...
void initExtLatticeCache(const double &_minArcLatticeVal)
Initializes the cached partial lattices index at the highest arc lower than.
double & dtBase()
Reference to arc parametrization interval used for the equal arc-length lattice.
bool isEmptyAllExtLattices() const
Returns true if all extended lattices are empty (the DS lattice as well as user-defined lattices)...
void setUserDefLattice(const std::vector< std::vector< double *> > &_userDefLattices)
virtual void populatePartSimLatticesGeneral(size_t _firstLaticeInvalidIdx, double _arcParamMax, double _minArcLatticeVal)=0
Performs simulation and populates simulation and partial lattices in the general case of various enab...
void setBoolDsScale(const bool &_doScale)
LatticePoint(double _arc, StateSPtr &_statePtr)
std::unique_ptr< CostsEvaluatorClass > costsEvaluator_
std::shared_ptr< TrajectorySimulator const > TrajectorySimulatorConstSPtr
void appendToPartLat(const double &_arcNow, const int &_latticePtType, const std::size_t &_minArcLatCacheIdx)
Appends the new arc and state pointer to the afferent partial lattice point.
Structure containing the lattice type afferent to a.
constexpr auto asInt(Enumeration const value) -> typename std::underlying_type< Enumeration >::type
void setBeginStateToLattices(const double &_arcBegin)
Binds reference to the initial simulated state (at.
std::unique_ptr< TrajectorySimulator > TrajectorySimulatorUPtr
std::vector< LatticePoint > LatticeVec
bool initSimLatticeState0(const double &_lastValidArc, size_t &_firstLaticeInvalidIdx)
Initializes the simulation lattice (truncation from the.
double dt_
Arc parametrization interval used for the equal arc-length lattice.
std::vector< std::vector< double * > > userDefPartLattices_
std::vector< LatticePointType > & simLattice()
Reference to the lattice that requested each simulated trajectory state.
virtual void populatePartSimLatticesDtOnly(const size_t &_firstLaticeInvalidIdx, double _arcParamMax)
Performs simulation and populates simulation and partial lattice when only equal dt lattice is enable...
LatticePointType(double _arc, int _latticeType)
BaseSimLatticeType
Fundamental lattice types.
LatticePointType(double _arc, int _latticeType, StateSPtr &_statePtr)
LatticePoint(double _arc)
static constexpr const std::size_t extArcLatIdxBegin
Structure containing an evaluation arc and a state pointer.
bool canComputeDistLattice_
Flags if the StateSim object has access to the StateSimDist functionality.
TrajectorySimulator(StateSimPtr _stateSim)
TrajectorySimulator & operator=(const TrajectorySimulator &)=default
void setBoolDtScale(const bool &_doScale)
void setEndStateToLattices(const double &_arcEnd)
Binds reference to the final simulated state (at.
SimMode
Mode of the simulation.
virtual void simulateTrajectory(double _lastValidArc=0)=0
Simulates (discrete numerical evaluation) an entire trajectory according to the specified intervals a...
std::shared_ptr< TrajectorySimulator > TrajectorySimulatorSPtr
std::unique_ptr< TrajectorySimulator const > TrajectorySimulatorConstUPtr
std::vector< std::shared_ptr< std::vector< LatticePoint > > > LatticeVecSPtrVec
const double & ds() const
Const reference to arc parametrization interval used for the equal distance lattice.
std::shared_ptr< StateSim > StateSimPtr
double ds_
Arc parametrization interval used for the equal distance lattice.
StateSimPtr stateSim()
Reference of the state simulator object.
void simAppendToSimPartLat(const double &_arcNow, const int &_latticePtType, const std::size_t &_minArcLatCacheIdx)
Performs a simulation step (if.
std::shared_ptr< StateType > StateSPtr
virtual ~TrajectorySimulator()=default
double & dsBase()
Reference to arc parametrization interval used for the equal distance lattice.
static size_t lattTypeIdx(int _enumIdx)
Converts shifted (int) lattice index to container (size_t) index.
void updateUserDefLattice()