Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCLVisualizer point picking weirdness #3954

Open
victoryc opened this issue Apr 21, 2020 · 7 comments
Open

PCLVisualizer point picking weirdness #3954

victoryc opened this issue Apr 21, 2020 · 7 comments
Labels

Comments

@victoryc
Copy link

victoryc commented Apr 21, 2020

I am noticing a weird behavior with point picking in PCLVisualizer. For some clicks, it returns the correct x,y,z coordinates. But, some times, the returned coordinate values are not at all in the area I am clicking; they are way off. Any idea why this could be happening?

I don't expect this to be related to the NaN issue because (a) I am not using the point index in the PointPickingEvent. Instead, I am just using the x,y,z values provided by the getPoint method of the event. (b) The point cloud I am rendering doesn't have NaN values.

I did notice that whenever the returned coordinates are wrong, the corresponding point index in the PointPickingEvent is a single digit incorrect value such as 0, 1, 3 etc. But, as I said, I am not using the point index value.

Once in a while, it returns coordinate values so incorrect that the reported pick point is not even within the bounding box of the point cloud.

PCL version: 1.10.1 on Windows 10
Number of points in the cloud: About 4 million

Thanks.

@victoryc victoryc added the status: triage Labels incomplete label Apr 21, 2020
@kunaltyagi kunaltyagi added kind: bug Type of issue module: visualization needs: feedback Specify why not closed/merged yet platform: windows and removed status: triage Labels incomplete labels Apr 21, 2020
@taketwo
Copy link
Member

taketwo commented Apr 22, 2020

Not a definitive answer, but from my experience I have a feeling VTK (our underlying gfx library) does some sort of approximation/heuristics when deciding which actor/primitive was poked. So if you have something in foreground, but click on background near it, then you may get the coordinates of the foreground object.

@victoryc
Copy link
Author

I did try removing anything else being drawn by the application other than the point cloud and still got occasionally completely incorrect coordinate values.

@victoryc
Copy link
Author

victoryc commented Apr 22, 2020

Update: I hacked some code to use vtkWorldPointPicker instead of the vtkPointPicker used by PCL. With vtkWorldPointPicker, the coordinates are indeed coming out right. So, the bug seems to be with either vtkPointPicker or in PCL's use of it. I was motivated to try this out by some old discussions of bugs involving vtkPointPicker that turned up while searching online.

@Apache97
Copy link

@victoryc I am facing the same issue. Regarding your fix, did you modified the sourcecode of PCL to use vtkWorldPointPicker instead of vtkPointPick or you did something else? Have you created a stash/shelveset of the changes? Thanks.

@mkaler999
Copy link

I am having the same issue where the x, y and z coordinates of the picked point do not even belong to my point cloud.
I also noticed that this behavior becomes much more frequent if I increase PCL_VISUALIZER_POINT_SIZE through setPointCloudRenderingProperties.

@vestri
Copy link

vestri commented Oct 29, 2021

@victoryc Hi, I am having the same issue. That's really annoying since we cannot recover correct 3D coordinates even though we are using one point cloud. Any hint or explanation to recover the right x,y,z coordinates?
does #3763 PR will solve it? Thanks

@themightyoarfish
Copy link
Contributor

I also am frequently confused by some points seemingly attracting the viewer, and being unable to pick the one actually under the cursor. Something in the foreground while picking background is a problem, but it even happens at other times.

Currently I'm noticing this behaviour when the data in PCLVIsualizer is many cloud objects. Meanwhile, pcl_viewer with the same data passed as individual files has similar issues, while it does not when the clouds are first merged to one file, then displayed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants