LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
light::field Namespace Reference

Functions

float raycast (float x, float y, float angleRad, float max_range=FIELD_SIZE_IN)
 Cast a ray from (x, y) in direction angleRad (world frame).
 
Per-distance-sensor map hooks

Defined by user code in src/maps/<face>_map.cpp and linked into the cold package via firmware/libmaps.a.

Each face's stub default-delegates to raycast() (the perimeter box) so unfilled stubs match today's behavior.

stick one of these into DistanceSensorSpec.raycastFn (over in odometry.hpp) if a sensor needs a face-specifc map. otherwise leave it null and the particle filter just falls back to the generic perimiter raycast(). sensor_aux always uses plain raycast() since its wall-snap assumes the hit lands on the field perimeter.

float raycast_front (float x, float y, float angleRad, float max_range=FIELD_SIZE_IN)
 
float raycast_back (float x, float y, float angleRad, float max_range=FIELD_SIZE_IN)
 
float raycast_left (float x, float y, float angleRad, float max_range=FIELD_SIZE_IN)
 
float raycast_right (float x, float y, float angleRad, float max_range=FIELD_SIZE_IN)
 

Variables

constexpr float FIELD_SIZE_IN = 144.0f
 Field side length, inches (12 ft).
 
constexpr float FIELD_HALF = FIELD_SIZE_IN / 2.0f
 Half-side, inches.
 

Function Documentation

◆ raycast()

float light::field::raycast ( float  x,
float  y,
float  angleRad,
float  max_range = FIELD_SIZE_IN 
)

Cast a ray from (x, y) in direction angleRad (world frame).

Parameters
xray origin X, inches
yray origin Y, inches
angleRadray direction in world frame, radians
max_rangeclamp the returned distance to this many inches
Returns
distance to nearest obstacle along the ray, never negative. A ray that starts outside the field returns 0.

◆ raycast_back()

float light::field::raycast_back ( float  x,
float  y,
float  angleRad,
float  max_range = FIELD_SIZE_IN 
)

◆ raycast_front()

float light::field::raycast_front ( float  x,
float  y,
float  angleRad,
float  max_range = FIELD_SIZE_IN 
)

◆ raycast_left()

float light::field::raycast_left ( float  x,
float  y,
float  angleRad,
float  max_range = FIELD_SIZE_IN 
)

◆ raycast_right()

float light::field::raycast_right ( float  x,
float  y,
float  angleRad,
float  max_range = FIELD_SIZE_IN 
)

Variable Documentation

◆ FIELD_HALF

constexpr float light::field::FIELD_HALF = FIELD_SIZE_IN / 2.0f
constexpr

Half-side, inches.

Definition at line 21 of file field_map.hpp.

◆ FIELD_SIZE_IN

constexpr float light::field::FIELD_SIZE_IN = 144.0f
constexpr

Field side length, inches (12 ft).

Definition at line 20 of file field_map.hpp.