tracking.hpp
Go to the documentation of this file.
1 /*
2  * ar_marker_processor.hpp
3  *
4  * LICENSE : BSD - https://raw.github.com/yujinrobot/yujin_ocs/license/LICENSE
5  *
6  * Created on: Apr 6, 2013
7  * Author: jorge
8  * Modified on: Dec, 2013
9  * Jihoon Lee
10  *
11  */
12 
13 #ifndef AR_PAIR_TRACKING_HPP_
14 #define AR_PAIR_TRACKING_HPP_
15 
16 /*****************************************************************************
17 ** Includes
18 *****************************************************************************/
19 
20 #include <ros/ros.h>
21 #include <tf/tf.h>
22 #include <tf/transform_listener.h>
26 #include <ar_track_alvar_msgs/AlvarMarkers.h>
28 #include <yocs_msgs/ARPair.h>
29 #include <yocs_msgs/ARPairList.h>
30 
31 /*****************************************************************************
32 ** Namespaces
33 *****************************************************************************/
34 
35 namespace yocs
36 {
37 
38 namespace ARPairTrackingDefaultParams
39 {
40  const int AR_PAIR_LEFT_ID = 3;
41  const int AR_PAIR_RIGHT_ID = 0;
42  const double AR_PAIR_BASELINE = 0.26;
43  const double AR_PAIR_TARGET_POSE_OFFSET = 0.40;
44 
45  const bool PUBLISH_TRANSFORMS = true;
46  const std::string PUB_RELATIVE_TARGET_POSE = "relative_target_pose";
47  const std::string PUB_INITIAL_POSE = "initial_pose";
48  const std::string PUB_SPOTTED_MARKERS = "spotted_markers";
49  const std::string SUB_UPDATE_AR_PAIRS = "update_ar_pairs";
50  const std::string GLOBAL_FRAME = "ar_global";
51  const std::string MARKER_FRAME = "camera_rgb_optical_frame";
52  const std::string BASE_FRAME = "base_footprint";
53  const std::string TARGET_POSE_FRAME = "target_pose";
54 }
55 
56 /*****************************************************************************
57 ** Classes
58 *****************************************************************************/
59 
61 {
62  public:
63 
65  virtual ~ARPairTracking();
66 
67  bool init();
68  void addPair(const yocs_msgs::ARPair& p);
69 
70  protected:
71  // raw list of ar markers from ar_alvar_track pkg
72  void customCB(const ar_track_alvar_msgs::AlvarMarkers& spotted_markers, const std::vector<TrackedMarker> &tracked_markers);
73  bool spotMarkerPair(const ar_track_alvar_msgs::AlvarMarkers& spotted_markers, const yocs_msgs::ARPair& pair, ar_track_alvar_msgs::AlvarMarker& left, ar_track_alvar_msgs::AlvarMarker& right);
74  void computeRelativeRobotPose(const yocs_msgs::ARPair& spotted_pair, const std::vector<TrackedMarker>& tracked_markers, const ar_track_alvar_msgs::AlvarMarker& left, const ar_track_alvar_msgs::AlvarMarker& right);
75 
76  void updateARPairsCB(const yocs_msgs::ARPairList::ConstPtr& msg);
77 
78  private:
79  // Confidence evaluation attributes
80 
81  ros::Publisher pub_relative_target_pose_, pub_initial_pose_, pub_spotted_markers_;
83 
87 // double tf_broadcast_freq_; /**< Allows enabling tf broadcasting; mostly for debug */
88 
89  std::vector<yocs_msgs::ARPair> ar_pairs_;
91 
92  std::string global_frame_;
93  std::string marker_frame_;
94  std::string base_frame_;
95  std::string target_pose_frame_;
96 };
97 
98 } /* namespace yocs */
99 
100 #endif /* AR_MARKERS_HPP_ */
const double AR_PAIR_TARGET_POSE_OFFSET
Definition: tracking.hpp:43
std::string marker_frame_
Definition: tracking.hpp:93
const std::string TARGET_POSE_FRAME
Definition: tracking.hpp:53
const std::string PUB_RELATIVE_TARGET_POSE
Definition: tracking.hpp:46
ros::Subscriber sub_update_ar_pairs_
Definition: tracking.hpp:82
std::string target_pose_frame_
Definition: tracking.hpp:95
std::vector< yocs_msgs::ARPair > ar_pairs_
Definition: tracking.hpp:89
const std::string BASE_FRAME
Definition: tracking.hpp:52
const std::string MARKER_FRAME
Definition: tracking.hpp:51
std::string base_frame_
Definition: tracking.hpp:94
tf::TransformBroadcaster tf_brcaster_
Definition: tracking.hpp:86
tf::TransformListener tf_listener_
Definition: tracking.hpp:85
const std::string PUB_INITIAL_POSE
Definition: tracking.hpp:47
std::string global_frame_
Definition: tracking.hpp:92
tf::Transformer tf_internal_
Definition: tracking.hpp:84
const std::string SUB_UPDATE_AR_PAIRS
Definition: tracking.hpp:49
const std::string GLOBAL_FRAME
Definition: tracking.hpp:50
ros::Publisher pub_spotted_markers_
Definition: tracking.hpp:81
const std::string PUB_SPOTTED_MARKERS
Definition: tracking.hpp:48


yocs_ar_pair_tracking
Author(s): Daniel Stonier, Jihoon Lee, Jorge Santos Simon
autogenerated on Mon Jun 10 2019 15:53:47