Description

Collaboration diagram for Utilities:

Functions

Document chrono::sensor::ReadFileJSON (const std::string &filename)
 Load and return a RapidJSON document from the specified file. More...
 
CH_SENSOR_API ChVector chrono::sensor::ReadVectorJSON (const rapidjson::Value &a)
 Load and return a ChVector from the specified JSON array. More...
 
CH_SENSOR_API ChQuaternion chrono::sensor::ReadQuaternionJSON (const rapidjson::Value &a)
 Load and return a ChQuaternion from the specified JSON array. More...
 
CH_SENSOR_API ChFrame chrono::sensor::ReadFrameJSON (const rapidjson::Value &a)
 Load and return a ChFrame from the specified JSON array. More...
 
std::shared_ptr< ChSensorchrono::sensor::ReadSensorJSON (const std::string &filename, std::shared_ptr< chrono::ChBody > parent, chrono::ChFrame< double > offsetPose)
 Load and return a sensor from the specified JSON file. More...
 
std::shared_ptr< ChCameraSensorchrono::sensor::ReadCameraSensorJSON (const std::string &filename, std::shared_ptr< chrono::ChBody > parent, chrono::ChFrame< double > offsetPose)
 Load and return a camera sensor from the specified JSON file. More...
 
std::shared_ptr< ChGPSSensorchrono::sensor::ReadGPSSensorJSON (const std::string &filename, std::shared_ptr< chrono::ChBody > parent, chrono::ChFrame< double > offsetPose)
 Load and return a gps sensor from the specified JSON file. More...
 
std::shared_ptr< ChIMUSensorchrono::sensor::ReadIMUSensorJSON (const std::string &filename, std::shared_ptr< chrono::ChBody > parent, chrono::ChFrame< double > offsetPose)
 Load and return a imu sensor from the specified JSON file. More...
 
std::shared_ptr< ChLidarSensorchrono::sensor::ReadLidarSensorJSON (const std::string &filename, std::shared_ptr< chrono::ChBody > parent, chrono::ChFrame< double > offsetPose)
 Load and return a lidar sensor from the specified JSON file. More...
 
void chrono::sensor::ReadFilterListJSON (const std::string &filename, std::shared_ptr< ChSensor > sensor)
 Load and return a sensor filter list from the specified JSON file. More...
 
CH_SENSOR_API std::shared_ptr< ChFilterchrono::sensor::CreateFilterJSON (const rapidjson::Value &value)
 Load and return a sensor filter from the specified JSON value. More...
 
CH_SENSOR_API std::shared_ptr< ChIMUNoiseModelchrono::sensor::CreateIMUNoiseJSON (const rapidjson::Value &value)
 Load and return a imu noise model from the specified JSON value. More...
 
CH_SENSOR_API std::shared_ptr< ChGPSNoiseModelchrono::sensor::CreateGPSNoiseJSON (const rapidjson::Value &value)
 Load and return a gps noise model from the specified JSON value. More...
 
CH_SENSOR_API std::string chrono::sensor::GetStringMemberWithDefault (const rapidjson::Value &value, const char *member, const char *def="")
 Load and return a std::string from the specified JSON value Will check if member exists and returns if it does, def if not. More...
 
void chrono::sensor::CreateModernMeshAssets (std::shared_ptr< ChTriangleMeshShape > mesh_shape)
 Generate a set of visual assets that works with OptiX and handles the most modern rendering information contained in the mesh as possible. More...
 
void chrono::sensor::ConvertToModernAssets (std::shared_ptr< ChBody > body)
 Convert assets attached to a ChBody to modern assets by creating all necessary parameters for reflections, refractions, etc. More...
 
void chrono::sensor::ConvertToModernAssets (ChSystem *sys)
 Parse all assets of a chrono system to do a full conversion to assets needed by OptiX. More...
 
template<class T >
T * chrono::sensor::cudaMallocHelper (unsigned int size)
 Function for creating a chunk of memory that will implicitely desconstruct itself. More...
 
