Code: Select all
void chatterCallback(const darknet_ros_3d_msgs::BoundingBoxes3d::ConstPtr& msg)
{
if (!msg->bounding_boxes.empty())
{
int inc = 1;
if(msg->bounding_boxes[0].Class == "box")
{
std::vector<float> array_xmin(inc);
std::vector<float> array_ymin(inc);
std::vector<float> array_zmin(inc);
std::vector<float> array_xmax(inc);
std::vector<float> array_ymax(inc);
std::vector<float> array_zmax(inc);
array_xmin[inc] = msg->bounding_boxes[0].xmin;
array_xmax[inc] = msg->bounding_boxes[0].xmax;
array_ymin[inc] = msg->bounding_boxes[0].ymin;
array_ymax[inc] = msg->bounding_boxes[0].ymax;
array_zmin[inc] = msg->bounding_boxes[0].zmin;
array_zmax[inc] = msg->bounding_boxes[0].zmax;
inc++;
}
}
}