Sensors
The sensors’ bundle provides the ability to quickly attach sensors to models to provide realistic observations of the environment. Each sensor in this bundle models the sensor logic, the functional essence of the sensor, separately from its physical body. This allows sensor logic to be attached to any suitable physical attachment that one would wish to use.
Structure
The structure of the sensors’ bundle and the related optics materials in the physics bundle can be seen in the following schematic:

Lidars
Light detection and ranging (Lidar) is a kind of sensor that is generally used to scan an environment into a point cloud, providing a 3D representation of the environment. The sensors’ bundle provides a simple way to model lidar sensors.
Pulsed Lidars
For the most common case of a pulsed lidar sensor, the Sensors.PulsedLidarLogic can be added to a Physics3D.System, which can then be provided with a suitable body to which the logic can be connected through a Physics3D.Interactions.MateConnector:
MyPulsedLidar is Physics3D.System:
body is Physics3D.Bodies.RigidBody:
is_dynamic: false
inertia:
mass: 1.0
tensor: Physics3D.Bodies.Inertia.symmetric_tensor(Math.Vec3.from_xyz(1.0, 1.0, 1.0), 0.0, 0.0, 0.0)
visual is Visuals.Geometries.Cylinder:
local_transform:
rotation: Math.Quat.from_euler_angles(Math.Functions.deg_to_rad(90.0), 0.0, 0.0)
radius: 0.05
height: 0.1
connector is Physics3D.Interactions.RedirectedMateConnector:
redirected_parent: body
logic is Sensors.PulsedLidarLogic:
wavelength: 905e-9
mate_connector_attachment: body.connector
beam_divergence: ?
ray_source: ?
To make a properly functioning pulsed lidar, one must also specify a ray emission source, configuring the ray emission properties, and a configuration of the divergence of the emitted beams.
Alternatives for these can be found in the Sensors.Optics subdirectory, and added to the pulsed lidar logic:
MyPulsedLidar is Physics3D.System:
⋮
logic is Sensors.PulsedLidarLogic:
⋮
beam_divergence becomes Sensors.Optics.ConicalBeamDivergence:
divergence_angle: 0.1
waist_radius: 0.0
ray_source becomes Sensors.Optics.HorizontalSweepRaySource:
frequency: 60.0
horizontal_fov:
x: 0.0
y: Math.Functions.deg_to_rad(360.0)
vertical_fov:
x: Math.Functions.deg_to_rad(-15.0)
y: Math.Functions.deg_to_rad( 15.0)
horizontal_resolution: 1024
vertical_resolution: 64
With this, the basic logic of a rotary pulsed lidar has been created.
Then, to access the produced point cloud in a generic way a Sensors.Signals.LidarOutput is added to the logic with the output fields of interest specified.
A position and intensity output is added as:
MyPulsedLidar is Physics3D.System:
⋮
logic is Sensors.PulsedLidarLogic:
⋮
my_output is Sensors.Signals.LidarOutput:
type: 0
fields: [
Sensors.Signals.LidarOutputField.Position3D_F32,
Sensors.Signals.LidarOutputField.Intensity_F32,
]
source: logic
This configuration currently denotes a ground truth rotary pulsed lidar.
Optionally, to distort the rays emitted from the lidar a number of Sensors.Optics.RayEmissionDistortion specializations can be added to the ray_emission_distortions array in the lidar logic.
Alternatives for these can be found in the Sensors.Optics subdirectory, and added as:
MyPulsedLidar is Physics3D.System:
⋮
logic is Sensors.PulsedLidarLogic:
⋮
my_angle_distortion is Sensors.Optics.RayEmissionAngleGaussianNoise:
mean: 0.0
standard_deviation: 0.1e-3
rotation_axis: Math.Vec3.X_AXIS()
ray_emission_distortions: [ logic.my_angle_distortion ]
Sensing Distortions for Lidars
Optionally, to add distortions to the sensing process, light detection and post-processing, of the lidar sensor specializations of Sensors.LidarSensingDistortion can be added to the sensing_distortions array of the lidar.
Alternatives for these can be found in the root Sensors directory of the bundle, and added as:
MyLidar is Physics3D.System:
⋮
logic is Sensors.LidarLogic:
⋮
my_detection_distance_error is Sensors.LidarDetectionDistanceGaussianNoise:
mean: 0.0
standard_deviation: 0.5e-2
standard_deviation_slope: 0.4e-4
sensing_distortions: [ logic.my_detection_distance_error ]