A collection of target objects that are searched, tracked, and rescued by the CPSs.
More...
#include <targets.h>
|
void | publish (unsigned int id) |
| Publish a target position event for the given target. More...
|
|
void | simulate () |
| Read simulated targets from parameter file. More...
|
|
| targets () |
| Constructor that initializes the private member variables. More...
|
|
void | update (geometry_msgs::Pose pose) |
| Update the state of all targets. If no update has been received for a target within a fixed period, its state will change to TARGET_LOST. This needs to be called periodically. More...
|
|
void | update (cpswarm_msgs::TargetPositionEvent msg, target_state_t state) |
| Update the information of a target. More...
|
|
|
geometry_msgs::Transform | transform (geometry_msgs::Pose p1, geometry_msgs::Pose p2) const |
| Compute the transformation between two poses. More...
|
|
void | uuid_callback (const swarmros::String::ConstPtr &msg) |
| Callback function to receive the UUID from the communication library. More...
|
|
|
string | cps |
| The UUID of the CPS that owns this class instance. More...
|
|
double | fov |
| Range of the target tracking camera in meter. It is used to simulate target detection. Targets within this distance are detected by the CPS. More...
|
|
NodeHandle | nh |
| A node handle for the main ROS node. More...
|
|
unordered_map< unsigned int, shared_ptr< target > > | simulated_targets |
| A map holding ID and target object of simulated targets, including the ones not yet found. More...
|
|
unordered_map< unsigned int, shared_ptr< target > > | target_map |
| A map holding ID and target object of all known targets. More...
|
|
Publisher | tracking_pub |
| Publisher for transmitting target tracking information. More...
|
|
A collection of target objects that are searched, tracked, and rescued by the CPSs.
Definition at line 15 of file targets.h.
◆ targets()
Constructor that initializes the private member variables.
Definition at line 3 of file targets.cpp.
◆ publish()
void targets::publish |
( |
unsigned int |
id | ) |
|
Publish a target position event for the given target.
- Parameters
-
◆ simulate()
void targets::simulate |
( |
| ) |
|
Read simulated targets from parameter file.
Definition at line 34 of file targets.cpp.
◆ transform()
geometry_msgs::Transform targets::transform |
( |
geometry_msgs::Pose |
p1, |
|
|
geometry_msgs::Pose |
p2 |
|
) |
| const |
|
private |
Compute the transformation between two poses.
- Parameters
-
p1 | The first pose. |
p2 | The second pose. |
- Returns
- The computed transformation.
Definition at line 103 of file targets.cpp.
◆ update() [1/2]
void targets::update |
( |
geometry_msgs::Pose |
pose | ) |
|
Update the state of all targets. If no update has been received for a target within a fixed period, its state will change to TARGET_LOST. This needs to be called periodically.
- Parameters
-
pose | The current position of the CPS. |
Definition at line 57 of file targets.cpp.
◆ update() [2/2]
void targets::update |
( |
cpswarm_msgs::TargetPositionEvent |
msg, |
|
|
target_state_t |
state |
|
) |
| |
Update the information of a target.
- Parameters
-
msg | The target position event message. |
state | The target state. |
Definition at line 84 of file targets.cpp.
◆ uuid_callback()
void targets::uuid_callback |
( |
const swarmros::String::ConstPtr & |
msg | ) |
|
|
private |
Callback function to receive the UUID from the communication library.
- Parameters
-
Definition at line 133 of file targets.cpp.
◆ cps
The UUID of the CPS that owns this class instance.
Definition at line 86 of file targets.h.
◆ fov
Range of the target tracking camera in meter. It is used to simulate target detection. Targets within this distance are detected by the CPS.
Definition at line 91 of file targets.h.
◆ nh
A node handle for the main ROS node.
Definition at line 66 of file targets.h.
◆ simulated_targets
unordered_map<unsigned int, shared_ptr<target> > targets::simulated_targets |
|
private |
A map holding ID and target object of simulated targets, including the ones not yet found.
Definition at line 81 of file targets.h.
◆ target_map
unordered_map<unsigned int, shared_ptr<target> > targets::target_map |
|
private |
A map holding ID and target object of all known targets.
Definition at line 76 of file targets.h.
◆ tracking_pub
Publisher targets::tracking_pub |
|
private |
Publisher for transmitting target tracking information.
Definition at line 71 of file targets.h.
The documentation for this class was generated from the following files: