ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Accesing RosAria Point cloud sensor data

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

udmamrl gravatar image

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

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

Sonar_msg.points=msg->points;

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

Thanks

edit retag flag offensive close merge delete

Comments

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 -0600 )edit

1 Answer

Sort by » oldest newest most voted
0

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

Himanshu gravatar image

u can try this msg->points.data(). hope it works!!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-11-24 20:54:40 -0600

Seen: 670 times

Last updated: Nov 24 '14