Skip to content

Commit 6995fa1

Browse files
committed
private functions to normalize angle of scan point is implemented
1 parent e9a69da commit 6995fa1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

doc/3_sensor_models/3_2_lidar.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,4 +348,25 @@ The obstacles within the coverage of LiDAR can be observed. The private function
348348
"""
349349

350350
return (self.params.MIN_RANGE_M <= distance_m <= self.params.MAX_RANGE_M)
351+
```
352+
353+
For normalizing an angle of scan point data, the following private functions are implemented.
354+
```python
355+
def _normalize_angle_until_2pi(self, angle_rad):
356+
"""
357+
Private function to normalize sensing angle between 0 and 360 deg
358+
angle_rad: Sensing angle[rad]
359+
"""
360+
361+
if 0.0 > angle_rad: return (angle_rad + np.pi * 2.0)
362+
else: return angle_rad
363+
364+
def _normalize_angle_pi_2_pi(self, angle_rad):
365+
"""
366+
Private function to normalize sensing angle between -180 and 180 deg
367+
angle_rad: Sensing angle[rad]
368+
"""
369+
370+
if angle_rad > np.pi: return (angle_rad - np.pi * 2.0)
371+
else: return angle_rad
351372
```

0 commit comments

Comments
 (0)