23 nh.
param(this_node::getName() +
"/loop_rate", loop_rate, 5.0);
25 nh.
param(this_node::getName() +
"/queue_size", queue_size, 10);
27 nh.
param(this_node::getName() +
"/tracking_timeout", timeout, 5.0);
33 ROS_INFO(
"Added target %d in state %d",
id, state);
58 ROS_INFO(
"Target %d: tracked --> lost",
id);
60 ROS_INFO(
"Target %d: assigned --> lost",
id);
96 ROS_DEBUG(
"Target %d: assigned --> done",
id);
102 nh.
getParam(this_node::getNamespace() +
"/targets_done", done);
104 nh.
setParam(this_node::getNamespace() +
"/targets_done", done);
114 ROS_DEBUG(
"Target %d: tracked, update",
id);
124 ROS_DEBUG(
"Target %d: tracked --> assigned",
id);
138 ROS_DEBUG(
"Target %d: known --> tracked, position (%.2f,%.2f)",
id, pose.position.x, pose.position.y);
148 ROS_DEBUG(
"Target %d: known --> assigned",
id);
157 ROS_DEBUG(
"Target %d: known --> lost",
id);
177 ROS_DEBUG(
"Target %d: lost --> known",
id);
182 ROS_DEBUG(
"Target %d: lost --> tracked",
id);
189 ROS_ERROR(
"Target %d: invalid state transition %d --> %d!",
id, this->state, state);
~target()
Destructor that destroys all objects.
int id
The ID of this target. Negative IDs are invalid.
Time stamp
Time stamp of latest update of the target.
Duration timeout
The time in seconds after which a target transitions into the state TARGET_LOST when no target update...
void update(target_state_t state, geometry_msgs::Pose pose, Time stamp)
Update the information about a target.
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
target_state_t state
State of the target.
bool lost()
Check whether the target tracked by this CPS has been lost. Switch state from TARGET_TRACKED to TARGE...
geometry_msgs::Pose get_pose()
Get the position of the target.
void operator=(const target &t)
Assignment operator.
geometry_msgs::Pose pose
Position of the target.
A target that is monitored by the CPSs.
bool getParam(const std::string &key, std::string &s) const
target_state_t get_state()
Get the state of the target.
Rate * rate
The loop rate object for running the behavior control loops at a specific frequency.
target_state_t
An enumeration for the state of a target.
NodeHandle nh
A node handle for the main ROS node.
void setParam(const std::string &key, const XmlRpc::XmlRpcValue &v) const