Ask Your Question

Accesing RosAria Point cloud sensor data

asked 2014-11-24 20:54:40 -0500

udmamrl gravatar image

updated 2014-12-03 10:30:37 -0500

ReedHedges gravatar image

HI and thank you in advance for your help,

I have recently installed RosAria on my computer to communicate to a pioneer robot over usb to serial. I have tested RosAria using rostopic echo RosAria/sonar to ensure connection and check the sonar data which is returned in a pointcloud. I have been trying to subscribe to RosAria/sonar from a c file I have created. I believe that I have succeeded in connecting because the sonars are clicking but I do not get any viable data into my program observed by ROS_INFO_STREAM. I believe that this is because I have not been able to gain access to the specific array holding the distance readings. I was not able to use PointCoud_To_LaseScan because of errors which I believe are due to it requiring pointcloud2 along with camera data which I do not have because I am simply trying to subscribe to the sonar data. I believe the error in my code is caused by the subscription to the data


because pointcloud has a header file shown below it would seem the above line should be

Sonar_msg.points.x=msg->points.x; or Sonar_msg.points.x=msg->points;

but these cause an error shown below, so what are the members of PointCloud, and how do you access them?

: error: ‘sensor_msgs::PointCloud_<std::allocator<void> >::_points_type’ has no member named ‘x’

rosmsg show sensor_msgs/PointCloud std_msgs/Header header uint32 seq time stamp string frame_id geometry_msgs/Point32[] points float32 x float32 y float32 z sensor_msgs/ChannelFloat32[] channels string name float32[] values, pointclouds

some of the data I have received which I believe should be of type double with no special characters in them.

Please help me find where I'am going wrong subscribing


edit retag flag offensive close merge delete


I'm not sure the answer to your specifc question about using the C++ client api to pointcloud data, but I just added a new topic to RosAria which publishes a PointCloud2 message type (sonar_pointcloud2). I just used the conversion function in sensor_msgs in roscpp. Update rosaria git to test.

ReedHedges gravatar image ReedHedges  ( 2014-12-03 13:22:29 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2016-06-10 05:05:46 -0500

Himanshu gravatar image

u can try this msg-> hope it works!!

edit flag offensive delete link more

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-11-24 20:54:40 -0500

Seen: 589 times

Last updated: Nov 24 '14