Class Target
Represents a target in the system. More...
#include <target.h>
Public Attributes
| Type | Name |
|---|---|
| uint32_t | id = 0 |
| uint8_t | index = 0 |
| TimePoint | last_action |
| TimePoint | seen |
| bool | valid = false |
Public Functions
| Type | Name |
|---|---|
| fixed | Distance () |
| void | IncrementAction () Increments the action counter by updating the last action timestamp. |
| const PositionVector | InterceptAimpoint () |
| fixed | Pitch () |
| const PositionVector | Position () const Gets the position of the target. |
| PositionVector | PredictedPositionAtTime (ChronoDuration auto interval) Predicts the target's position at a future time. |
| Target () = default |
|
| Target (const Target & other) = default |
|
| Target (PositionVector P, VelocityVector V=VelocityVector(0, 0, 0)) Constructs a Target with a given position and velocity. |
|
| Target (uint8_t index, bool valid=false, PositionVector P=PositionVector(0, 0, 0), VelocityVector V=VelocityVector(0, 0, 0)) Constructs a Target with an index, validity, position, and velocity. |
|
| void | Update (PositionVector P) Updates the target's state with a new position measurement. |
| const VelocityVector | Velocity () const Gets the velocity of the target. |
| fixed | Yaw () |
| bool | actionIdleExceeds (const ChronoDuration auto limit) const |
| bool | actionable () const |
| bool | idleExceeds (const ChronoDuration auto limit) const |
| TimeInterval | timeSinceLastAction () const Calculates the time elapsed since the last action was performed on this target. |
| TimeInterval | timeSinceLastSeen () const Calculates the time elapsed since the target was last seen. |
Detailed Description
This class stores all relevant information about a target, including its position, velocity, and timing information. It also provides methods for predicting future positions and calculating intercept points.
Public Attributes Documentation
variable id
uint32_t Target::id;
variable index
uint8_t Target::index;
variable last_action
TimePoint Target::last_action;
variable seen
TimePoint Target::seen;
variable valid
bool Target::valid;
Public Functions Documentation
function Distance
inline fixed Target::Distance ()
function IncrementAction
Increments the action counter by updating the last action timestamp.
inline void Target::IncrementAction ()
function InterceptAimpoint
inline const PositionVector Target::InterceptAimpoint ()
function Pitch
fixed Target::Pitch ()
function Position
Gets the position of the target.
inline const PositionVector Target::Position () const
Returns:
The position vector.
function PredictedPositionAtTime
Predicts the target's position at a future time.
inline PositionVector Target::PredictedPositionAtTime (
ChronoDuration auto interval
)
Parameters:
intervalThe time interval for the prediction.
Returns:
The predicted position vector.
function Target [1/4]
Target::Target () = default
function Target [2/4]
Target::Target (
const Target & other
) = default
function Target [3/4]
Constructs a Target with a given position and velocity.
inline Target::Target (
PositionVector P,
VelocityVector V=VelocityVector (0, 0, 0)
)
Parameters:
PThe position vector.VThe velocity vector.
function Target [4/4]
Constructs a Target with an index, validity, position, and velocity.
inline Target::Target (
uint8_t index,
bool valid=false,
PositionVector P=PositionVector (0, 0, 0),
VelocityVector V=VelocityVector (0, 0, 0)
)
Parameters:
indexThe index of the target.validThe validity of the target.PThe position vector.VThe velocity vector.
function Update
Updates the target's state with a new position measurement.
void Target::Update (
PositionVector P
)
This method recalculates the target's velocity based on the change in position and time since the last update. It also updates the seen and position history.
Parameters:
PThe new position vector.
function Velocity
Gets the velocity of the target.
inline const VelocityVector Target::Velocity () const
Returns:
The velocity vector.
function Yaw
fixed Target::Yaw ()
function actionIdleExceeds
inline bool Target::actionIdleExceeds (
const ChronoDuration auto limit
) const
function actionable
inline bool Target::actionable () const
function idleExceeds
inline bool Target::idleExceeds (
const ChronoDuration auto limit
) const
function timeSinceLastAction
Calculates the time elapsed since the last action was performed on this target.
inline TimeInterval Target::timeSinceLastAction () const
Returns:
The time interval since the last action.
function timeSinceLastSeen
Calculates the time elapsed since the target was last seen.
inline TimeInterval Target::timeSinceLastSeen () const
Returns:
The time interval since the last sighting.
The documentation for this class was generated from the following file target.h