> ## Documentation Index
> Fetch the complete documentation index at: https://scaledfoundations-rebrand.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Sensors

GRID currently supports the following sensors with Isaac Sim.

## Camera

This is a camera sensor that can be of type RGB or Depth.

### Configuration

The configuration for the camera sensor can be set up in the the configuration file. The following parameters are available:

| Parameter               | Description                                                             |
| ----------------------- | ----------------------------------------------------------------------- |
| **Height**              | The height of the captured image                                        |
| **Width**               | The width of the captured image                                         |
| **Offset**              | The offset of the camera with respect to the robot's frame of reference |
| **Focal Length**        | The focal length of the camera                                          |
| **Focal Distance**      | The focal distance of the camera                                        |
| **Horizontal Aperture** | The horizontal aperture of the camera                                   |
| **Clipping Range**      | The clipping range of the camera                                        |

These parameters can be configured using the `scene_cfg.yaml` in the following manner:

```yaml
sensors:
    - camera_0: # choose a name for the sensor
        type: CameraRGB # or CameraDepth
        config:
            prim_path: "" # Prim path to the link you want to attach the camera sensor
            height: 400
            width: 600
            offset: 
                pos: [0.0, 0.0, 0.0] # add init (x, y, z) position  
                rot: [0.0, 0.0, 0.0, 0.0] # add init (x, y, z, w) quaternion
            spawn:
                focal_length: 24.0
                focus_distance: 400.0
                horizontal_aperture: 20.955
                clipping_range: (0.1, 1.0e5)
```

## Contact Sensor

This is a simple contact sensor that works as a ray caster simulating surface pressure by detecting contact points with precision.

### Configuration

The configuration for the height sensor can be set up in the the configuration file. The following parameters are available:

| Parameter          | Description                                                     |
| ------------------ | --------------------------------------------------------------- |
| **History length** | The length of history to consider while computing sensor values |

These parameters can be configured using the `scene_cfg.yaml` in the following manner:

```yaml
sensors:
    - contact_forces: # choose a name for the sensor
         type: ContactSensor
         config:
            history_length: 3
```

## Height Sensor

This is a simple height sensor that works as a ray caster to obtain the height values of points in a specified pattern.

### Configuration

The configuration for the height sensor can be set up in the the configuration file. The following parameters are available:

| Parameter              | Description                                                                |
| ---------------------- | -------------------------------------------------------------------------- |
| **Offset**             | The offset of the height sensor with respect to robot's frame of reference |
| **Pattern Resolution** | The resolution of the grid pattern around the sensor                       |
| **Pattern Size**       | The start and end of the grid pattern                                      |

These parameters can be configured using the `scene_cfg.yaml` in the following manner:

```yaml
sensors:
    - height_scanner: # choose a name for the sensor
        type: HeightSensor
        link: torso_link # link to which you want to attach the sensor
        config:
            offset: 
                pos: [0.0, 0.0, 0.0] # add init (x, y, z) position  
                rot: [0.0, 0.0, 0.0, 0.0] # add init (x, y, z, w) quaternion
            pattern_cfg:
                resolution: 0.1 
                size=[1.6, 1.0]
```

## LiDAR

This is a LiDAR sensor that works as a ray caster to obtain a point cloud around the sensor.

### Configuration

The configuration for the height sensor can be set up in the the configuration file. The following parameters are available:

| Parameter                 | Description                                                                    |
| ------------------------- | ------------------------------------------------------------------------------ |
| **Offset**                | The offset of the height sensor with respect to the robot's frame of reference |
| **Pattern Size**          | The start and end of the grid pattern                                          |
| **Max Distance**          | The maximum sensing distance of the height sensor                              |
| **Vertical FOV**          | The vertical field of view of the sensor                                       |
| **Horizontal FOV**        | The horizontal field of view of the sensor                                     |
| **Horizontal Resolution** | The horizontal resolution of the sensor                                        |
| **Channels**              | The number of channels used by the sensor                                      |

These parameters can be configured using the `scene_cfg.yaml` in the following manner:

```yaml
sensors:
    - lidar: # choose a name for the sensor
        type: LiDAR
        link: torso_link # link to which you want to attach the sensor
        config:
            offset: 
                pos: [0.0, 0.0, 0.0] # add init (x, y, z) position  
                rot: [0.0, 0.0, 0.0, 0.0] # add init (x, y, z, w) quaternion
            pattern_cfg:
                channels: 16 
                vertical_fov_range=(-15.0, 15.0)
                horizontal_fov_range=(-180.0, 180.0)
                horizontal_res=0.2
            max_distance: 100
```
