aruco_detect, can't access fiducial_id
Hello, I'm trying to acces the fiducial_id in aruco_detect, but I get this error message:
error: ‘fiducial_msgs::FiducialTransformArray_<std::allocator<void> >::_transforms_type’ {aka ‘class std::vector<fiducial_msgs::FiducialTransform_<std::allocator<void> >, std::allocator<fiducial_msgs::FiducialTransform_<std::allocator<void> > > >’} has no member named ‘fiducial_id’
25 | h.transforms.fiducial_id;
I'm not sure why it's saying this, because it should be there according to this:
>rosmsg info fiducial_msgs/FiducialTransformArray
std_msgs/Header header
uint32 seq
time stamp
string frame_id
int32 image_seq
fiducial_msgs/FiducialTransform[] transforms
int32 fiducial_id
geometry_msgs/Transform transform
geometry_msgs/Vector3 translation
float64 x
float64 y
float64 z
geometry_msgs/Quaternion rotation
float64 x
float64 y
float64 z
float64 w
float64 image_error
float64 object_error
float64 fiducial_area
This how where I'm trying to access it:
#include "ros/ros.h"
#include <iostream>
#include <fstream>
#include "fiducial_msgs/FiducialTransformArray.h"
using namespace std;
void counterCallback(const fiducial_msgs::FiducialTransformArray::ConstPtr msg){
int update_time;
ROS_INFO("Hello");
}
int main(int argc,char **argv){
ros::init(argc,argv,"marker_detect");/*Initialiserer node med navn*/
ros::NodeHandle n;
ros::Subscriber sub = n.subscribe<fiducial_msgs::FiducialTransformArray>("fiducial_transforms",10,counterCallback);
fiducial_msgs::FiducialTransformArray h;
h.transforms.fiducial_id;
ros::spin();
return 0;
}