Aikido
PoseEstimatorModule.hpp
Go to the documentation of this file.
1 #ifndef AIKIDO_PERCEPTION_POSEESTIMATORMODULE_HPP_
2 #define AIKIDO_PERCEPTION_POSEESTIMATORMODULE_HPP_
3 
4 #include <string>
5 
6 #include <dart/dart.hpp>
7 #include <tf/transform_listener.h>
8 
10 #include "aikido/io/yaml.hpp"
14 
15 namespace aikido {
16 namespace perception {
17 
27 {
28 public:
46  ros::NodeHandle nodeHandle,
47  const std::string& markerTopic,
48  std::shared_ptr<AssetDatabase> assetData,
49  std::shared_ptr<aikido::io::CatkinResourceRetriever> resourceRetriever,
50  const std::string& referenceFrameId,
51  dart::dynamics::Frame* referenceLink);
52 
53  virtual ~PoseEstimatorModule() = default;
54 
61  bool detectObjects(
62  const aikido::planner::WorldPtr& env,
63  ros::Duration timeout = ros::Duration(),
64  ros::Time timestamp = ros::Time(0.0),
65  std::vector<DetectedObject>* detectedObjects = nullptr) override;
66 
67 private:
69  ros::NodeHandle mNodeHandle;
70 
72  std::string mMarkerTopic;
73 
75  std::shared_ptr<AssetDatabase> mAssetData;
76 
78  std::shared_ptr<aikido::io::CatkinResourceRetriever> mResourceRetriever;
79 
81  std::string mReferenceFrameId;
82 
84  dart::dynamics::Frame* mReferenceLink;
85 
87  tf::TransformListener mTfListener;
88 };
89 
90 } // namespace perception
91 } // namespace aikido
92 
93 #endif // AIKIDO_PERCEPTION_POSEESTIMATORMODULE_HPP_
aikido::perception::PerceptionModule
The interface for the generic perception module.
Definition: PerceptionModule.hpp:16
aikido::perception::PoseEstimatorModule::mTfListener
tf::TransformListener mTfListener
Listens to the transform attached to the node.
Definition: PoseEstimatorModule.hpp:87
aikido::perception::PoseEstimatorModule::detectObjects
bool detectObjects(const aikido::planner::WorldPtr &env, ros::Duration timeout=ros::Duration(), ros::Time timestamp=ros::Time(0.0), std::vector< DetectedObject > *detectedObjects=nullptr) override
Run the specific detector via a service call or ROS message reception, lookup the transform between t...
aikido
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
aikido::perception::PoseEstimatorModule::mNodeHandle
ros::NodeHandle mNodeHandle
For the ROS node that will work with the April Tags module.
Definition: PoseEstimatorModule.hpp:69
aikido::perception::PoseEstimatorModule::mReferenceFrameId
std::string mReferenceFrameId
The desired reference frame for the object pose.
Definition: PoseEstimatorModule.hpp:81
aikido::perception::PoseEstimatorModule::mMarkerTopic
std::string mMarkerTopic
The name of the ROS topic to read marker info from.
Definition: PoseEstimatorModule.hpp:72
aikido::perception::PoseEstimatorModule::mResourceRetriever
std::shared_ptr< aikido::io::CatkinResourceRetriever > mResourceRetriever
To retrieve resources from disk and from packages.
Definition: PoseEstimatorModule.hpp:78
aikido::planner::WorldPtr
std::shared_ptr< World > WorldPtr
Definition: World.hpp:14
yaml.hpp
aikido::perception::PoseEstimatorModule::PoseEstimatorModule
PoseEstimatorModule(ros::NodeHandle nodeHandle, const std::string &markerTopic, std::shared_ptr< AssetDatabase > assetData, std::shared_ptr< aikido::io::CatkinResourceRetriever > resourceRetriever, const std::string &referenceFrameId, dart::dynamics::Frame *referenceLink)
Construct a PoseEstimator receiver that subscribes to the specified topic where objects' pose informa...
aikido::perception::PoseEstimatorModule::~PoseEstimatorModule
virtual ~PoseEstimatorModule()=default
aikido::perception::PoseEstimatorModule
Instantiates the PerceptionModule specifically for PoseEstimator.
Definition: PoseEstimatorModule.hpp:26
DetectedObject.hpp
CatkinResourceRetriever.hpp
PerceptionModule.hpp
aikido::perception::PoseEstimatorModule::mAssetData
std::shared_ptr< AssetDatabase > mAssetData
The pointer to the loader of visual asset data.
Definition: PoseEstimatorModule.hpp:75
aikido::perception::PoseEstimatorModule::mReferenceLink
dart::dynamics::Frame * mReferenceLink
The reference frame of HERB to transform with respect to.
Definition: PoseEstimatorModule.hpp:84
AssetDatabase.hpp