Function tap::algorithms::ballistics::findTargetProjectileIntersection
Defined in File ballistics.cpp
Function Documentation
-
bool tap::algorithms::ballistics::findTargetProjectileIntersection(const AbstractKinematicState &targetInitialState, float bulletVelocity, uint8_t numIterations, float *turretPitch, float *turretYaw, float *projectedTravelTime, const float pitchAxisOffset)
- Parameters:
targetInitialState – [in] The initial 3D kinematic state of a target. Frame requirements: RELATIVE TO PROJECTILE RELEASE POSITION, Z IS OPPOSITE TO GRAVITY.
bulletVelocity – [in] The velocity of the projectile to be fired in m/s.
numIterations – [in] The number of times to project the kinematics forward. Guidelines on choosing this parameter:
If the target is moving very slow relative to bulletVelocity, 1 is probably enough.
For higher target speeds, 2-3 is probably a good estimate.
If the target is approaching the projectile speed, this algorithm may have a difficult time converging (but it may be possible with enough iterations).
If the target is moving faster than the projectile, this algorithm will diverge.
turretPitch – [out] 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.
turretYaw – [out] Analogue of turret pitch
projectedTravelTime – [out] The expected time between projectile launch and impact with the target, in seconds.
pitchAxisOffset – [in] 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.
- Returns:
Whether or not a valid aiming solution was found. Out parameters only valid if true.