API#

This is the reference page for the DYNO C++ and Python API.

Library (C++)#

Drivers#

AccelerationBasedDriver#

class AccelerationBasedDriver : public DYNO::Drivers::AutonomousDriver#

Private Members

double target_steering_rate_ = 0.0#

The target steering rate to be maintained. This value is only used when the controller mode is set to “steering rate”.

double last_steering_angle_ = 0.0#

The steering angle in degrees at the last driver synchronization step. This value is used to compute the rate of change between steps.

AutonomousDriver#

class AutonomousDriver : public chrono::vehicle::ChDriver#

Subclassed by DYNO::Drivers::AccelerationBasedDriver, DYNO::Drivers::VelocityBasedDriver

Protected Attributes

chrono::vehicle::ChSpeedController speed_controller_#

PID controller for controlling the speed of the vehicle through throttle/brake actuation.

double speed_controller_output_ = 0.0#

The output effort from the latest PID speed controller tick.

double brake_transition_effort_ = 0.2#

The PID speed controller output effort below which efforts are piped to brake instead of throttle.

double steering_angle_max_#

The maximum steering angle in degrees. This value is used to remap control inputs to efforts in the compact [-1.0, 1.0].

double target_steering_angle_ = 0.0#

The target steering angle to be set at the next driver synchronization step.

VelocityBasedDriver#

class VelocityBasedDriver : public DYNO::Drivers::AutonomousDriver#

Interfaces#

JSONConfiguration#

class JSONConfiguration#

Public Functions

JSONConfiguration(const std::string &path)#

Construct a new JSON configuration object.

Private Members

std::shared_ptr<boost::program_options::options_description> description_#

Shared pointer to the Boost::Program_options descriptions.

std::shared_ptr<boost::program_options::variables_map> variables_#

Shared pointer to the Boost::Program_options variables.

std::string path_#

Fully-qualified path to the JSON configuration file.

nlohmann::json configuration_#

Parsed JSON configuration dictionary.

JSONTerrainOutput#

class JSONTerrainOutput#

ZMQInterface#

class ZMQInterface : public DYNO::Interfaces::ZMQSocket#

Public Functions

ZMQInterface(std::string protocol, std::string address, int port)#

Construct a new Project Chrono ROS interface.

Parameters:
  • protocol – Interface communication protocol

  • address – Interface server address.

  • port – Interface server port.

void DeserializeDriveByWire(nlohmann::json &data, double &throttle, double &brake, double &steering)#

Deserialize a ROS auton_msgs/msg/DriveByWire message in JSON format.

Parameters:
  • data – auton_msgs/msg/DriveByWire JSON message.

  • throttle – Normalised output throttle effort value in the range (0.0

    • 1.0)

  • brake – Normalised output brake effort value in the range (0.0

    • 1.0)

  • steering – Normalised output steering effort value in the range (-1.0 - 1.0)

void SerializeIdealIMU(nlohmann::json &message, std::shared_ptr<chrono::ChBody> body, std::string frame_id, std::vector<double> orientation_covariance_diagonal, std::vector<double> linear_acceleration_covariance_diagonal, std::vector<double> angular_velocity_covariance_diagonal)#

Serialize body accelerations to a ROS sensor_msgs/msg/Imu message in JSON format.

Parameters:
  • message – Reference to a JSON dictionary to populate.

  • body – Reference to the body from which accelerations are read.

  • frame_id

  • orientation_covariance_diagonal – Diagonal entries (as a 3-by-1 vector) of the covariance matrix for the orientation of the body.

  • linear_acceleration_covariance_diagonal – Diagonal entries (as a 3-by-1 vector) of the covariance matrix for linear acceleration of the body.

  • angular_velocity_covariance_diagonal – Diagonal entries (as a 3-by-1 vector) of the covariance matrix for the angular velocity of the body.

void SerializeClock(nlohmann::json &message)#

Serialize simulation clock to a ROS rosgraph_msgs/msg/Clock message in JSON format.

Parameters:

data – Reference to the JSON dictionary entry to populate.

void SerializeOdometry(nlohmann::json &message, std::shared_ptr<chrono::ChBody> body, std::string frame_id, std::string child_frame_id, std::vector<double> pose_covariance_diagonal, std::vector<double> twist_covariance_diagonal)#

Serialize body odometry to a ROS nav_msgs/msg/Odometry message in JSON format.

Parameters:
  • message – Reference to the JSON dictionary to populate.

  • body – Reference to the body from which the odometry is read.

  • frame_id – Frame ID to use when populating the ROS message header.

  • child_frame_id – Child frame ID to use when populating the ROS message header.

  • pose_covariance – Diagonal entries (as a 6-by-1 vector) of the covariance matrix for the pose of the body.

  • twist_covariance – Diagonal entries (as a 6-by-1 vector) of the covariance matrix for the twist of the body.

void SerializeTransform(nlohmann::json &message, chrono::ChFrame<double> frame, std::string frame_id, std::string child_frame_id)#

Serialize a the transform between two reference frames as a ROS geometry_msgs/msg/PoseStamped message.

