Skip to content

Commit 2b4dbd2

Browse files
committed
private function to install sensors is implemented in vehicle class
1 parent 3f62f12 commit 2b4dbd2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

doc/3_sensor_models/3_3_sensors.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,20 @@ class FourWheelsVehicle:
105105
sensors: Sencors object
106106
show_zoom: Flag for zoom around vehicle
107107
"""
108+
```
109+
110+
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.
111+
```python
112+
def _install_sensors(self, state):
113+
"""
114+
Private function to calculate each sensor's installation position on vehicle
115+
state: Vehicle's state object
116+
"""
117+
118+
if self.sensors: self.sensors.install(state)
119+
```
120+
The added argument, sensors is stored in a member variable and the above function, _install_sensors() is called in the constructor.
121+
```python
122+
self.sensors = sensors
123+
self._install_sensors(self.state)
108124
```

0 commit comments

Comments
 (0)