13 #ifndef AR_MARKER_PROCESSOR_HPP_ 14 #define AR_MARKER_PROCESSOR_HPP_ 21 #include <geometry_msgs/PoseWithCovarianceStamped.h> 22 #include <ar_track_alvar_msgs/AlvarMarkers.h> 26 typedef std::list<geometry_msgs::PoseStamped>
ObsList;
28 namespace ARMarkerTrackingDefaultParams {
67 const geometry_msgs::PoseStamped&
lastObservation()
const {
return obs_list_.back(); }
89 template <
typename OutputStream>
93 template <
typename OutputStream>
98 const geometry_msgs::PoseStamped& last_observation = marker.
lastObservation();
99 ostream <<
" Observation\n";
100 ostream <<
" Timestamp: " << last_observation.header.stamp.toNSec() <<
"\n";
101 const geometry_msgs::Pose& pose = last_observation.pose;
102 ostream <<
" x, y, z : [" << pose.position.x <<
"," << pose.position.y <<
"," << pose.position.z <<
"]\n";
104 ostream <<
" Distance : " << marker.
distance <<
"\n";
105 ostream <<
" Distance2d : " << marker.
distance2d <<
"\n";
106 ostream <<
" Heading : " << marker.
heading <<
"\n";
107 ostream <<
" Confidence : " << marker.
confidence <<
"\n";
109 ostream <<
" Conf Head : " << marker.
conf_heading<<
"\n";
110 ostream <<
" Persistence: " << marker.
persistence <<
"\n";
111 ostream <<
" Stability : " << marker.
stability <<
"\n";
135 void arPoseMarkersCB(
const ar_track_alvar_msgs::AlvarMarkers::ConstPtr& msg);
136 virtual void customCB(
const ar_track_alvar_msgs::AlvarMarkers& spotted_markers,
const std::vector<TrackedMarker> &tracked_markers) {}
137 void maintainTrackedMarkers(
const ar_track_alvar_msgs::AlvarMarkers::ConstPtr& msg,std::vector<TrackedMarker>& tracked_markers);
138 void maintainTrackedMarker(
TrackedMarker& marker,
const ar_track_alvar_msgs::AlvarMarker& msgMarker,
const int obs_list_max_size,
const double max_valid_d_inc,
const double max_valid_h_inc);
149 bool spotted(
double younger_than,
double min_confidence, ar_track_alvar_msgs::AlvarMarkers& spotted_markers);
150 bool closest(
double younger_than,
double min_confidence, ar_track_alvar_msgs::AlvarMarker& closest_marker);
151 bool spotted(
double younger_than,
const ar_track_alvar_msgs::AlvarMarkers& including,
const ar_track_alvar_msgs::AlvarMarkers& excluding, ar_track_alvar_msgs::AlvarMarkers& spotted_markers);
152 bool closest(
const ar_track_alvar_msgs::AlvarMarkers& including,
const ar_track_alvar_msgs::AlvarMarkers& excluding, ar_track_alvar_msgs::AlvarMarker& closest_marker);
154 bool spotted(
double younger_than,
double min_confidence, ar_track_alvar_msgs::AlvarMarkers& excluding, ar_track_alvar_msgs::AlvarMarkers& spotted);
155 bool closest(
double younger_than,
double min_confidence, ar_track_alvar_msgs::AlvarMarkers& excluding, ar_track_alvar_msgs::AlvarMarker& closest_marker);
158 bool included(
const uint32_t
id,
const ar_track_alvar_msgs::AlvarMarkers& v, ar_track_alvar_msgs::AlvarMarker* e = NULL);
161 bool excluded(
const uint32_t
id,
const ar_track_alvar_msgs::AlvarMarkers& v);
const std::string PUB_ROBOT_POSE_AR
ar_track_alvar_msgs::AlvarMarkers spotted_markers_
const double MAX_RELIABLE_HEAD
const double MAX_VALID_H_INC
const double AR_TRACKER_FREQ
std::vector< TrackedMarker > tracked_markers_
double max_reliable_head_
TFSIMD_FORCE_INLINE tfScalar distance(const Vector3 &v) const
double min_penalized_dist_
const geometry_msgs::PoseStamped & lastObservation() const
const std::string SUB_AR_MARKERS
const uint32_t MARKERS_COUNT
const double MAX_VALID_D_INC
double max_reliable_dist_
unsigned int numberOfObservations() const
OutputStream & operator<<(OutputStream &ostream, const TrackedMarker &marker)
const double MIN_PENALIZED_DIST
const double MAX_RELIABLE_DIST
const double MAX_TRACKING_TIME
ros::Subscriber sub_ar_markers_
virtual void customCB(const ar_track_alvar_msgs::AlvarMarkers &spotted_markers, const std::vector< TrackedMarker > &tracked_markers)
double max_tracking_time_
const double MIN_PENALIZED_HEAD
double min_penalized_head_
double heading(geometry_msgs::Point p)
std::list< geometry_msgs::PoseStamped > ObsList