19 #ifndef ARUCO_MARKER_RECOGNITION_H 20 #define ARUCO_MARKER_RECOGNITION_H 23 #include <sensor_msgs/Image.h> 27 #include <opencv2/highgui/highgui.hpp> 28 #include <ivt_bridge/ivt_calibration.h> 29 #include <visualization_msgs/MarkerArray.h> 30 #include <asr_aruco_marker_recognition/GetRecognizer.h> 31 #include <asr_aruco_marker_recognition/ReleaseRecognizer.h> 32 #include <asr_object_database/ObjectMetaData.h> 33 #include <asr_msgs/AsrObject.h> 34 #include <dynamic_reconfigure/server.h> 35 #include <asr_aruco_marker_recognition/ArucoMarkerRecognitionConfig.h> 44 const static std::string
NODE_NAME(
"asr_aruco_marker_recognition");
131 bool processGetRecognizerRequest(GetRecognizer::Request &req, GetRecognizer::Response &res);
139 bool processReleaseRecognizerRequest(ReleaseRecognizer::Request &req, ReleaseRecognizer::Response &res);
148 void imageCallback(
const sensor_msgs::ImageConstPtr& input_img_left,
const sensor_msgs::ImageConstPtr& input_img_right,
const sensor_msgs::CameraInfoConstPtr& cam_info_left,
const sensor_msgs::CameraInfoConstPtr& cam_info_right);
156 void configCallback(ArucoMarkerRecognitionConfig &config_, uint32_t level);
164 cv::Mat drawMarkers(
const cv::Mat &image,
const std::vector<aruco::Marker> &markers);
166 std::map<int, geometry_msgs::Pose> getMarkerPoses(
const std::vector<aruco::Marker> &left_markers);
175 std::map<int, geometry_msgs::Pose> getMarkerPoses(
const std::vector<aruco::Marker> &left_markers,
const std::vector<aruco::Marker> &right_markers,
const ivt_bridge::IvtStereoCalibration &ivtCalib);
185 visualization_msgs::Marker createSquareMarker(
int id,
const geometry_msgs::Pose &pose,
const string &frame_id);
195 visualization_msgs::Marker createArrowMarker(
int id,
const geometry_msgs::Pose &pose,
const string &frame_id,
bool isNsX =
false);
205 visualization_msgs::Marker createMeshMarker(
int id,
const geometry_msgs::Pose &pose,
const std::string &mesh_res,
const string &frame_id);
215 asr_msgs::AsrObject createAsrObject(
const geometry_msgs::Pose &pose,
const std::string &object_type,
const string &frame_id,
const std::string &mesh_res =
"");
ros::Publisher right_markers_img_pub_
MarkerDetection detector_
message_filters::Subscriber< sensor_msgs::Image > image_left_sub_
This is the base class of the marker recognition system used for creating the ros environment and con...
std::string image_left_topic_
message_filters::Subscriber< sensor_msgs::CameraInfo > image_left_param_sub_
This class is used to detect markers in an image using the aruco-library.
message_filters::Subscriber< sensor_msgs::CameraInfo > image_right_param_sub_
std::string recognizer_name_
static const std::string NODE_NAME("asr_aruco_marker_recognition")
std::string image_right_topic_
ros::Publisher vis_markers_pub_
ros::Publisher left_markers_img_pub_
message_filters::Subscriber< sensor_msgs::Image > image_right_sub_
std::string image_right_cam_info_topic_
ros::ServiceServer get_recognizer_service_
boost::shared_ptr< ApproximateSync > sync_policy_
ros::ServiceClient object_mesh_service_client_
std::string image_left_cam_info_topic_
static const std::string GET_RECOGNIZER_SERVICE_NAME("get_recognizer")
ros::Publisher asr_objects_pub_
static const std::string OBJECT_DB_SERVICE_META_DATA("/asr_object_database/object_meta_data")
ros::ServiceServer release_recognizer_service_
dynamic_reconfigure::Server< ArucoMarkerRecognitionConfig > reconfigure_server_
static const std::string RELEASE_RECOGNIZER_SERVICE_NAME("release_recognizer")
ArucoMarkerRecognitionConfig config_
message_filters::Synchronizer< ApproximatePolicy > ApproximateSync
message_filters::sync_policies::ApproximateTime< sensor_msgs::Image, sensor_msgs::Image, sensor_msgs::CameraInfo, sensor_msgs::CameraInfo > ApproximatePolicy
static const double DEFAULT_MARKER_SIZE(0.05)