ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Thu, 25 Apr 2019 03:25:27 -0500Order LiDAR points by anglehttps://answers.ros.org/question/321738/order-lidar-points-by-angle/ Is there any form to order all the points (already filtered) from the LiDAR based on the angle of those points with the origin of the LiDAR? I've tried to use numpy.sort in an array with the data from the points plus theta that I calculated, but the definition of the dtypes is failing. Is there any function that could help me with this task? And speaking about performance, how much will it affect my program to check around 30 points on each sample time? What I am trying to achieve is to obtain the range of vision that the LiDAR is actually able to see.
I am programing my nodes in Python.Tue, 23 Apr 2019 21:52:02 -0500https://answers.ros.org/question/321738/order-lidar-points-by-angle/Comment by RalLpezMartn for <p>Is there any form to order all the points (already filtered) from the LiDAR based on the angle of those points with the origin of the LiDAR? I've tried to use numpy.sort in an array with the data from the points plus theta that I calculated, but the definition of the dtypes is failing. Is there any function that could help me with this task? And speaking about performance, how much will it affect my program to check around 30 points on each sample time? What I am trying to achieve is to obtain the range of vision that the LiDAR is actually able to see. </p>
<p>I am programing my nodes in Python.</p>
https://answers.ros.org/question/321738/order-lidar-points-by-angle/?comment=321745#post-id-321745I am right now just reading but the plan is to process them later. Btw, I am working with Autoware on top of ROS, so I am using the filtered data from that packages and I only have like 30 points from the objects in the surroundings. If an acceptable speed of processing can be achieved I would not mind to use the whole raw pointcloudWed, 24 Apr 2019 02:18:45 -0500https://answers.ros.org/question/321738/order-lidar-points-by-angle/?comment=321745#post-id-321745Comment by RalLpezMartn for <p>Is there any form to order all the points (already filtered) from the LiDAR based on the angle of those points with the origin of the LiDAR? I've tried to use numpy.sort in an array with the data from the points plus theta that I calculated, but the definition of the dtypes is failing. Is there any function that could help me with this task? And speaking about performance, how much will it affect my program to check around 30 points on each sample time? What I am trying to achieve is to obtain the range of vision that the LiDAR is actually able to see. </p>
<p>I am programing my nodes in Python.</p>
https://answers.ros.org/question/321738/order-lidar-points-by-angle/?comment=321744#post-id-321744Sorry I didn't explained correctly. I am trying to check the whole area cover by the LiDAR in a 2D approach but using a 3D LiDAR. So using data from a Velodyne of 32 Layers I want to take all the points from one ring (or one height) and order them by ascending or descending angle (yaw). So order all the X,Y,Z points based on the angle the form in the XY space. For example starting from the front of the car check all the data making an horizontal roll. I dont know if that makes easier to understand.Wed, 24 Apr 2019 02:16:31 -0500https://answers.ros.org/question/321738/order-lidar-points-by-angle/?comment=321744#post-id-321744Comment by Delb for <p>Is there any form to order all the points (already filtered) from the LiDAR based on the angle of those points with the origin of the LiDAR? I've tried to use numpy.sort in an array with the data from the points plus theta that I calculated, but the definition of the dtypes is failing. Is there any function that could help me with this task? And speaking about performance, how much will it affect my program to check around 30 points on each sample time? What I am trying to achieve is to obtain the range of vision that the LiDAR is actually able to see. </p>
<p>I am programing my nodes in Python.</p>
https://answers.ros.org/question/321738/order-lidar-points-by-angle/?comment=321869#post-id-321869No problem, glad you could solve your issue :)Thu, 25 Apr 2019 03:25:27 -0500https://answers.ros.org/question/321738/order-lidar-points-by-angle/?comment=321869#post-id-321869Comment by RalLpezMartn for <p>Is there any form to order all the points (already filtered) from the LiDAR based on the angle of those points with the origin of the LiDAR? I've tried to use numpy.sort in an array with the data from the points plus theta that I calculated, but the definition of the dtypes is failing. Is there any function that could help me with this task? And speaking about performance, how much will it affect my program to check around 30 points on each sample time? What I am trying to achieve is to obtain the range of vision that the LiDAR is actually able to see. </p>
<p>I am programing my nodes in Python.</p>
https://answers.ros.org/question/321738/order-lidar-points-by-angle/?comment=321834#post-id-321834I just had some rookie mistake, sorry for the time wasted. I ended up doing what you said, solving the bug I had before (double assignation of a variable)Wed, 24 Apr 2019 23:28:05 -0500https://answers.ros.org/question/321738/order-lidar-points-by-angle/?comment=321834#post-id-321834Comment by Delb for <p>Is there any form to order all the points (already filtered) from the LiDAR based on the angle of those points with the origin of the LiDAR? I've tried to use numpy.sort in an array with the data from the points plus theta that I calculated, but the definition of the dtypes is failing. Is there any function that could help me with this task? And speaking about performance, how much will it affect my program to check around 30 points on each sample time? What I am trying to achieve is to obtain the range of vision that the LiDAR is actually able to see. </p>
<p>I am programing my nodes in Python.</p>
https://answers.ros.org/question/321738/order-lidar-points-by-angle/?comment=321742#post-id-321742Can you add more details about what you want to achieve please ? Because the angles are already sorted from the lowest to the highest angle of the lidar.
> check around 30 points on each sample time
What do you mean by that ? Will you do some processing or just read the data ?Wed, 24 Apr 2019 01:21:22 -0500https://answers.ros.org/question/321738/order-lidar-points-by-angle/?comment=321742#post-id-321742Comment by RalLpezMartn for <p>Is there any form to order all the points (already filtered) from the LiDAR based on the angle of those points with the origin of the LiDAR? I've tried to use numpy.sort in an array with the data from the points plus theta that I calculated, but the definition of the dtypes is failing. Is there any function that could help me with this task? And speaking about performance, how much will it affect my program to check around 30 points on each sample time? What I am trying to achieve is to obtain the range of vision that the LiDAR is actually able to see. </p>
<p>I am programing my nodes in Python.</p>
https://answers.ros.org/question/321738/order-lidar-points-by-angle/?comment=321831#post-id-321831That is one of the methods I already tried. I dont know if there is a problem with `numpy` arctan2 or the speed of processing but it becomes super messy when I implement that. The angles get confused and there are lines crossing all the area (undesired behaviour), that is why I was trying to use al the data from one of the layers.Wed, 24 Apr 2019 19:21:27 -0500https://answers.ros.org/question/321738/order-lidar-points-by-angle/?comment=321831#post-id-321831Comment by Delb for <p>Is there any form to order all the points (already filtered) from the LiDAR based on the angle of those points with the origin of the LiDAR? I've tried to use numpy.sort in an array with the data from the points plus theta that I calculated, but the definition of the dtypes is failing. Is there any function that could help me with this task? And speaking about performance, how much will it affect my program to check around 30 points on each sample time? What I am trying to achieve is to obtain the range of vision that the LiDAR is actually able to see. </p>
<p>I am programing my nodes in Python.</p>
https://answers.ros.org/question/321738/order-lidar-points-by-angle/?comment=321756#post-id-321756Thank you for the precision it's much clearer now.
>I've tried to use numpy.sort in an array with the data from the points plus theta that I calculated, but the definition of the dtypes is failing
What is the error exactly ?
Maybe you could try a different approach. You could use 2 arrays : one for the data and the other for the angles calculated. For each `{ x; y}` sharing the same `z` you can calculate the angle and it'll be easy to find at which index in the array of the angles (by looking for lower and bigger angle) you will insert the angle calculated. This same index will enable you to add the data at the right place in the other array so that you will directly have your array sorted when creating it.Wed, 24 Apr 2019 03:43:10 -0500https://answers.ros.org/question/321738/order-lidar-points-by-angle/?comment=321756#post-id-321756