Parameters:
  • message – Reference to the JSON dictionary to populate.

  • frame – Project Chrono frame expressing the transform.

  • frame_id – Frame ID to use when populating the ROS message header.

  • child_frame_id – Child frame ID to use when populating the ROS message header.

void StampMessage(nlohmann::json &message)#

Stamp a ROS std_msgs/msg/Header in JSON format with the provided simulation time.

Parameters:

data – Reference to the JSON dictionary to populate.

Private Members

std::shared_ptr<chrono::ChBodyAuxRef> chassis_body_#

Shared pointer to the body used as reference for the published transforms and odometry messages.

int32_t seconds_ = 0#

Simulation time in seconds as expressed in a ROS std_msgs/Time message.

uint32_t nanoseconds_ = 0#

Nanoseconds since the last simulation time in seconds as expressed in a ROS std_msgs/Time message.

Private Static Attributes

static int is_interrupted_#

Static variable to capture process signals.

ZMQSocket#

class ZMQSocket#

Subclassed by DYNO::Interfaces::ZMQInterface

Public Functions

ZMQSocket()#

Construct a new ZeroMQ socket with the default protocol, address and port.

ZMQSocket(std::string protocol, std::string address, int port)#

Construct a new ZeroMQ socket with the provided protocol, address and port.

Parameters:
  • protocol – ZeroMQ protocol.

  • address – ZeroMQ address.

  • port – ZeroMQ port.

void SetProtocol(std::string protocol)#

Set the ZeroMQ socket protocol.

Parameters:

protocol – ZeroMQ socket protocol.

std::string GetProtocol()#

Get the ZeroMQ socket protocol.

Returns:

std::string ZeroMQ socket protocol.

void SetAddress(std::string address)#

Set the ZeroMQ socket address.

Parameters:

address – ZeroMQ socket address.

std::string GetAddress()#

Get the ZeroMQ socket address.

Returns:

std::string ZeroMQ socket address.

void SetPort(int port)#

Set the ZeroMQ socket port.

Parameters:

port – ZeroMQ socket port.

int GetPort()#

Get the ZeroMQ socket port.

Returns:

int ZeroMQ socket port.

Protected Attributes

zmq::context_t context_#

ZeroMQ context.

zmq::socket_t socket_#

ZeroMQ socket.

std::string protocol_ = "tcp"#

ZeroMQ socket protocol.

std::string address_ = "localhost"#

ZeroMQ socket address.

int port_ = 5555#

ZeroMQ socket port (if applicable for the current protocol).

Math#

PoissonDiskSampler1D#

class PoissonDiskSampler1D : public DYNO::Math::PoissonDiskSampler#

Public Functions

virtual void Generate(unsigned int number_of_samples)#

Generate a new batch of samples of the specified size.

Parameters:

number_of_samples – The number of samples to be generated in this batch.

Private Functions

virtual void InitializeGrid()#

Initialize the grid over which the samples are drawn.

This function computes the required grid cell size for the algorithm and (re-)initializes the grid over which samples are drawn. There may only be at most one sample in each cell of the grid.

This is a virtual method, and derived classes should provide their own specilization of this method to account for different dimensionality or grid cell size computations.

PoissonDiskSampler2D#

class PoissonDiskSampler2D : public DYNO::Math::PoissonDiskSampler#

Public Functions

virtual void Generate(unsigned int number_of_samples)#

Generate a new batch of samples of the specified size.

Parameters:

number_of_samples – The number of samples to be generated in this batch.

Private Functions

virtual void InitializeGrid()#

Initialize the grid over which the samples are drawn.

This function computes the required grid cell size for the algorithm and (re-)initializes the grid over which samples are drawn. There may only be at most one sample in each cell of the grid.

This is a virtual method, and derived classes should provide their own specilization of this method to account for different dimensionality or grid cell size computations.

PoissonDiskSampler#

class PoissonDiskSampler#

A class to generate samples using the Poisson disk sampling algoirhtm.

This class provides functionality to generate a set of samples distributed according to the Poisson disk sampling algorithm. The algorithm ensures that no two points are closer than a specified minimum distance.

This is a virtual class, and its derived classes may provide an implementation of the Poisson disk sampling algorithm for different dimension or with different constraints.

Subclassed by DYNO::Math::PoissonDiskSampler1D, DYNO::Math::PoissonDiskSampler2D

Public Functions

PoissonDiskSampler(double minimum_distance)#

Construct a new Poisson disk sampler.

Parameters:

minimum_distance – The minimum distance between two neighbor samples.

void Generate()#

Generate a new batch of samples filling the entire disk.

void Generate(unsigned int lower_bound, unsigned int upper_bound)#

Generate a new batch of samples with size between the lower and upper bounds specified.

Parameters:
  • lower_bound – The lower bound for the samples batch size.

  • upper_bound – The upper bound for the samples batch size.

virtual void Generate(unsigned int number_of_samples) = 0#

Generate a new batch of samples of the specified size.

Parameters:

number_of_samples – The number of samples to be generated in this batch.

void Seed()#

Seed the random number generator (RNG) with an auto-generated seed.

void Seed(unsigned int seed)#

Seed the random number generator (RNG) with the specified seed.

Parameters:

