Integrated turret + flywheel + carried-ball simulator for aiming, pickup, and firing flows.
More...
#include <turret_shooter_sim.hpp>
|
| struct | Config |
| | Configuration for differential kinematics, ball model, and local mount geometry. More...
|
Integrated turret + flywheel + carried-ball simulator for aiming, pickup, and firing flows.
◆ TurretFlywheelSim() [1/2]
| frcsim::TurretFlywheelSim::TurretFlywheelSim |
( |
| ) |
|
|
default |
◆ TurretFlywheelSim() [2/2]
| frcsim::TurretFlywheelSim::TurretFlywheelSim |
( |
const Config & | config | ) |
|
|
inlineexplicit |
Constructs simulator from explicit configuration.
- Parameters
-
| config | Initial turret/flywheel/ball configuration. |
◆ applyAim()
| bool frcsim::TurretFlywheelSim::applyAim |
( |
double | yaw_rad, |
|
|
double | pitch_rad, |
|
|
double | yaw_velocity_radps = 0.0, |
|
|
double | pitch_velocity_radps = 0.0 ) |
|
inline |
Applies desired aim by solving and storing motor state.
- Parameters
-
| yaw_rad | Desired yaw angle in radians. |
| pitch_rad | Desired pitch angle in radians. |
| yaw_velocity_radps | Desired yaw rate in rad/s. |
| pitch_velocity_radps | Desired pitch rate in rad/s. |
- Returns
- True when inverse solve succeeded.
◆ ball() [1/2]
Mutable access to internal ball simulator.
◆ ball() [2/2]
Immutable access to internal ball simulator.
◆ config()
| const Config & frcsim::TurretFlywheelSim::config |
( |
| ) |
const |
|
inline |
Returns current simulator configuration.
- Returns
- Immutable config reference.
◆ intakePositionWorld()
| Vector3 frcsim::TurretFlywheelSim::intakePositionWorld |
( |
| ) |
const |
|
inline |
Computes current intake center position in world coordinates.
- Returns
- World position of the intake center in meters.
◆ jointState()
Computes current turret joint state from motor state.
- Returns
- JointState with yaw/pitch and rates.
◆ motorState()
Returns current differential motor state.
- Returns
- Immutable motor state reference.
◆ muzzleDirectionWorld()
| Vector3 frcsim::TurretFlywheelSim::muzzleDirectionWorld |
( |
| ) |
const |
|
inline |
Computes the muzzle forward firing direction in world frame.
- Returns
- Normalized unit direction vector for projectile launch.
◆ muzzlePositionWorld()
| Vector3 frcsim::TurretFlywheelSim::muzzlePositionWorld |
( |
| ) |
const |
|
inline |
Computes current muzzle origin in world coordinates.
- Returns
- World position of the muzzle in meters.
◆ pickupBallNearby()
| bool frcsim::TurretFlywheelSim::pickupBallNearby |
( |
| ) |
|
|
inline |
Attempts to pick up the internal ball if near intake location.
- Returns
- True if pickup succeeds.
◆ setBaseVelocity()
| void frcsim::TurretFlywheelSim::setBaseVelocity |
( |
const Vector3 & | base_velocity_mps | ) |
|
|
inline |
Sets base/chassis linear velocity used during carry and shot composition.
- Parameters
-
| base_velocity_mps | World velocity. |
◆ setMotorState()
Sets differential motor state directly.
- Parameters
-
| motor_state | Motor positions/velocities. |
◆ setTurretMountPosition()
| void frcsim::TurretFlywheelSim::setTurretMountPosition |
( |
const Vector3 & | mount_position_m | ) |
|
|
inline |
Updates turret mount origin in world frame.
- Parameters
-
| mount_position_m | Mount position in meters. |
◆ shoot()
| void frcsim::TurretFlywheelSim::shoot |
( |
double | muzzle_speed_mps, |
|
|
const Vector3 & | spin_radps = Vector3::zero() ) |
|
inline |
Fires the ball using an explicit muzzle speed.
- Parameters
-
| muzzle_speed_mps | Launch speed in m/s. |
| spin_radps | Launch spin vector in rad/s. |
◆ shootWithWheel()
Fires the ball using wheel-estimated exit velocity.
- Parameters
-
| wheel | Flywheel wheel model used for speed estimate. |
| spin_radps | Launch spin vector in rad/s. |
◆ solveMotorStateForAim()
Solves inverse differential mapping for desired aim state.
- Parameters
-
| yaw_rad | Desired yaw angle in radians. |
| pitch_rad | Desired pitch angle in radians. |
| yaw_velocity_radps | Desired yaw rate in rad/s. |
| pitch_velocity_radps | Desired pitch rate in rad/s. |
- Returns
- InverseResult containing motor command and validity flag.
◆ step()
| void frcsim::TurretFlywheelSim::step |
( |
double | dt_s | ) |
|
|
inline |
Advances carry/ball simulation one step.
- Parameters
-
The documentation for this class was generated from the following file: