Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
msz-rai committed Oct 17, 2023
1 parent 9410ddb commit 71545ce
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 17 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 64 additions & 8 deletions docs/Components/Sensors/LiDARSensor/AddNewLiDAR/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,83 @@
!!! warning "Supported LiDARs"
Not all lidar types are supported by `RGL`. Unfortunately, in the case of `MEMs` *LiDARs*, there is a non-repetitive phenomenon - for this reason, the current implementation is not able to reproduce their work.

## 1. Add new LiDAR model
## 1. Add a new LiDAR model
The example shows the addition of a *LiDAR* named `NewLidarModel`.

To add a new *LiDAR* model, perform the following steps:

1. Navigate to `Assets/RGLUnityPlugin/Scripts/LidarModels`.

1. Add its name to the `LidarModels.cs` at the end of the enumeration. The order of enums must not be changed to keep existing prefabs working.

![lidar_models](lidar_models.png)

1. If the *LiDAR* has a non-uniform laser array construction (e.g. different linear / angular spacing between lasers), add an entry to the `LaserArrayLibrary`, otherwise, skip this step.

!!! warning "Coordinate system"
Keep in mind that *Unity* has a left-handed coordinate system, while most of the lidar's manuals use a right-handed coordinate system. In that case, reverse sign of the values of the angles.
1. Now, it is time to define the laser (also called a channel) distribution of the *LiDAR*.

!!! info
If your *LiDAR*:

- has a uniform laser distribution
- has the equal range for all of the lasers
- fire all of the rays (beams) at the same time

You can skip this step and use our helper method to generate a simple uniform laser array definition (more information in the next step).

1. Laser distribution is represented by `LaserArray` consists of:
- `centerOfMeasurementLinearOffsetMm` - 3D translation from the game object's origin to *LiDAR's* origin. Preview in 2D:

<img src="img/LidarOriginParameter.png" width="300">

- `focalDistanceMm` - Distance from the sensor center to the focal point where all laser beams intersect.

<img src="img/LidarFocalDistanceParamter.png" width="300">

- `lasers` - array of lasers (channels) with a number of parameters:

- `horizontalAngularOffsetDeg` - horizontal angle offset of the laser (Azimuth)
- `verticalAngularOffsetDeg` - vertical angle offset of the laser (Elevation)
- `verticalLinearOffsetMm` - vertical offset of the laser (translation from origin)
- `ringId` - Id of the ring (in most cases laser Id)
- `timeOffset` - time offset of the laser firing in milliseconds (with reference to the first laser in the array)
- `minRange` - minimum range of the laser (set if lasers have different ranges)
- `maxRange` - maximum range of the laser (set if lasers have different ranges)

1. To define a new laser distribution create a new entry to the `LaserArrayLibrary.cs`

![lidar_array](img/LidarLaserArray.png)

1. Add a new public static instance of `LaserArray` with the definition.

1. Add a new item to the `ByModel` dictionary that collects *LiDAR* model enumerations with their laser array definitions.

In this example, `NewLidarModel` laser distribution consists of 5 lasers with

- elevations: 15, 10, 0, -10, -15 degrees
- azimuths: 1.4, -1.4, 1.4, -1.4, 1.4 degrees
- ring Ids: 1, 2, 3, 4, 5
- time offsets: 0, 0.01, 0.02, 0.03, 0.04 milliseconds
- an equal range that will be defined later

!!! warning "Coordinate system"
Keep in mind that *Unity* has a left-handed coordinate system, while most of the *LiDAR's* manuals use a right-handed coordinate system. In that case, reverse sign of the values of the angles.

![lidar_array](lidar_array.png)
1. The last step is to create a *LiDAR* configuration by adding an entry to `LidarConfigurationLibrary.cs`

![lidar_configuration](img/LidarConfiguration.png)

1. Add a new public static instance of `LidarConfiguration` with the definition:

