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

Fixed-map ray caster used by LightCast's sensor model. More...

Go to the source code of this file.

Namespaces

namespace  light
 Initialize once via init(); poll getPose/setPose from any task.
 
namespace  light::field
 

Functions

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).
 
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 light::field::raycast_front (float x, float y, float angleRad, float max_range=FIELD_SIZE_IN)
 
float light::field::raycast_back (float x, float y, float angleRad, float max_range=FIELD_SIZE_IN)
 
float light::field::raycast_left (float x, float y, float angleRad, float max_range=FIELD_SIZE_IN)
 
float light::field::raycast_right (float x, float y, float angleRad, float max_range=FIELD_SIZE_IN)
 

Variables

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

Detailed Description

Fixed-map ray caster used by LightCast's sensor model.

The map is the VRC field perimeter (12 ft × 12 ft axis-aligned box) plus optional static segments. Moving game elements are intentionally NOT mapped: LightCast's outlier rejection handles a ball reading shorter than the wall.

Coordinate frame
Origin at field center, +x right, +y forward, theta CCW from +y (radians). Units are inches.

Definition in file field_map.hpp.