Skip to content

Commit

Permalink
private function to install sensors is implemented in vehicle class
Browse files Browse the repository at this point in the history
  • Loading branch information
ShisatoYano committed Feb 19, 2025
1 parent 3f62f12 commit 2b4dbd2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doc/3_sensor_models/3_3_sensors.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,20 @@ class FourWheelsVehicle:
sensors: Sencors object
show_zoom: Flag for zoom around vehicle
"""
```

A private function to install sensors is implemented. This function is used to compute the global position coordinate of the sensors based on the current state of the vehicle. The function, install in Sensors class is called.
```python
def _install_sensors(self, state):
"""
Private function to calculate each sensor's installation position on vehicle
state: Vehicle's state object
"""

if self.sensors: self.sensors.install(state)
```
The added argument, sensors is stored in a member variable and the above function, _install_sensors() is called in the constructor.
```python
self.sensors = sensors
self._install_sensors(self.state)
```

0 comments on commit 2b4dbd2

Please sign in to comment.