Skip to content

Commit

Permalink
[docs] Add info about Distance sensor settings and usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rajat2004 committed Jun 30, 2020
1 parent 04c0073 commit cbceb09
Showing 1 changed file with 44 additions and 8 deletions.
52 changes: 44 additions & 8 deletions docs/sensors.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Behind the scenes, `createDefaultSensorSettings` method in [AirSimSettings.hpp](

The default sensor list can be configured in settings json:

```JSON
```json
"DefaultSensors": {
"Barometer": {
"SensorType": 1,
Expand Down Expand Up @@ -72,7 +72,7 @@ If a vehicle provides its sensor list, it **must** provide the whole list. Selec
A vehicle specific sensor list can be specified in the vehicle settings part of the json.
e.g.,

```
```json
"Vehicles": {

"Drone1": {
Expand Down Expand Up @@ -105,6 +105,42 @@ e.g.,
Each sensor-type has its own set of settings as well.
Please see [lidar](lidar.md) for example of Lidar specific settings.

#### Distance Sensor

By default, Distance Sensor points to the front of the vehicle. It can be pointed in any direction by modifying the settings

Configurable Parameters -

Parameter | Description
-----------------|------------
X Y Z | Position of the sensor relative to the vehicle (in NED, in meters) (Default (0,0,0))
Yaw Pitch Roll | Orientation of the sensor relative to the vehicle (degrees) (Default (0,0,0))
MinDistance | Minimum distance measured by distance sensor (metres, only used to fill Mavlink message for PX4) (Default 0.2m)
MaxDistance | Maximum distance measured by distance sensor (metres) (Default 40.0m)

For example, to make the sensor point towards the ground (for altitude measurement similar to barometer), the orientation can be modified as follows -

```json
"Distance": {
"SensorType": 5,
"Enabled" : true,
"Yaw": 0, "Pitch": -90, "Roll": 0
}
```

##### Server side visualization for debugging

Be default, the points hit by distance sensor are not drawn on the viewport. To enable the drawing of hit points on the viewport, please enable setting `DrawDebugPoints` via settings json. E.g. -

```json
"Distance": {
"SensorType": 5,
"Enabled" : true,
...
"DrawDebugPoints": true
}
```

## Sensor APIs
Jump straight to [`hello_drone.py`](https://github.com/Microsoft/AirSim/blob/master/PythonClient/multirotor/hello_drone.py) or [`hello_drone.cpp`](https://github.com/Microsoft/AirSim/blob/master/HelloDrone/main.cpp) for example usage, or see follow below for the full API.

Expand All @@ -117,7 +153,7 @@ Jump straight to [`hello_drone.py`](https://github.com/Microsoft/AirSim/blob/mas

Python
```python
barometer_data = getBarometerData(barometer_name = "", vehicle_name = "")
barometer_data = client.getBarometerData(barometer_name = "", vehicle_name = "")
```

- IMU
Expand All @@ -129,7 +165,7 @@ Jump straight to [`hello_drone.py`](https://github.com/Microsoft/AirSim/blob/mas

Python
```python
imu_data = getImuData(imu_name = "", vehicle_name = "")
imu_data = client.getImuData(imu_name = "", vehicle_name = "")
```

- GPS
Expand All @@ -140,7 +176,7 @@ Jump straight to [`hello_drone.py`](https://github.com/Microsoft/AirSim/blob/mas
```
Python
```python
gps_data = getGpsData(gps_name = "", vehicle_name = "")
gps_data = client.getGpsData(gps_name = "", vehicle_name = "")
```

- Magnetometer
Expand All @@ -151,18 +187,18 @@ Jump straight to [`hello_drone.py`](https://github.com/Microsoft/AirSim/blob/mas
```
Python
```python
magnetometer_data = getMagnetometerData(magnetometer_name = "", vehicle_name = "")
magnetometer_data = client.getMagnetometerData(magnetometer_name = "", vehicle_name = "")
```

- Distance sensor

C++
```cpp
msr::airlib::DistanceBase::Output getDistanceSensorData(const std::string& distance_sensor_name = "", const std::string& vehicle_name = "");
msr::airlib::DistanceSensorData getDistanceSensorData(const std::string& distance_sensor_name = "", const std::string& vehicle_name = "");
```
Python
```python
distance_sensor_name = getDistanceSensorData(distance_sensor_name = "", vehicle_name = "")
distance_sensor_data = client.getDistanceSensorData(distance_sensor_name = "", vehicle_name = "")
```

- Lidar
Expand Down

0 comments on commit cbceb09

Please sign in to comment.