seed – The seed to be fed to the random number generator.

void SetMinimumDistance(double distance)#

Set the minimum distance between two neighbor samples.

Remark

Note that this distance should not include the radius of the samples, which is accounted for automatically.

Parameters:

distance – The minimum distance between two neighbor samples.

void SetRadiusRange(double radius_min, double radius_max)#

Set the bounds for the radii of the generated samples.

Radii are generated by sampling a uniform distribution within the bounds defined through this method.

Parameters:
  • radius_min – The minimum radius for a generated sample.

  • radius_max – The maximum radius for a generated sample.

void SetIterations(unsigned int iterations)#

Set the number of iterations.

This method sets the number of iteraions performed when sampling in then neighborhood of a candidate point before a new sample is drawn.

Parameters:

iterations – The number of iterations to be performed.

Protected Functions

double GenerateRandomNumber()#

Generate a new random floating point double precision number in the bounds-inclusive range [0.0, 1.0] sampled for a uniform distribution.

Returns:

double The generated double precision number.

virtual void InitializeGrid() = 0#

Initialize the grid over which the samples are drawn.

This function computes the required grid cell size for the algorithm and (re-)initializes the grid over which samples are drawn. There may only be at most one sample in each cell of the grid.

This is a virtual method, and derived classes should provide their own specilization of this method to account for different dimensionality or grid cell size computations.

double GenerateSampleRadius()#

Generate a new radius for a sample.

This function samples a uniform distribution to generated a sample radius within the specified bounds.

Returns:

double The generated sample radius.

Protected Attributes

double minimum_distance_#

The minimum distance between two neighbor samples.

bool has_result_ = false#

Indicates whether the sampler has already computed a valid batch of samples that may be retrieved.

double radius_min_ = 0.0#

The minimum radius for a generated sample.

double radius_max_ = 0.0#

The maximum radius for a generated sample.

unsigned int iterations_ = 25#

The number of iterations performed when sampling in the neighborhood of a candidate point before a new sample is drawn.

Private Functions

void InitializePRNG()#

Initialize the pseudo-random number generator (PRNG) and the uniform distribution from which the samples are drawn.

Private Members

std::random_device random_device_#

A non-deterministic integer random number generator used to seed the PRNG.

std::mt19937 random_engine_#

A Mersenne-Twister pseudo-random number generator.

std::uniform_real_distribution<double> uniform_distribution_#

A uniform distribution used when sampling double precision numbers.

PoissonPoint1D#

class PoissonPoint1D#

PoissonPoint2D#

class PoissonPoint2D#

PoissonPointState#

enum class DYNO::Math::PoissonPointState#

Values:

enumerator EMPTY#
enumerator INACTIVE#
enumerator ACTIVE#

Models#

AerodynamicProperties#

class AerodynamicProperties#

CameraParameters#

struct CameraParameters#

ControllerTuning#

class ControllerTuning#

Subclassed by DYNO::Models::SpeedControllerTuning, DYNO::Models::SteeringControllerTuning

ImuParameters#

struct ImuParameters#

LidarParameters#

struct LidarParameters#

Subclassed by DYNO::Models::Ouster64

Olav#

class Olav : public DYNO::Models::WheeledVehicle#

Public Functions

std::shared_ptr<chrono::ChBodyAuxRef> GetChassisBody()#

Retrieves the chassis body.

This method returns a shared pointer to the ChBodyAuxRef object representing the chassis body.

Returns:

A shared pointer to the chrono::ChBodyAuxRef object representing the chassis body.

virtual const SpeedControllerTuning &GetSpeedControllerTuning() override#

Retrieves the speed controller parameters.

This method returns a constant reference to the SpeedControllerTuning object containing the parameters for the speed controller.

Returns:

A constant reference to the SpeedControllerTuning object.

virtual const SteeringControllerTuning &GetSteeringControllerTuning() override#

Retrieves the steering controller parameters.

This method returns a constant reference to the SteeringControllerTuning object containing the parameters for the steering controller.

Returns:

A constant reference to the SteeringControllerTuning object.

virtual const AerodynamicProperties &GetAerodynamicProperties() override#

Retrieves the aerodynamic properties.

This method returns a constant reference to the AerodynamicProperties object containing the properties related to aerodynamics.

Returns:

A constant reference to the AerodynamicProperties object.

Private Members

chrono::ChCoordsysd initial_pose_#

The initial pose of an object.

This member variable stores the initial position and orientation of an object using a chrono::ChCoordsysd object.

SpeedControllerTuning speed_controller_tuning_#

Parameters for the speed controller.

This member variable contains the tuning parameters for the speed controller, encapsulated in a SpeedControllerTuning object.

SteeringControllerTuning steering_controller_tuning_#

Parameters for the steering controller.

This member variable contains the tuning parameters for the steering controller, encapsulated in a SteeringControllerTuning object.

AerodynamicProperties aerodynamic_properties_#

Aerodynamic properties of the vehicle.

This member variable stores the aerodynamic properties of the vehicle, encapsulated in an AerodynamicProperties object.

SpeedControllerTuning#

class SpeedControllerTuning : public DYNO::Models::ControllerTuning#

