ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
2022-10-12 04:41:11 -0500 | marked best answer | How to Initialize a 2D MultiArray? Hello, I am using a Raspberry Pi with Lubuntu 16.04, ros Kinetic, a Sick tim 561 and the package sick_scan to get data from the tim561. Currently my goal is to extract the x and y data from the sick_scan package which is published to the topic cloud as a PointCloud2. I can do this but not exactly in the way that I want. I have coded a subsriber to the cloud topic which then publishes out whatever by following a tutorial. So right now I create a Float32MultiArray and store the distance values that I get (so I do sqrt(x^2 + y^2)) and can successfully publish this. This works fine, and the code below is what I am using. However, I would prefer to be publishing the x and y data. Unfortunately, I am rather unfamiliar with Float32MultiArray, and I am unsure as how to create a 2D array using this data type. It would also be ideal if I could give it a set size for memory allocation purposes. I am more used to standard arrays, so what I am looking to do is Thanks! Code: |
2019-09-23 14:34:44 -0500 | received badge | ● Famous Question (source) |
2019-06-12 13:21:02 -0500 | received badge | ● Student (source) |
2019-06-12 13:12:11 -0500 | received badge | ● Notable Question (source) |
2019-03-27 19:53:47 -0500 | received badge | ● Famous Question (source) |
2019-03-25 20:29:31 -0500 | received badge | ● Popular Question (source) |
2019-03-25 14:05:27 -0500 | asked a question | How to Initialize a 2D MultiArray? How to Initialize a 2D MultiArray? Hello, I am using a Raspberry Pi with Lubuntu 16.04, ros Kinetic, a Sick tim 561 and |
2019-03-25 02:09:50 -0500 | received badge | ● Notable Question (source) |
2019-03-24 21:57:40 -0500 | commented answer | Help with PointCloud2 Data Thanks that makes a lot of sense. I was not aware that uchar was a fundamental type. |
2019-03-24 21:44:47 -0500 | marked best answer | Help with PointCloud2 Data Hello, I am using a Raspberry Pi with Lubuntu 16.04, ROS Kinetic, a tim 561 and a package called sick_scan to get data from the LIDAR. I can use sick_scan to publish PointCloud2 data to the topic /cloud and I can visualize data with rviz. The end goal for my LIDAR is to be able to get distance data from it. So I want it to tell me what the distance to the things around it is. I am having some issues with this though as I am not really sure where to start. Would I be able to extract distance data from directly from the PointCloud2 data and if so how, or would there be some intermediary steps? I have successfully followed this tutorial to convert PointCloud2 to PointCloud<t> but I'm not really sure if this is the right direction to go in. I'm also not really sure what the difference between the PointCloud2 and PointCloud<t> is. I noticed though that the data looks very different, is this by design or my mistake? (I will post a comparison below). I also found this tutorial that changes a PointCloud to a rangeImage, would this be helpful? I would also like to add that I am beginner and PointCloud2 is by far the most complex data type I have worked with. I am used to the simpler data types, so any help would be truly appreciated as I am sure that I am missing some key understanding about this data type. Thanks! /output data after converting to PointCloud<t>: /cloud data of type PointCloud2: (more) |
2019-03-24 21:44:47 -0500 | received badge | ● Scholar (source) |
2019-03-24 21:38:52 -0500 | received badge | ● Popular Question (source) |
2019-03-24 21:37:53 -0500 | commented answer | Help with PointCloud2 Data Ok that makes a lot of sense thank you! I just have one more thing if you don't mind. I noticed that the solution uses a |
2019-03-24 20:36:01 -0500 | commented answer | Help with PointCloud2 Data Ah ok this makes a lot of sense thank you! I had come to a similar conclusion after reading through a bunch of blog post |
2019-03-24 20:29:10 -0500 | received badge | ● Supporter (source) |
2019-03-24 16:19:12 -0500 | edited question | Help with PointCloud2 Data Help with PointCloud2 Data Hello, I am using a Raspberry Pi with Lubuntu 16.04, ROS Kinetic, a tim 561 and a package ca |
2019-03-24 15:57:26 -0500 | asked a question | Help with PointCloud2 Data Help with PointCloud2 Data Hello, I am using a Raspberry Pi with Lubuntu 16.04, ROS Kinetic, a tim 561 and a package ca |