|
blah2
A real-time passive radar
|
A class to store track data. More...
#include <Track.h>

Public Member Functions | |
| Track () | |
| Constructor. More... | |
| ~Track () | |
| Destructor. More... | |
| std::string | uint2hex (uint64_t number) |
| Convert an unsigned int to hexadecimal. More... | |
| void | set_state (uint64_t index, std::string state) |
| Set the state of the latest tracklet. More... | |
| void | set_current (uint64_t index, Detection smoothed) |
| Set the current track position. More... | |
| void | set_acceleration (uint64_t index, double acceleration) |
| Set the current acceleration. More... | |
| void | set_nInactive (uint64_t index, uint64_t n) |
| Set the current inactivity. More... | |
| uint64_t | get_nState (std::string state) |
| Get number of tracks with specified state. More... | |
| uint64_t | get_n () |
| Get number of total tracks. More... | |
| Detection | get_current (uint64_t index) |
| Get current track position for track index. More... | |
| double | get_acceleration (uint64_t index) |
| Get current acceleration for track index. More... | |
| std::string | get_state (uint64_t index) |
| Get current state for track index. More... | |
| uint64_t | get_nInactive (uint64_t index) |
| Get number of updates track has been tentative/coasting. More... | |
| void | update (uint64_t index, Detection update) |
| Update an associated detection. More... | |
| uint64_t | add (Detection initial) |
| Add track to the track set. More... | |
| void | promote (uint64_t index, uint32_t m, uint32_t n) |
| Promote track to state ACTIVE if applicable. More... | |
| void | remove (uint64_t index) |
| Remove track based on index. More... | |
| std::string | to_json (uint64_t timestamp) |
| Generate JSON of the map and metadata. More... | |
| bool | save (std::string json, std::string path) |
| Append the map to a save file. More... | |
Private Attributes | |
| std::vector< std::string > | id |
| Track ID (4 digit alpha-numeric). More... | |
| std::vector< std::vector< std::string > > | state |
| State history for each track. More... | |
| std::vector< Detection > | current |
| Curent track position. More... | |
| std::vector< double > | acceleration |
| Current acceleration (Hz/s). More... | |
| std::vector< std::vector< Detection > > | associated |
| Associated detections in track. More... | |
| std::vector< uint64_t > | nInactive |
| Number of updates the track has been tentative/coasting. More... | |
| uint64_t | iNext |
| Next valid track index. More... | |
Static Private Attributes | |
| static const uint64_t | MAX_INDEX = 65535 |
| Maximum integer index to wrap around. More... | |
| static const std::string | STATE_ACTIVE = "ACTIVE" |
| String for state ACTIVE. More... | |
| static const std::string | STATE_TENTATIVE = "TENTATIVE" |
| String for state TENTATIVE. More... | |
| static const std::string | STATE_COASTING = "COASTING" |
| String for state COASTING. More... | |
| static const std::string | STATE_ASSOCIATED = "ASSOCIATED" |
| String for state ASSOCIATED. More... | |
A class to store track data.
The ID is 4 digit hexadecimal with 16^4 = 65536 combinations.
The state can be TENTATIVE, ASSOCIATED, ACTIVE or COASTING.
Current track is used for smoothing output.
| Track::Track | ( | ) |
Constructor.
| Track::~Track | ( | ) |
Destructor.
| uint64_t Track::add | ( | Detection | initial | ) |
Add track to the track set.
| initial | Initial Detection. |
ID is incremented automatically.
Initial state is always TENTATIVE.
| double Track::get_acceleration | ( | uint64_t | index | ) |
Get current acceleration for track index.
| Detection Track::get_current | ( | uint64_t | index | ) |
Get current track position for track index.
| uint64_t Track::get_n | ( | ) |
Get number of total tracks.
| uint64_t Track::get_nInactive | ( | uint64_t | index | ) |
Get number of updates track has been tentative/coasting.
| uint64_t Track::get_nState | ( | std::string | state | ) |
Get number of tracks with specified state.
| state | State to check. |
| std::string Track::get_state | ( | uint64_t | index | ) |
Get current state for track index.
| void Track::promote | ( | uint64_t | index, |
| uint32_t | m, | ||
| uint32_t | n | ||
| ) |
Promote track to state ACTIVE if applicable.
Uses M of N rule for ACTIVE tracks.
| index | Index of track to change. |
| void Track::remove | ( | uint64_t | index | ) |
Remove track based on index.
| index | Index of track to remove. |
| bool Track::save | ( | std::string | json, |
| std::string | path | ||
| ) |
Append the map to a save file.
| json | JSON string of map and metadata. |
| path | Path of file to save. |
| void Track::set_acceleration | ( | uint64_t | index, |
| double | acceleration | ||
| ) |
Set the current acceleration.
| index | Index of track to change. |
| acceleration | Updated acceleration. |
| void Track::set_current | ( | uint64_t | index, |
| Detection | smoothed | ||
| ) |
Set the current track position.
Use to update smoothed current position.
| index | Index of track to change. |
| smoothed | Updated state. |
| void Track::set_nInactive | ( | uint64_t | index, |
| uint64_t | n | ||
| ) |
Set the current inactivity.
| index | Index of track to change. |
| n | Updated inactivity index. |
| void Track::set_state | ( | uint64_t | index, |
| std::string | state | ||
| ) |
Set the state of the latest tracklet.
| index | Index of track to change. |
| state | Updated state. |
| std::string Track::to_json | ( | uint64_t | timestamp | ) |
Generate JSON of the map and metadata.
| timestamp | Current time (POSIX ms). |
| std::string Track::uint2hex | ( | uint64_t | number | ) |
Convert an unsigned int to hexadecimal.
Max number is 16^4 = 65536 before wrap around.
| number | Number to convert to hexadecimal. |
| void Track::update | ( | uint64_t | index, |
| Detection | update | ||
| ) |
Update an associated detection.
| index | Index of track to change. |
| update | New associated detection. |
|
private |
Current acceleration (Hz/s).
|
private |
Associated detections in track.
|
private |
Curent track position.
|
private |
Track ID (4 digit alpha-numeric).
|
private |
Next valid track index.
|
staticprivate |
Maximum integer index to wrap around.
|
private |
Number of updates the track has been tentative/coasting.
Forms criteria for track deletion.
|
private |
State history for each track.
|
staticprivate |
String for state ACTIVE.
|
staticprivate |
String for state ASSOCIATED.
|
staticprivate |
String for state COASTING.
|
staticprivate |
String for state TENTATIVE.