SteeringControllerTuning#

class SteeringControllerTuning : public DYNO::Models::ControllerTuning#

TrackedVehicle#

class TrackedVehicle : public DYNO::Models::Vehicle#

Public Functions

virtual double GetPositionX()#

Retrieves the X-coordinate of the current position of the vehicle.

This pure virtual method is responsible for returning the X-coordinate of the current position of the vehicle. Derived classes must implement this method to provide specific logic for retrieving the X-coordinate.

Returns:

A double representing the X-coordinate of the current position of the vehicle.

virtual const chrono::ChVector3d &GetPosition()#

Retrieves the current vehicle position.

This pure virtual method is responsible for returning the current vehicle position as a ChVector3d object.

Derived classes must implement this method to provide specific logic for retrieving the position.

Returns:

A constant reference to the chrono::ChVector3d object representing the current vehicle position.

virtual double GetSteeringAngle()#

Retrieves the current steering angle.

This pure virtual method is responsible for returning the current steering angle. Derived classes must implement this method to provide specific logic for retrieving the steering angle.

Returns:

The current steering angle in radians.

virtual void AddActiveDomain(const std::shared_ptr<chrono::vehicle::SCMTerrain> terrain) override#

Adds an active domain to the simulation.

This pure virtual method is responsible for adding an active domain to the SCMTerrain object. Derived classes must implement this method to provide specific logic for adding the active domains (e.g. wheels, track shoes, skid plates, etc.).

Parameters:

terrain – A shared pointer to the chrono::vehicle::SCMTerrain object representing the terrain to which the active domain will be added.

virtual const VehicleType &GetVehicleType()#

Retrieves the type of the vehicle.

This pure virtual method is responsible for returning the type of the vehicle. Derived classes must implement this method to provide specific logic for retrieving the vehicle type.

Returns:

A constant reference to a VehicleType object representing the type of the vehicle.

virtual double GetSpeed()#

Retrieves the current speed.

This pure virtual method is responsible for returning the current speed. Derived classes must implement this method to provide specific logic for retrieving the speed.

Returns:

The current speed in meters per second (m/s).

Vehicle#

class Vehicle#

Subclassed by DYNO::Models::TrackedVehicle, DYNO::Models::WheeledVehicle

Public Functions

void OverrideInitialPose(const chrono::ChCoordsysd &initial_pose)#

Overrides the initial pose of the vehicle.

This method sets the initial pose of the vehicle. It also sets a flag indicating that the initial pose has been overridden.

Parameters:

initial_pose – A constant reference to the chrono::ChCoordsysd object representing the new initial pose.

virtual double GetSpeed() = 0#

Retrieves the current speed.

This pure virtual method is responsible for returning the current speed. Derived classes must implement this method to provide specific logic for retrieving the speed.

Returns:

The current speed in meters per second (m/s).

virtual const chrono::ChVector3d &GetPosition() = 0#

Retrieves the current vehicle position.

This pure virtual method is responsible for returning the current vehicle position as a ChVector3d object.

Derived classes must implement this method to provide specific logic for retrieving the position.

Returns:

A constant reference to the chrono::ChVector3d object representing the current vehicle position.

virtual double GetPositionX() = 0#

Retrieves the X-coordinate of the current position of the vehicle.

This pure virtual method is responsible for returning the X-coordinate of the current position of the vehicle. Derived classes must implement this method to provide specific logic for retrieving the X-coordinate.

Returns:

A double representing the X-coordinate of the current position of the vehicle.

virtual double GetSteeringAngle() = 0#

Retrieves the current steering angle.

This pure virtual method is responsible for returning the current steering angle. Derived classes must implement this method to provide specific logic for retrieving the steering angle.

Returns:

The current steering angle in radians.

virtual void AddActiveDomain(const std::shared_ptr<chrono::vehicle::SCMTerrain> terrain) = 0#

Adds an active domain to the simulation.

This pure virtual method is responsible for adding an active domain to the SCMTerrain object. Derived classes must implement this method to provide specific logic for adding the active domains (e.g. wheels, track shoes, skid plates, etc.).

Parameters:

terrain – A shared pointer to the chrono::vehicle::SCMTerrain object representing the terrain to which the active domain will be added.

virtual const VehicleType &GetVehicleType() = 0#

Retrieves the type of the vehicle.

This pure virtual method is responsible for returning the type of the vehicle. Derived classes must implement this method to provide specific logic for retrieving the vehicle type.

Returns:

A constant reference to a VehicleType object representing the type of the vehicle.

virtual const SpeedControllerTuning &GetSpeedControllerTuning()#

Retrieves the speed controller parameters.

This method returns a constant reference to the SpeedControllerTuning object containing the parameters for the speed controller.

It should be overridden by derived classes to provide the specific speed controller parameters for that vehicle.

Returns:

A constant reference to the SpeedControllerTuning object.

virtual const SteeringControllerTuning &GetSteeringControllerTuning()#

Retrieves the steering controller parameters.

This method returns a constant reference to the SteeringControllerTuning object containing the parameters for the steering controller.

It should be overridden by derived classes to provide the specific steering controller parameters for that vehicle.

