scenario_simulator_v2 C++ API
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
traffic_simulator::traffic::TrafficSource Class Reference

#include <traffic_source.hpp>

Inheritance diagram for traffic_simulator::traffic::TrafficSource:
Inheritance graph
[legend]
Collaboration diagram for traffic_simulator::traffic::TrafficSource:
Collaboration graph
[legend]

Classes

struct  Configuration
 
struct  Validator
 

Public Types

using VehicleParameter = traffic_simulator_msgs::msg::VehicleParameters
 
using PedestrianParameter = traffic_simulator_msgs::msg::PedestrianParameters
 
using VehicleOrPedestrianParameter = std::variant< VehicleParameter, PedestrianParameter >
 
using Distribution = std::vector< std::tuple< VehicleOrPedestrianParameter, std::string, std::string, double > >
 
template<typename Pose , typename Parameters >
using Spawner = std::function< void(const std::string &, const Pose &, const Parameters &, const std::string &, const std::string &)>
 

Public Member Functions

template<typename Spawner >
 TrafficSource (const double radius, const double rate, const geometry_msgs::msg::Pose &pose, const Distribution &distribution, const std::optional< int > seed, const double current_time, const Configuration &configuration, const std::shared_ptr< hdmap_utils::HdMapUtils > &hdmap_utils, const Spawner &spawn)
 
void execute (const double current_time, const double step_time) override
 
- Public Member Functions inherited from traffic_simulator::traffic::TrafficModuleBase
 TrafficModuleBase ()
 
virtual auto appendDebugMarker (visualization_msgs::msg::MarkerArray &) const -> void
 

Public Attributes

const double rate
 
const geometry_msgs::msg::Pose pose
 
const std::size_t id
 

Member Typedef Documentation

◆ Distribution

using traffic_simulator::traffic::TrafficSource::Distribution = std::vector<std::tuple<VehicleOrPedestrianParameter, std::string, std::string, double> >

◆ PedestrianParameter

using traffic_simulator::traffic::TrafficSource::PedestrianParameter = traffic_simulator_msgs::msg::PedestrianParameters

◆ Spawner

template<typename Pose , typename Parameters >
using traffic_simulator::traffic::TrafficSource::Spawner = std::function<void( const std::string &, const Pose &, const Parameters &, const std::string &, const std::string &)>

◆ VehicleOrPedestrianParameter

◆ VehicleParameter

using traffic_simulator::traffic::TrafficSource::VehicleParameter = traffic_simulator_msgs::msg::VehicleParameters

Constructor & Destructor Documentation

◆ TrafficSource()

template<typename Spawner >
traffic_simulator::traffic::TrafficSource::TrafficSource ( const double  radius,
const double  rate,
const geometry_msgs::msg::Pose &  pose,
const Distribution distribution,
const std::optional< int >  seed,
const double  current_time,
const Configuration configuration,
const std::shared_ptr< hdmap_utils::HdMapUtils > &  hdmap_utils,
const Spawner spawn 
)
inlineexplicit

Member Function Documentation

◆ execute()

void traffic_simulator::traffic::TrafficSource::execute ( const double  current_time,
const double  step_time 
)
overridevirtual
Note
If lanelet pose is valid spawn using lanelet pose
If lanelet pose is not valid spawn using normal map pose

Implements traffic_simulator::traffic::TrafficModuleBase.

Member Data Documentation

◆ id

const std::size_t traffic_simulator::traffic::TrafficSource::id

◆ pose

const geometry_msgs::msg::Pose traffic_simulator::traffic::TrafficSource::pose

◆ rate

const double traffic_simulator::traffic::TrafficSource::rate

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