Public Member Functions | Private Attributes | List of all members
beluga::Ray2d< OccupancyGrid, Algorithm > Class Template Reference

Castable 2D ray. More...

#include <raycasting.hpp>

Public Member Functions

std::optional< double > cast (const Sophus::SO2d &bearing) const
 Casts ray along a given direction. More...
 
 Ray2d (const OccupancyGrid &grid, Algorithm algorithm, const Sophus::SE2d &source_pose, double max_range) noexcept
 Constructs 2D ray with an specific ray tracing algorithm. More...
 
 Ray2d (const OccupancyGrid &grid, const Sophus::SE2d &source_pose, double max_range) noexcept
 Constructs 2D ray with default ray tracing algorithm. More...
 
auto trace (const Sophus::SO2d &bearing) const
 Computes ray trace along a given direction. More...
 

Private Attributes

const Algorithm algorithm_
 
const OccupancyGrid & grid_
 
const double max_range_
 
const Eigen::Vector2i source_cell_
 
const Sophus::SE2d source_pose_in_local_frame_
 

Detailed Description

template<class OccupancyGrid, typename Algorithm = Bresenham2i>
class beluga::Ray2d< OccupancyGrid, Algorithm >

Castable 2D ray.

Template Parameters
OccupancyGridA 2D occupancy grid
AlgorithmA callable type, taking start and end grid cells for a ray and returning the full trace.

Definition at line 44 of file include/beluga/algorithm/raycasting.hpp.

Constructor & Destructor Documentation

◆ Ray2d() [1/2]

template<class OccupancyGrid , typename Algorithm = Bresenham2i>
beluga::Ray2d< OccupancyGrid, Algorithm >::Ray2d ( const OccupancyGrid &  grid,
const Sophus::SE2d source_pose,
double  max_range 
)
inlineexplicitnoexcept

Constructs 2D ray with default ray tracing algorithm.

See Ray2d(const OccupancyGrid &, Algorithm, const Sophus::SE2d&, double) for further reference on constructor arguments.

Definition at line 51 of file include/beluga/algorithm/raycasting.hpp.

◆ Ray2d() [2/2]

template<class OccupancyGrid , typename Algorithm = Bresenham2i>
beluga::Ray2d< OccupancyGrid, Algorithm >::Ray2d ( const OccupancyGrid &  grid,
Algorithm  algorithm,
const Sophus::SE2d source_pose,
double  max_range 
)
inlineexplicitnoexcept

Constructs 2D ray with an specific ray tracing algorithm.

Parameters
gridGrid on which to perform ray casting.
algorithmRay tracing algorithm implementation.
source_posePose of the source of the ray in the same frame as that on which the grid origin is defined.
max_rangeMaximum range for the ray, in meters.

Definition at line 62 of file include/beluga/algorithm/raycasting.hpp.

Member Function Documentation

◆ cast()

template<class OccupancyGrid , typename Algorithm = Bresenham2i>
std::optional<double> beluga::Ray2d< OccupancyGrid, Algorithm >::cast ( const Sophus::SO2d bearing) const
inline

Casts ray along a given direction.

Distances are measured from cell centroid to cell centroid.

Parameters
bearingDirection for ray casting.
Returns
Distance in meters to first non free cell hit by the ray, if any.

Definition at line 97 of file include/beluga/algorithm/raycasting.hpp.

◆ trace()

template<class OccupancyGrid , typename Algorithm = Bresenham2i>
auto beluga::Ray2d< OccupancyGrid, Algorithm >::trace ( const Sophus::SO2d bearing) const
inline

Computes ray trace along a given direction.

Parameters
bearingDirection for ray tracing.
Returns
Full range of grid cells traced by the ray. That is, regardless of grid cells' state.

Definition at line 79 of file include/beluga/algorithm/raycasting.hpp.

Member Data Documentation

◆ algorithm_

template<class OccupancyGrid , typename Algorithm = Bresenham2i>
const Algorithm beluga::Ray2d< OccupancyGrid, Algorithm >::algorithm_
private

Definition at line 111 of file include/beluga/algorithm/raycasting.hpp.

◆ grid_

template<class OccupancyGrid , typename Algorithm = Bresenham2i>
const OccupancyGrid& beluga::Ray2d< OccupancyGrid, Algorithm >::grid_
private

Definition at line 110 of file include/beluga/algorithm/raycasting.hpp.

◆ max_range_

template<class OccupancyGrid , typename Algorithm = Bresenham2i>
const double beluga::Ray2d< OccupancyGrid, Algorithm >::max_range_
private

Definition at line 114 of file include/beluga/algorithm/raycasting.hpp.

◆ source_cell_

template<class OccupancyGrid , typename Algorithm = Bresenham2i>
const Eigen::Vector2i beluga::Ray2d< OccupancyGrid, Algorithm >::source_cell_
private

Definition at line 113 of file include/beluga/algorithm/raycasting.hpp.

◆ source_pose_in_local_frame_

template<class OccupancyGrid , typename Algorithm = Bresenham2i>
const Sophus::SE2d beluga::Ray2d< OccupancyGrid, Algorithm >::source_pose_in_local_frame_
private

Definition at line 112 of file include/beluga/algorithm/raycasting.hpp.


The documentation for this class was generated from the following file:


beluga
Author(s):
autogenerated on Tue Jul 16 2024 02:59:54