Returns:

A constant reference to the SteeringControllerTuning object.

virtual const AerodynamicProperties &GetAerodynamicProperties()#

Retrieves the aerodynamic properties.

This method returns a constant reference to the AerodynamicProperties object containing the properties related to aerodynamics.

Returns:

A constant reference to the AerodynamicProperties object.

WheeledVehicle#

class WheeledVehicle : public DYNO::Models::Vehicle#

Subclassed by DYNO::Models::Olav

Public Functions

virtual double GetPositionX()#

Retrieves the X-coordinate of the current position of the vehicle.

This pure virtual method is responsible for returning the X-coordinate of the current position of the vehicle. Derived classes must implement this method to provide specific logic for retrieving the X-coordinate.

Returns:

A double representing the X-coordinate of the current position of the vehicle.

virtual const chrono::ChVector3d &GetPosition()#

Retrieves the current vehicle position.

This pure virtual method is responsible for returning the current vehicle position as a ChVector3d object.

Derived classes must implement this method to provide specific logic for retrieving the position.

Returns:

A constant reference to the chrono::ChVector3d object representing the current vehicle position.

virtual double GetSteeringAngle()#

Retrieves the current steering angle.

This pure virtual method is responsible for returning the current steering angle. Derived classes must implement this method to provide specific logic for retrieving the steering angle.

Returns:

The current steering angle in radians.

virtual double GetSpeed()#

Retrieves the current speed.

This pure virtual method is responsible for returning the current speed. Derived classes must implement this method to provide specific logic for retrieving the speed.

Returns:

The current speed in meters per second (m/s).

virtual void AddActiveDomain(const std::shared_ptr<chrono::vehicle::SCMTerrain> terrain) override#

Adds an active domain to the simulation.

This pure virtual method is responsible for adding an active domain to the SCMTerrain object. Derived classes must implement this method to provide specific logic for adding the active domains (e.g. wheels, track shoes, skid plates, etc.).

Parameters:

terrain – A shared pointer to the chrono::vehicle::SCMTerrain object representing the terrain to which the active domain will be added.

virtual const VehicleType &GetVehicleType()#

Retrieves the type of the vehicle.

This pure virtual method is responsible for returning the type of the vehicle. Derived classes must implement this method to provide specific logic for retrieving the vehicle type.

Returns:

A constant reference to a VehicleType object representing the type of the vehicle.

Sensors#

IMU#

class IMU#

Public Functions

std::shared_ptr<chrono::sensor::ChAccelerometerSensor> GetAccelerometerSensor()#

Get a shared pointer to the accelerometer sensor.

Returns:

std::shared_ptr<chrono::sensor::ChAccelerometerSensor> Shared pointer to the accelerometer sensor.

chrono::sensor::UserAccelBufferPtr GetAccelerometerBuffer()#

Get a shared pointer to the accelerometer sensor buffer.

Returns:

chrono::sensor::UserAccelBufferPtr Shared pointer to the accelerometer sensor buffer.

std::shared_ptr<chrono::sensor::ChGyroscopeSensor> GetGyroscopeSensor()#

Get a shared pointer to the gyroscope sensor.

Returns:

std::shared_ptr<chrono::sensor::ChGyroscopeSensor> Shared pointer to the gyroscope sensor.

chrono::sensor::UserGyroBufferPtr GetGyroscopeBuffer()#

Get a shared pointer to the gyroscope sensor buffer.

Returns:

chrono::sensor::UserGyroBufferPtr Shared pointer to the gyroscope sensor buffer.

Private Members

double update_rate_#

Sensor update rate in Hz.

double lag_#

Sensor reading collection lag.

double collection_time_#

Sensor sample collection time.

std::shared_ptr<chrono::sensor::ChAccelerometerSensor> acc_sensor_#

Shared pointer to the accelerometer sensor.

IMUNoiseModel acc_noise_model_type_#

Accelerometer noise model type.

std::shared_ptr<chrono::sensor::ChNoiseModel> acc_noise_model_#

Shared pointer to the accelerometer noise model.

std::shared_ptr<chrono::sensor::ChGyroscopeSensor> gyro_sensor_#

Shared pointer to the gyroscope sensor.

IMUNoiseModel gyro_noise_model_type_#

Gyroscope noise model type.

std::shared_ptr<chrono::sensor::ChNoiseModel> gyro_noise_model_#

Shared pointer to the gyroscope noise model.

LidarXYZI#

class LidarXYZI#

Simplified LiDAR sensor interface.

Public Functions

std::shared_ptr<chrono::sensor::ChLidarSensor> GetSensor()#

Get a shared pointer to the underlying LiDAR sensor object.

Returns:

std::shared_ptr<ChLidarSensor> LiDAR sensor.

Private Members

std::shared_ptr<chrono::sensor::ChLidarSensor> sensor_#

Shared pointer to the LiDAR sensor.

std::shared_ptr<chrono::ChBodyAuxRef> body_#

Shared pointer to the body the LiDAR sensor transform is defined relative from.

chrono::ChFrame<double> offset_#

Transform between the reference frame of the parent body and the sensor.

RGBACamera#

class RGBACamera#

Serialization#

