Skip to content

Commit

Permalink
Merge pull request #22 from nicolasperez19/localization-grid-offset
Browse files Browse the repository at this point in the history
feat: Offset the center of the grid by the radius of the robot and extended max radius of grid
  • Loading branch information
nicolasperez19 authored Nov 10, 2024
2 parents 098b9b5 + db90c30 commit a6d5606
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ def _compute_cross_spectrum(self, mic_signals:np.ndarray[np.float32], fft_size:i
return cross_spectrum

def _generate_circular_grid(
self, radius:float=1.0, num_points_radial:int=50, num_points_angular:int=360
self, offset:float=0.45, radius:float=1.0, num_points_radial:int=50, num_points_angular:int=360
)-> np.ndarray[np.float32]:
"""Generate a grid of points on a circular plane, optimized for speed."""
# Create radial distances from 0 to the specified radius
r = np.linspace(0, radius, num_points_radial, dtype=np.float32)
r = np.linspace(offset, radius + offset, num_points_radial, dtype=np.float32)

# Create angular values from 0 to 2*pi
theta = np.linspace(0, 2 * np.pi, num_points_angular, dtype=np.float32)
Expand Down

0 comments on commit a6d5606

Please sign in to comment.