Why does a response vector of type geometry_msgs/PoseStamped[] poses in a service always has 24 elements? (c++) [closed]
Hi guys,
I can't explain what is happening, maybe it is just my compiler, or my ROS version, but every time that I want to use the response vector poses (of type geometry_msgs/PoseStamped[]) it has 24 places, so if I ask for the size before assigning any value to it:
bool generate_robot_targets_service(robot_pick_place::GenerateRobotTargets::Request &req, robot_pick_place::GenerateRobotTargets::Response &res){
int poses_size = sizeof(res.poses);
std::cout << "The size of poses is: " << poses_size << std::endl;//shows: The size of poses is: 24
return true;
}
poses_size is equal to 24. Why? I try to delete the 24 ? (whatever they are) using the erase() vector method and it gives a core dumped error (like always). I could try creating a vector pointer and assigning it to the res.poses to point to the new memory, but still, Why does it start with 24 positions filled with garbage?
Any idea is welcome, please comment.