HDF5Serializer#

class HDF5Serializer : public DYNO::Serialization::Serializer#

HDF5 file interface for vehicle simulation output.

Private Members

std::shared_ptr<H5Easy::File> file_#

HDF5 vehicle simulation output file handle.

JSONSerializer#

class JSONSerializer : public DYNO::Serialization::Serializer#

Serializer#

class Serializer#

Subclassed by DYNO::Serialization::HDF5Serializer, DYNO::Serialization::JSONSerializer

Simulation#

AutonomousNavigation#

class AutonomousNavigation : public DYNO::Simulation::AutonomousVehicleSimulation#

Public Functions

const std::vector<Obstacle> &GetObstacles() const#

Retrieves the list of obstacles.

This method returns a constant reference to the vector containing all obstacles.

Returns:

A constant reference to the vector of Obstacle objects.

Protected Functions

virtual void InitializeTerrain() override#

Initializes the terrain.

This method is responsible for setting up and initializing the terrain.

virtual void InitializeAssets() override#

Initializes the assets.

This method is responsible for setting up and initializing the assets.

Private Members

chrono::ChVector3d target_waypoint_#

The target waypoint passed to the autonomous navigation system upstream.

double field_length_#

The length of the obstacle field.

double field_width_#

The width of the obstacle field.

double obstacles_minimum_distance_#

The minimum distance between generated obstacles, measured relative to the outer perimeter of their footprints.

ObstacleGeneratorMode obstacle_generator_mode_ = ObstacleGeneratorMode::FIELD#

The obstacle generation modality. See the matching enumeration class for the available options.

bool enable_obstacles_#

Indicates whether obstacles will be generated.

std::vector<Obstacle> obstacles_#

The vector of generated obstacles.

double collision_threshold_#

The radial distance from the vehicle centre of gravity below which a collision with an obstacle is detected.

double obstacles_height_#

The height of the generated obstacles.

double obstacles_gates_width_#

The width of the obstacles generation line along each gate.

bool halt_on_collision_#

Indicates wheter the simulation will be halted when a collision with an obstacle is detected.

double obstacle_radius_min_#

The lower bound for the radius of the generated obstacles.

double obstacle_radius_max_#

The upper bound for the radius of the generated obstacles.

AutonomousVehicleSimulation#

class AutonomousVehicleSimulation : public DYNO::Simulation::VehicleSimulation#

Subclassed by DYNO::Simulation::AutonomousNavigation

Protected Attributes

double acceleration_length_#

The length of the acceleration lane instantiated for the vehicle to reach the target speed.

Private Functions

void InitializeObstacles()#

Initializes the obstacles in the simulation.

This function parses the obstacles from the configuration and instantiates them in the simulation.

void InitializeSensorManager()#

Initialize the Chrono::Sensor sensor manager.

This function performs the initial setup of the Chrono::Sensor sensor manager and initializes the NVIDIA OptiX engine. It also specifies the directory from which the sensor shaders will be loaded.

This function is run as part of the initialization phase.

void AddSensor(std::shared_ptr<chrono::sensor::ChSensor> sensor)#

Add a sensor to the sensor manager.

Parameters:

sensor – Shared pointer to the Chrono::Sensor sensor to be added to the sensor manager.

virtual void InitializeSensors() override#

Initialize the vehicle sensors.

This function initializes the location and configuration of the inertial measurement unit (IMU), the LiDAR (Light Detection and Ranging) and the camera sensors specified in the autonomous vehicle model.

This function may be overridden by derived classes to specify different sensor configurations or initialization procedures.

Private Members

std::shared_ptr<chrono::sensor::ChSensorManager> sensor_manager_#

Shared pointer to the Chrono::Sensor sensor manager handling sensor initialization and updating.

std::shared_ptr<DYNO::Drivers::AccelerationBasedDriver> autonomous_driver_#

Shared pointer to the specialized driver for interfacing with autonomous navigation system.

std::shared_ptr<DYNO::Drivers::VelocityBasedDriver> warmup_driver_#

Shared pointer to the specialized driver handling the controls during the initial part of the scenario.

double target_speed_#

The target speed to be reached by the warmup driver before handing over controls to the autonomous navigation system.

double target_acceleration_ = 0.0#

The target acceleration set by the autonomous navigation system.

double target_steering_rate_ = 0.0#

The target steering rate set by the autonomous navigation system.

bool is_accepting_controls_ = false#

Indicates whether the system is accepting controls from the autonomous navigation stack.

bool target_speed_reached_ = false#

Indicates whether the target speed has been reached at least once since the beginning of the simulation.

bool initial_pose_reached_ = false#

Indicates whether the initial pose in the navigation path has been reached at least once since the beginning of the simulation.

double waypoint_radius_#

The radius within with waypoints are considered reached.

DoubleLaneChange#

class DoubleLaneChange : public DYNO::Simulation::VehicleSimulation#

Obstacle#

class Obstacle#

Public Members

chrono::ChVector3d position_#

The x-coordinate of the obstacle’s position.

chrono::ChVector3d size_#

The y-coordinate of the obstacle’s position.

Path#

class Path#

SideslopeStability#

