JSim 2026.06.01-p(1)
Loading...
Searching...
No Matches
frcsim::ShotCalculator3D Class Reference

3D shot solution generator using table interpolation plus optional ballistic refinement. More...

#include <shot_calculator.hpp>

Classes

struct  TablePoint
 Lookup-table row for distance-indexed shot tuning. More...
struct  Config
 Solver configuration for interpolation, refinement, and historical smoothing behavior. More...
struct  ShotParameters
 Output shot command/result packet. More...

Public Member Functions

 ShotCalculator3D ()=default
 ShotCalculator3D (const Config &config)
 Constructs calculator with explicit configuration.
const Configconfig () const
 Returns active sanitized configuration.
void setConfig (const Config &config)
 Replaces configuration after sanitization.
void clearHistory ()
 Clears learned recent-shot history used for contextual blending.
void setLookupTable (std::vector< TablePoint > points)
 Replaces lookup table with validated and distance-sorted points.
const std::vector< TablePoint > & lookupTable () const
 Returns current lookup table.
ShotParameters calculateShot (const Vector3 &flywheel_origin_m, const Vector3 &robot_velocity_mps, const Vector3 &target_position_m, double now_s)
 Computes a shot solution for current robot/target kinematics.

Detailed Description

3D shot solution generator using table interpolation plus optional ballistic refinement.

Constructor & Destructor Documentation

◆ ShotCalculator3D() [1/2]

frcsim::ShotCalculator3D::ShotCalculator3D ( )
default

◆ ShotCalculator3D() [2/2]

frcsim::ShotCalculator3D::ShotCalculator3D ( const Config & config)
inlineexplicit

Constructs calculator with explicit configuration.

Parameters
configInitial calculator configuration.

Member Function Documentation

◆ calculateShot()

ShotParameters frcsim::ShotCalculator3D::calculateShot ( const Vector3 & flywheel_origin_m,
const Vector3 & robot_velocity_mps,
const Vector3 & target_position_m,
double now_s )
inline

Computes a shot solution for current robot/target kinematics.

Parameters
flywheel_origin_mFlywheel origin in world coordinates.
robot_velocity_mpsRobot chassis velocity in world frame.
target_position_mTarget center position in world coordinates.
now_sCurrent timestamp in seconds.
Returns
ShotParameters with validity flag and computed yaw/pitch/speed/time.

◆ clearHistory()

void frcsim::ShotCalculator3D::clearHistory ( )
inline

Clears learned recent-shot history used for contextual blending.

◆ config()

const Config & frcsim::ShotCalculator3D::config ( ) const
inline

Returns active sanitized configuration.

Returns
Immutable config reference.

◆ lookupTable()

const std::vector< TablePoint > & frcsim::ShotCalculator3D::lookupTable ( ) const
inline

Returns current lookup table.

Returns
Immutable vector reference of table points.

◆ setConfig()

void frcsim::ShotCalculator3D::setConfig ( const Config & config)
inline

Replaces configuration after sanitization.

Parameters
configNew configuration.

◆ setLookupTable()

void frcsim::ShotCalculator3D::setLookupTable ( std::vector< TablePoint > points)
inline

Replaces lookup table with validated and distance-sorted points.

Parameters
pointsCandidate table points to ingest.

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