template<class T >
void chrono::sensor::cudaFreeHelper (T *ptr)
 The desconstructor that will be called to free memory from the device pointer. More...
 

Function Documentation

◆ ConvertToModernAssets() [1/2]

void chrono::sensor::ConvertToModernAssets ( ChSystem sys)

Parse all assets of a chrono system to do a full conversion to assets needed by OptiX.

Parameters
sysA pointer to the Chrono system that should be parsed for old assets.

◆ ConvertToModernAssets() [2/2]

void chrono::sensor::ConvertToModernAssets ( std::shared_ptr< ChBody body)

Convert assets attached to a ChBody to modern assets by creating all necessary parameters for reflections, refractions, etc.

Parameters
bodyThe body which should be parsed for old assets

◆ CreateFilterJSON()

CH_SENSOR_API std::shared_ptr<ChFilter> chrono::sensor::CreateFilterJSON ( const rapidjson::Value &  value)

Load and return a sensor filter from the specified JSON value.

Parameters
valueThe JSON value to be parsed
Returns
A ChFilter parsed from the JSON value

◆ CreateGPSNoiseJSON()

CH_SENSOR_API std::shared_ptr<ChGPSNoiseModel> chrono::sensor::CreateGPSNoiseJSON ( const rapidjson::Value &  value)

Load and return a gps noise model from the specified JSON value.

Parameters
valueThe JSON value to be parsed
Returns
A ChGPSNoiseModel parsed from the JSON value

◆ CreateIMUNoiseJSON()

CH_SENSOR_API std::shared_ptr<ChIMUNoiseModel> chrono::sensor::CreateIMUNoiseJSON ( const rapidjson::Value &  value)

Load and return a imu noise model from the specified JSON value.

Parameters
valueThe JSON value to be parsed
Returns
A ChIMUNoiseModel parsed from the JSON value

◆ CreateModernMeshAssets()

void chrono::sensor::CreateModernMeshAssets ( std::shared_ptr< ChTriangleMeshShape mesh_shape)

Generate a set of visual assets that works with OptiX and handles the most modern rendering information contained in the mesh as possible.

This includes information such as materials, normal mapping, etc that Chrono traditional wouldn't look for. Assets will be added directly to the mesh shape.

Parameters
mesh_shapeThe ChTriangleMeshShape that contains a mesh for which we want to look up its additional information if any exist

◆ cudaFreeHelper()

template<class T >
void chrono::sensor::cudaFreeHelper ( T *  ptr)
inline

The desconstructor that will be called to free memory from the device pointer.

Parameters
ptrThe pointer to the object that should be freed.

◆ cudaMallocHelper()

template<class T >
T* chrono::sensor::cudaMallocHelper ( unsigned int  size)
inline

Function for creating a chunk of memory that will implicitely desconstruct itself.

Parameters
sizeThe number of values for which we should have space. Full memory length will be size*sizeof(T)

◆ GetStringMemberWithDefault()

CH_SENSOR_API std::string chrono::sensor::GetStringMemberWithDefault ( const rapidjson::Value &  value,
const char *  member,
const char *  def = "" 
)

Load and return a std::string from the specified JSON value Will check if member exists and returns if it does, def if not.

Parameters
valueThe JSON value to be parsed
memberA member from the file to be read
defA default value to use if not definted in JSON file
Returns
A string parsed from the JSON value or default if none exists

◆ ReadCameraSensorJSON()

CH_SENSOR_API std::shared_ptr< ChCameraSensor > chrono::sensor::ReadCameraSensorJSON ( const std::string &  filename,
std::shared_ptr< chrono::ChBody parent,
chrono::ChFrame< double >  offsetPose 
)

Load and return a camera sensor from the specified JSON file.

Parameters
filenameThe name/path to the JSON file defining the camera sensor parameters
parentThe ChBody to which the sensor should be attached
offsetPoseThe position and rotation of the Camera Sensor
Returns
A shared pointer to a ChCameraSensor constructed from the JSON file

◆ ReadFileJSON()