class SideslopeStability : public DYNO::Simulation::VehicleSimulation#

Public Functions

SideslopeStability(std::shared_ptr<DYNO::Interfaces::JSONConfiguration> configuration)#

Construct a new sideslope stability scenario.

Parameters:

configuration – Shared pointer to the scenario configuration object.

Protected Functions

virtual void InitializeDriver() override#

Initialize the driver for the sideslope stability scenario.

virtual void InitializeTerrain() override#

Initialize the terrain for the sideslope stability scenario.

virtual void PreSynchronizationHook() override#

Run the pre-synchronization hook for the sideslope stability scenario.

virtual void PostSynchronizationHook() override#

Run the post-synchronization hook for the sideslope stability scenario.

virtual void WriteMetadata() override#

Write the scenario metadata for the sideslope stability scenario.

Private Functions

std::shared_ptr<chrono::ChBezierCurve> GeneratePath()#

Generate the Bezier curve for the serpentine path mimicking obstacle avoidance.

Private Members

double current_grade_ = 0.0#

Current grade, in percentage.

double target_grade_#

Target grade, in percentage.

bool use_grade_ramp_ = true#

Whether or not to use a sinusoidal step function to ease-in the grade.

std::shared_ptr<chrono::ChFunctionSineStep> slope_ramp_#

Grade ease-in sinusoidal step function.

double time_to_max_grade_#

Period of the grade ease-in sinusoidal step function.

double target_speed_#

Target speed, in meters per second.

bool grade_reached_ = false#

Whether or not the target grade has been reached.

bool is_successful_ = true#

Whether or not the scenario has been completed successfully.

bool is_steering_ = false#

Whether or not the vehicle has initiated the obstacle avoidance maneuver.

double acceleration_length_#

Length of the acceleration section, in meters.

chrono::ChVector3d obstacle_position_#

Obstacle position (the Z component is ignored), in meters.

chrono::ChVector3d obstacle_size_#

Obstacle size (the Z component is ignored), in meters.

chrono::ChVector3d obstacle_offset_#

Sideslope stability path offset measured from the center of the obstacle, in meters.

std::shared_ptr<chrono::ChBezierCurve> path_#

sideslope stability Bezier curve path.

SinusoidalSteering#

class SinusoidalSteering : public DYNO::Simulation::VehicleSimulation#

SplitSurface#

class SplitSurface : public DYNO::Simulation::VehicleSimulation#

StraightLineAcceleration#

class StraightLineAcceleration : public DYNO::Simulation::VehicleSimulation#

Public Functions

StraightLineAcceleration(std::shared_ptr<DYNO::Interfaces::JSONConfiguration> configuration)#

Construct a new straight line acceleration scenario.

Parameters:

configuration – Shared pointer to the scenario configuration object.

Protected Functions

virtual void InitializeDriver() override#

Initialize the driver for the straight line acceleration scenario.

virtual void InitializeTerrain() override#

Initialize the terrain for the straight line acceleration scenario.

virtual void WriteMetadata() override#

Write the metadata for the straight line acceleration scenario to the output file.

virtual void PreSynchronizationHook() override#

Run the pre-synchronization hook for the straight line acceleration scenario.

virtual void PostSynchronizationHook() override#

Run the post-synchronization hook for the straight line acceleration scenario.

Private Members

double current_slope_ = 0.0#

The current slope, in the direction perpendicular to the longitudinal axis of the terrain, as a percentage.

double target_slope_#

The target slope, in the direction perpendicular to the longitudinal axis of the terrain, as a percentage.

double target_sideslope_#

The target sideslope, in the direction parallel to the longitudinal axis of the terrain, as a percentage.

bool slope_reached_ = false#

Indicates whether the target slope has been reached when using slope ramping.

std::shared_ptr<chrono::ChFunctionSineStep> slope_ramp_#

Shared pointer to the sinusoidal step function for slope ramping.

bool use_slope_ramp_ = false#

Indicated whether the slope will be gradually increased or suddenly stepped to the target value.

double time_to_max_slope_#

The time over which the slope will be increased from null to the target value, in seconds.

double current_throttle_ = 0.0#

The current throttle, as a percentage effort.

const double target_throttle_ = 1.0#

The target throttle for the straight line acceleration manoeuvre, as a percentage effort.

This value is usually wide-open-throttle (WOT) for a standard straight line acceleration test.

std::shared_ptr<chrono::ChFunctionSineStep> throttle_ramp_#

Shared pointer to the sinusoidal step function for throttle ramping.

double time_to_max_throttle_#

The time over which the throttle effort will be increased from null to target value, in seconds.

double minimum_time_#

The minimum amount of simulation time before end conditions are checked.

This value should be higher than null to avoid null initial speeds counting as steady state speeds for the straight line acceleration test.

std::shared_ptr<chrono::utils::ChRunningAverage> speed_filter_#

Shared pointer to the moving average filter for steady state speed detection.

double mean_speed_ = 0.0#

The current mean speed of the vehicle as computed by the moving average filter.

double averaging_window_#

The time window over which the moving average is computed, in seconds.

double speed_tolerance_ = 0.1#

