Skip to content

Commit cbceb09

Browse files
committed
[docs] Add info about Distance sensor settings and usage
1 parent 04c0073 commit cbceb09

File tree

1 file changed

+44
-8
lines changed

1 file changed

+44
-8
lines changed

docs/sensors.md

+44-8
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Behind the scenes, `createDefaultSensorSettings` method in [AirSimSettings.hpp](
3535

3636
The default sensor list can be configured in settings json:
3737

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

75-
```
75+
```json
7676
"Vehicles": {
7777

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

108+
#### Distance Sensor
109+
110+
By default, Distance Sensor points to the front of the vehicle. It can be pointed in any direction by modifying the settings
111+
112+
Configurable Parameters -
113+
114+
Parameter | Description
115+
-----------------|------------
116+
X Y Z | Position of the sensor relative to the vehicle (in NED, in meters) (Default (0,0,0))
117+
Yaw Pitch Roll | Orientation of the sensor relative to the vehicle (degrees) (Default (0,0,0))
118+
MinDistance | Minimum distance measured by distance sensor (metres, only used to fill Mavlink message for PX4) (Default 0.2m)
119+
MaxDistance | Maximum distance measured by distance sensor (metres) (Default 40.0m)
120+
121+
For example, to make the sensor point towards the ground (for altitude measurement similar to barometer), the orientation can be modified as follows -
122+
123+
```json
124+
"Distance": {
125+
"SensorType": 5,
126+
"Enabled" : true,
127+
"Yaw": 0, "Pitch": -90, "Roll": 0
128+
}
129+
```
130+
131+
##### Server side visualization for debugging
132+
133+
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. -
134+
135+
```json
136+
"Distance": {
137+
"SensorType": 5,
138+
"Enabled" : true,
139+
...
140+
"DrawDebugPoints": true
141+
}
142+
```
143+
108144
## Sensor APIs
109145
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.
110146

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

118154
Python
119155
```python
120-
barometer_data = getBarometerData(barometer_name = "", vehicle_name = "")
156+
barometer_data = client.getBarometerData(barometer_name = "", vehicle_name = "")
121157
```
122158

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

130166
Python
131167
```python
132-
imu_data = getImuData(imu_name = "", vehicle_name = "")
168+
imu_data = client.getImuData(imu_name = "", vehicle_name = "")
133169
```
134170

135171
- GPS
@@ -140,7 +176,7 @@ Jump straight to [`hello_drone.py`](https://github.com/Microsoft/AirSim/blob/mas
140176
```
141177
Python
142178
```python
143-
gps_data = getGpsData(gps_name = "", vehicle_name = "")
179+
gps_data = client.getGpsData(gps_name = "", vehicle_name = "")
144180
```
145181

146182
- Magnetometer
@@ -151,18 +187,18 @@ Jump straight to [`hello_drone.py`](https://github.com/Microsoft/AirSim/blob/mas
151187
```
152188
Python
153189
```python
154-
magnetometer_data = getMagnetometerData(magnetometer_name = "", vehicle_name = "")
190+
magnetometer_data = client.getMagnetometerData(magnetometer_name = "", vehicle_name = "")
155191
```
156192

157193
- Distance sensor
158194

159195
C++
160196
```cpp
161-
msr::airlib::DistanceBase::Output getDistanceSensorData(const std::string& distance_sensor_name = "", const std::string& vehicle_name = "");
197+
msr::airlib::DistanceSensorData getDistanceSensorData(const std::string& distance_sensor_name = "", const std::string& vehicle_name = "");
162198
```
163199
Python
164200
```python
165-
distance_sensor_name = getDistanceSensorData(distance_sensor_name = "", vehicle_name = "")
201+
distance_sensor_data = client.getDistanceSensorData(distance_sensor_name = "", vehicle_name = "")
166202
```
167203

168204
- Lidar

0 commit comments

Comments
 (0)