1. Add an entry to `LidarConfigurationLibrary`. If the *LiDAR* has a uniform laser generate a uniform one using static method `LaserArray.Uniform()` - just like the `RangeMeter`.
- `laserArray` - laser distribution array created in the previous step (it could be also generated uniformly with `LaserArray.Uniform()`)
- `horizontalResolution` - horizontal resolution of laser array firings in degrees (laser array will be rotated according to this resolution)
- `laserArrayCycleTime` - time between two consecutive firings of the whole laser array in milliseconds. Usually, it consists of firing time for all the lasers and recharge time. Skip this parameter if all of the rays are fired at the same time.
- `minHAngle` - minimum horizontal angle of the *LiDAR*
- `maxHAngle` - maximum horizontal angle of the *LiDAR*
- `noiseParams` - *LiDAR* noise parameters (see `LidarNoiseParams.cs` for more details)
- `rayGenerateMethod` - if *LiDAR* has equal range for all of the lasers choose `RotatingLidarEqualRange` and configure `minRange` and `maxRange` in the `LidarConfiguration`. Otherwise, choose `RotatingLidarDifferentLaserRanges` and define ranges in `LaserArray`.
- `minRange` - minimum range of the sensor (applied when `Ray Generate Method` is `Rotating Lidar Equal Range`)
- `maxRange` - maximum range of the sensor (applied when `Ray Generate Method` is `Rotating Lidar Equal Range`)

![lidar_configuration](lidar_configuration.png)
1. Add a new item to the `ByModel` dictionary that collects *LiDAR* model enumerations with their *LiDAR* configurations.

1. Done. New *LiDAR* preset should be available via *Unity Inspector*.

Expand Down
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 10 additions & 9 deletions docs/Components/Sensors/LiDARSensor/LiDARSensor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,16 @@ Assets/AWSIM/Prefabs/RobotecGPULidars/*

The table of available prefabs can be found below:

| LiDAR | Path | Appearance |
| :-------------------- | :----------------------- | :----------------------------------------------- |
| *HESAI Pandar40P* | `HesaiPandar40P.prefab` | <img src=imgs_prefabs/pandar40p.png width=150px> |
| *HESAI PandarQT64* | `HesaiPandarQT64.prefab` | <img src=imgs_prefabs/pandarqt.png width=150px> |
| *HESAI AT128 E2X* | `HesaiAT128E2X.prefab` | <img src=imgs_prefabs/at128e2x.png width=150px> |
| *Ouster OS1-64* | `OusterOS1-64.prefab` | <img src=imgs_prefabs/os1-64.png width=150px> |
| *Velodyne VLP-16* | `VelodyneVLP16.prefab` | <img src=imgs_prefabs/vlp16.png width=150px> |
| *Velodyne VLC-32C* | `VelodyneVLP32C.prefab` | <img src=imgs_prefabs/vlp32.png width=150px> |
| *Velodyne VLS-128-AP* | `VelodyneVLS128.prefab` | <img src=imgs_prefabs/vls128.png width=150px> |
| LiDAR | Path | Appearance |
| :-------------------- | :----------------------- | :------------------------------------------------ |
| *HESAI Pandar40P* | `HesaiPandar40P.prefab` | <img src=imgs_prefabs/pandar40p.png width=150px> |
| *HESAI PandarQT64* | `HesaiPandarQT64.prefab` | <img src=imgs_prefabs/pandarqt.png width=150px> |
| *HESAI PandarXT32* | `HesaiPandarXT32.prefab` | <img src=imgs_prefabs/pandarxt32.png width=150px> |
| *HESAI AT128 E2X* | `HesaiAT128E2X.prefab` | <img src=imgs_prefabs/at128e2x.png width=150px> |
| *Ouster OS1-64* | `OusterOS1-64.prefab` | <img src=imgs_prefabs/os1-64.png width=150px> |
| *Velodyne VLP-16* | `VelodyneVLP16.prefab` | <img src=imgs_prefabs/vlp16.png width=150px> |
| *Velodyne VLC-32C* | `VelodyneVLP32C.prefab` | <img src=imgs_prefabs/vlp32.png width=150px> |
| *Velodyne VLS-128-AP* | `VelodyneVLS128.prefab` | <img src=imgs_prefabs/vls128.png width=150px> |

### Link in the default Scene
![link](link.png)
Expand Down

0 comments on commit 71545ce

Please sign in to comment.