Apart from cameras, AirGen currently supports the following sensors. Each sensor is associated with a integer enum specifying its sensor type.

Barometer

AirGen has a barometer as a default sensor for robots. The barometer primarily reports altitude and atmospheric pressure.

client = airgen.MultirotorClient()
client.getBarometerData()

<BarometerData> {   'altitude': 121.27217102050781,
    'pressure': 99876.0078125,
    'qnh': 1013.25,
    'time_stamp': 1721339963514664704}

GPS

AirGen contains support for a GPS sensor that returns the current geo location of the vehicle. The GPS sensor is enabled by default, but can be disabled through the Sensors tab in the custom session configuration panel

The GPS data is available through the getGpsData() method.

client = airgen.MultirotorClient()
gps_data = client.getGpsData()
latitude = gps_data.gnss.geopoint.latitude
longitude = gps_data.gnss.geopoint.longitude
altitude = gps_data.gnss.geopoint.altitude

IMU

AirGen contains support for Inertial Measurement Units (IMUs). Data captured from the IMU can be used to calculate the orientation of the vehicle. This is done using a combination of the accelerometer, gyroscope and magnetometer data.

The IMU data can be accessed using the getImuData method. This method returns an ImuData object which contains raw angular velocities and linear accelerations, as well as the orientation of the vehicle.

client = airgen.MultirotorClient()
imu_data = client.getImuData()

<ImuData>
{   'angular_velocity': <Vector3r> {   'x_val': 0.0007983481627888978,
    'y_val': 0.000933181494474411,
    'z_val': -0.0007887388928793371},
    'linear_acceleration': <Vector3r> {   'x_val': -0.11297493427991867,
    'y_val': 0.11055465042591095,
    'z_val': -9.841029167175293},
    'orientation': <Quaternionr> {   'w_val': -4.371138828673793e-08,
    'x_val': -0.0,
    'y_val': 0.0,
    'z_val': 1.0},
    'time_stamp': 1721340023239938816}

Magnetometer

AirGen has a magnetometer as a default sensor for robots. The magnetometer primarily reports magnetic field measurements on all three (X, Y, Z) axes.

client = airgen.MultirotorClient()
client.getMagnetometerData()

<MagnetometerData>
{   'magnetic_field_body': <Vector3r> {   'x_val': -0.25192224979400635,
    'y_val': -0.027216637507081032,
    'z_val': 0.37283220887184143},
    'magnetic_field_covariance': [   ],
    'time_stamp': 1721340120640016640}

LiDAR

AirGen contains support for LiDAR sensors, which capture 3D point clouds.

LiDAR Configuration

The configuration for the LiDAR sensor can be set up in the Sensors section of the configuration tab (accessible through the custom session panel). The following parameters are available:

ParameterDescription
NumberOfChannelsNumber of lasers arranged vertically
X, Y, ZPosition of the LiDAR relative to the vehicle
Roll, Pitch, YawOrientation of the LiDAR relative to the vehicle
VerticalFOVUpperTopmost orientation in degrees
VerticalFOVLowerBottommost orientation in degrees
HorizontalFOVStartLeftmost orientation in degrees
HorizontalFOVEndRightmost orientation in degrees

Accessing LiDAR Data

Assuming a LiDAR has been set up for a vehicle, the point cloud data can be accessed as follows, and optionally visualized through Rerun.

client = airgen.MultirotorClient()

# Get LiDAR data
lidar_data = client.getLidarData()

# Extract point cloud
points = numpy.array(data.point_cloud, dtype=numpy.dtype('f4'))
points = numpy.reshape(points, (int(points.shape[0]/3), 3))

# Visualize point cloud
import rerun as rr 
rr.log('lidar/points', rr.Points3D(points))

The structure of the output of client.getLidarData() can be seen at airgen.types.LidarData().

Distance Sensor

This is a simple distance sensor that emulates an ultrasonic sensor to measure the distance to an object.

Distance Sensor Configuration

The configuration for the distance sensor can be set up in the Sensors section of the configuration tab (accessible through the custom session panel). By default, the distance sensor points to the front of the vehicle. The following parameters are available:

ParameterDescription
MinDistanceMinimum distance the sensor can capture
MaxDistanceMaximum distance the sensor can capture
X, Y, ZPosition of the sensor relative to the vehicle
Roll, Pitch, YawOrientation of the sensor relative to the vehicle

Accessing Distance Data

The distance sensor can be accessed through the getDistanceData method.

client = airgen.MultirotorClient()
distance = client.getDistanceData()

Was this page helpful?