|
Fang-Robotics-MCB
Fang Robotics Team Codebase
|
Classes | |
| struct | AbstractKinematicState |
| struct | SecondOrderKinematicState |
Functions | |
| bool | computeTravelTime (const modm::Vector3f &targetPosition, float bulletVelocity, float *travelTime, float *turretPitch, const float pitchAxisOffset) |
| bool | findTargetProjectileIntersection (const AbstractKinematicState &targetInitialState, float bulletVelocity, uint8_t numIterations, float *turretPitch, float *turretYaw, float *projectedTravelTime, const float pitchAxisOffset) |
| bool tap::algorithms::ballistics::computeTravelTime | ( | const modm::Vector3f & | targetPosition, |
| float | bulletVelocity, | ||
| float * | travelTime, | ||
| float * | turretPitch, | ||
| const float | pitchAxisOffset = 0 |
||
| ) |
Computes an iterative numerical approximation of the pitch angle to aim the turret in order to hit a given target and the time it will take for that target to be hit, given the velocity of a bullet out of the turret and the position of the target relative to the turret.
| [in] | targetPosition | The 3D position of a target in m. Frame requirements: RELATIVE TO PROJECTILE RELEASE POSITION, Z IS OPPOSITE TO GRAVITY. |
| [in] | bulletVelocity | The velocity of the projectile to be fired in m/s. |
| [out] | travelTime | The expected travel time of a turret shot to hit a target from this object's position. |
| [out] | turretPitch | The pitch angle of the turret to hit the target at the given travel time. |
| [in] | pitchAxisOffset | The distance between the pitch and yaw axes (in meters) as seen from a plane parallel to the ground. A positive offset indicates that the pitch axis is located behind the yaw axis. |
| bool tap::algorithms::ballistics::findTargetProjectileIntersection | ( | const AbstractKinematicState & | targetInitialState, |
| float | bulletVelocity, | ||
| uint8_t | numIterations, | ||
| float * | turretPitch, | ||
| float * | turretYaw, | ||
| float * | projectedTravelTime, | ||
| const float | pitchAxisOffset = 0 |
||
| ) |
| [in] | targetInitialState | The initial 3D kinematic state of a target. Frame requirements: RELATIVE TO PROJECTILE RELEASE POSITION, Z IS OPPOSITE TO GRAVITY. |
| [in] | bulletVelocity | The velocity of the projectile to be fired in m/s. |
| [in] | numIterations | The number of times to project the kinematics forward. Guidelines on choosing this parameter:
|
| [out] | turretPitch | The world-relative turret pitch (in radians above level) at which our robot should aim to hit the given target, taking into account the path a projectile takes to hit the target. |
| [out] | turretYaw | Analogue of turret pitch |
| [out] | projectedTravelTime | The expected time between projectile launch and impact with the target, in seconds. |
| [in] | pitchAxisOffset | The distance between the pitch and yaw axes (in meters) as seen from a plane parallel to the ground. A positive offset indicates that the pitch axis is located behind the yaw axis. |