How to get pose from april tag topic tag_detection?
Hi, Currently, I have a bag file which publishes the /tag_detections coming from apriltag node. I'm having trouble in writing a callback function which could extract information like pose from the topic.
The details of the topic are:
rosmsg show apriltag_ros/AprilTagDetectionArray
std_msgs/Header header
uint32 seq
time stamp
string frame_id
apriltag_ros/AprilTagDetection[] detections
int32[] id
float64[] size
geometry_msgs/PoseWithCovarianceStamped pose
std_msgs/Header header
uint32 seq
time stamp
string frame_id
geometry_msgs/PoseWithCovariance pose
geometry_msgs/Pose pose
geometry_msgs/Point position
float64 x
float64 y
float64 z
geometry_msgs/Quaternion orientation
float64 x
float64 y
float64 z
float64 w
float64[36] covariance
The piece of code that I manage to write till now is:
#include "ros/ros.h"
#include "apriltag_ros/AprilTagDetectionArray.h"
void callback(const apriltag_ros::AprilTagDetectionArray::ConstPtr &msg)
{
//What to do?
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "apriltag_location");
ros::NodeHandle n;
ros::Subscriber sub = n.subscribe("tag_detections",1000,callback);
ros::spin();
}
Could someone point out on how to get the pose from here?