The absolute tolerance between the mean speed measured at two subsequent steps before the simulation is terminated.

double steady_time_ = 0.0#

The time window over which a consistent steady speed has been detected.

double negative_time_ = 0.0#

The time window over which a consistent negative speed has been detected.

This value is used to detect failed runs where the vehicle is sliding down the grade.

std::string terrain_type_#

The terrain type identifier used to initialize the terrain model for the straight line acceleration simulation.

StraightLineBraking#

class StraightLineBraking : public DYNO::Simulation::VehicleSimulation#

TerrainMobility#

class TerrainMobility : public DYNO::Simulation::VehicleSimulation#

Protected Functions

virtual void InitializeDriver() override#

Initialize the driver for the mobility mapping scenario.

virtual void InitializeTerrain() override#

Initialize the terrain for the mobility mapping scenario.

virtual void PostInitializeTerrainHook() override#

Run the terrain post-initialization hook for the mobility mapping scenario.

virtual void SynchronizeDriver() override#

Synchronize the driver for the mobility mapping scenario.

virtual void PreSynchronizationHook() override#

Run the pre-synchronization hook for the mobility mapping scenario.

virtual void PostSynchronizationHook() override#

Run the post-synchronization hook for the mobility mapping scenario.

virtual void PostInitializationHook() override#

Run the post-initialization hook for the mobility mapping scenario.

Private Functions

void LoadWaypoints()#

Load the waypoints vector from a specified JSON configuration file on disk.

Private Members

std::vector<chrono::ChVector3d> points_#

Vector of target waypoints (expressed as three-dimensional positions).

std::vector<double> headings_#

Vector of target headings.

std::vector<double> speeds_#

Vector of waypoints speeds.

unsigned int waypoint_index_ = 0#

Current target waypoint index.

double endpoint_tolerance_ = 3.0#

Tolerance radius for waypoint completion, in meters.

VehicleSimulation#

class VehicleSimulation#

Subclassed by DYNO::Simulation::AutonomousVehicleSimulation, DYNO::Simulation::DoubleLaneChange, DYNO::Simulation::GradeClimbing, DYNO::Simulation::SideslopeStability, DYNO::Simulation::SinusoidalSteering, DYNO::Simulation::SplitSurface, DYNO::Simulation::StraightLineAcceleration, DYNO::Simulation::StraightLineBraking, DYNO::Simulation::TerrainMobility, DYNO::Simulation::WallToWall

Protected Attributes

bool is_successful_ = true#

Indicates whether or not the simulation was successful.

WallToWall#

class WallToWall : public DYNO::Simulation::VehicleSimulation#

Visualization#

IrrlichtTracked#

class IrrlichtTracked : public DYNO::Visualization::Irrlicht#

IrrlichtWheeled#

class IrrlichtWheeled : public DYNO::Visualization::Irrlicht#

Irrlicht#

class Irrlicht : public DYNO::Visualization::Wrapper#

Subclassed by DYNO::Visualization::IrrlichtTracked, DYNO::Visualization::IrrlichtWheeled

VulkanSceneGraph#

class VulkanSceneGraph : public DYNO::Visualization::Wrapper#

Wrapper#

class Wrapper#

Subclassed by DYNO::Visualization::Irrlicht, DYNO::Visualization::VulkanSceneGraph

Protected Attributes

std::shared_ptr<DYNO::Interfaces::JSONConfiguration> configuration_#

Visualization options JSON document.

bool is_enabled_ = false#

Whether or not the visualization is enabled.

double frame_rate_ = 30.0#

Frames per second for the visualization (measured with respect to system clock).

double simulation_time_ = 0.0#

Current simulation time.

double last_visualization_time_#

System clock at the latest visualization step.

ROS (C++)#

Native#

class NativeNode : public rclcpp::Node#

Private Functions

void PublishPointCloud()#

Publish the latest received point cloud.

Private Members

rclcpp::Publisher<rosgraph_msgs::msg::Clock>::SharedPtr clock_publisher_#

Shared pointer to the clock publisher.

rclcpp::Publisher<nav_msgs::msg::Odometry>::SharedPtr odometry_publisher_#

Shared pointer to the odometry publisher.

rclcpp::Publisher<std_msgs::msg::Float64>::SharedPtr steering_angle_publisher_#

Shared pointer to the steering angle publisher.

rclcpp::Publisher<sensor_msgs::msg::Imu>::SharedPtr imu_publisher_#

Shared pointer to the IMU publisher.

rclcpp::Publisher<sensor_msgs::msg::PointCloud2>::SharedPtr pointcloud_publisher_#

Shared pointer to the point cloud publisher.

double pointcloud_period_#

Rate at which point clouds are published.

rclcpp::Time last_pointcloud_time_#

Last time stamp for a received point cloud.

rclcpp::Publisher<sensor_msgs::msg::Image>::SharedPtr image_publisher_#

Shared pointer to the image publisher.

rclcpp::Publisher<sensor_msgs::msg::CameraInfo>::SharedPtr camera_info_publisher_#

Shared pointer to the image publisher.

Utilities (Python)#

Launch#

Launcher#

Postprocess#

Postprocessor#

Utilities#