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).
 

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.

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.