CH_SENSOR_API rapidjson::Document chrono::sensor::ReadFileJSON ( const std::string &  filename)

Load and return a RapidJSON document from the specified file.

A Null document is returned if the file cannot be opened.

Parameters
filenameThe path to the file to be parsed
Returns
A rapid JSON document corresponding to the file name

◆ ReadFilterListJSON()

CH_SENSOR_API void chrono::sensor::ReadFilterListJSON ( const std::string &  filename,
std::shared_ptr< ChSensor sensor 
)

Load and return a sensor filter list from the specified JSON file.

Parameters
filenameThe name/path to the JSON file defining the filters for a sensor
sensorThe sensor to which the filters will be added

◆ ReadFrameJSON()

CH_SENSOR_API ChFrame chrono::sensor::ReadFrameJSON ( const rapidjson::Value &  a)

Load and return a ChFrame from the specified JSON array.

Parameters
aThe value to be read
Returns
A ChFrame generated from the JSON value

◆ ReadGPSSensorJSON()

CH_SENSOR_API std::shared_ptr< ChGPSSensor > chrono::sensor::ReadGPSSensorJSON ( const std::string &  filename,
std::shared_ptr< chrono::ChBody parent,
chrono::ChFrame< double >  offsetPose 
)

Load and return a gps sensor from the specified JSON file.

Parameters
filenameThe name/path to the JSON file defining the GPS sensor parameters
parentThe ChBody to which the sensor should be attached
offsetPoseThe position and rotation of the GPS Sensor
Returns
A shared pointer to a ChGPSSensor constructed from the JSON file

◆ ReadIMUSensorJSON()

CH_SENSOR_API std::shared_ptr< ChIMUSensor > chrono::sensor::ReadIMUSensorJSON ( const std::string &  filename,
std::shared_ptr< chrono::ChBody parent,
chrono::ChFrame< double >  offsetPose 
)

Load and return a imu sensor from the specified JSON file.

Parameters
filenameThe name/path to the JSON file defining the IMU sensor parameters
parentThe ChBody to which the sensor should be attached
offsetPoseThe position and rotation of the IMU Sensor
Returns
A shared pointer to a ChIMUSensor constructed from the JSON file

◆ ReadLidarSensorJSON()

CH_SENSOR_API std::shared_ptr< ChLidarSensor > chrono::sensor::ReadLidarSensorJSON ( const std::string &  filename,
std::shared_ptr< chrono::ChBody parent,
chrono::ChFrame< double >  offsetPose 
)

Load and return a lidar sensor from the specified JSON file.

Parameters
filenameThe name/path to the JSON file defining the lidar sensor parameters
parentThe ChBody to which the sensor should be attached
offsetPoseThe position and rotation of the Lidar Sensr
Returns
A shared pointer to a ChLidarSensor constructed from the JSON file

◆ ReadQuaternionJSON()

CH_SENSOR_API ChQuaternion chrono::sensor::ReadQuaternionJSON ( const rapidjson::Value &  a)

Load and return a ChQuaternion from the specified JSON array.

Parameters
aThe value to be read
Returns
A ChQuatertion generated from the JSON value

◆ ReadSensorJSON()

CH_SENSOR_API std::shared_ptr< ChSensor > chrono::sensor::ReadSensorJSON ( const std::string &  filename,
std::shared_ptr< chrono::ChBody parent,
chrono::ChFrame< double >  offsetPose 
)

Load and return a sensor from the specified JSON file.

Parameters
filenameThe name/path to the JSON file defining the sensor parameters
parentThe ChBody to which the sensor should be attached
offsetPoseThe position and rotation of the Sensor
Returns
A shared pointer to a ChSensor constructed from the JSON file

◆ ReadVectorJSON()

CH_SENSOR_API ChVector chrono::sensor::ReadVectorJSON ( const rapidjson::Value &  a)

Load and return a ChVector from the specified JSON array.

Parameters
aThe value to be read
Returns
A ChVector containing the values in ChVector format