33 #include <apriltag_ros/AnalyzeSingleImage.h> 52 int main(
int argc,
char **argv)
54 ros::init(argc, argv,
"apriltag_ros_single_image_client");
61 "single_image_tag_detection");
64 apriltag_ros::AnalyzeSingleImage service;
65 service.request.full_path_where_to_get_image =
66 apriltag_ros::getAprilTagOption<std::string>(
67 pnh,
"image_load_path",
"");
68 if (service.request.full_path_where_to_get_image.empty())
72 service.request.full_path_where_to_save_image =
73 apriltag_ros::getAprilTagOption<std::string>(
74 pnh,
"image_save_path",
"");
75 if (service.request.full_path_where_to_save_image.empty())
82 service.request.camera_info.distortion_model =
"plumb_bob";
83 double fx, fy, cx, cy;
93 service.request.camera_info.K[0] = fx;
94 service.request.camera_info.K[2] = cx;
95 service.request.camera_info.K[4] = fy;
96 service.request.camera_info.K[5] = cy;
97 service.request.camera_info.K[8] = 1.0;
101 if (client.
call(service))
105 if (service.response.tag_detections.detections.size() == 0)
112 ROS_ERROR(
"Failed to call service single_image_tag_detection");
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
bool getRosParameter(ros::NodeHandle &pnh, std::string name, double ¶m)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
bool call(MReq &req, MRes &res)
int main(int argc, char **argv)
#define ROS_WARN_STREAM(args)
#define ROS_INFO_STREAM(args)
bool getParam(const std::string &key, std::string &s) const
bool hasParam(const std::string &key) const
#define ROS_ERROR_STREAM(args)