ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

The size of particlecloud in PoseArray Message

asked 2014-09-27 14:22:47 -0600

Hi, I wrote a node that subscribes to amcl particlecloud. I would like to write a callback function that process all the Pose array elements. How can i get the size of the particlecloud or specifically the number of poses in the PoseArray Message?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-09-27 14:57:31 -0600

bvbdort gravatar image

geometry_msgs::PoseArray has pose vector type each element represent a particle in case of amcl particlecloud.

geometry_msgs::PoseArray poseArray;
int size = poseArray.pose.size();
edit flag offensive delete link more



Thanks it works for me like that: int size = poseArray.poses.size();

Anas Alhashimi gravatar image Anas Alhashimi  ( 2014-09-29 03:46:57 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-09-27 14:22:47 -0600

Seen: 1,838 times

Last updated: Sep 27 '14