Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Fix Unordered Point Clouds #241

Open
wants to merge 3 commits into
base: melodic
Choose a base branch
from

Conversation

exo-core
Copy link

@exo-core exo-core commented Mar 2, 2022

Fixes

Description of the changes:

Fixed the wrong size information in published point clouds (see #227 and #163).

Required before submitting a Pull Request:

I tested changes on:

  • Windows
  • Linux
  • ROS1
  • ROS2

@exo-core exo-core changed the title fixed wrong point clound size info Fix Unordered Point Clouds Mar 2, 2022
@christian-rauch
Copy link
Contributor

For my understanding, does this essentially "reshape" the unstructured point cloud (list of points) into a structured point cloud (grid of points in the image domain)?

@exo-core
Copy link
Author

exo-core commented Apr 6, 2022

For my understanding, does this essentially "reshape" the unstructured point cloud (list of points) into a structured point cloud (grid of points in the image domain)?

Yes. Actually the correct width and height values are already being set in lines 669/670 and 727/728, respectively, but the call to pcd_modifier.resize(n) resets the point cloud back to n times 1.

@christian-rauch
Copy link
Contributor

For my understanding, does this essentially "reshape" the unstructured point cloud (list of points) into a structured point cloud (grid of points in the image domain)?

Yes. Actually the correct width and height values are already being set in lines 669/670 and 727/728, respectively, but the call to pcd_modifier.resize(n) resets the point cloud back to n times 1.

I see. In this case, you could also move all of:

point_cloud->height = pointcloud_image.get_height_pixels();
point_cloud->width = pointcloud_image.get_width_pixels();
point_cloud->is_dense = false;
point_cloud->is_bigendian = false;

to after the pcd_modifier.resize(point_count); so that setting point_cloud->height and point_cloud->width does not appear twice.

@christian-rauch
Copy link
Contributor

Also... can you squash your commits? :-) Your third commit reverts your second commit. Such commits should not appear at all in the git history. And I think you can also squash your last commit into the first commit as they touch the same things.

@v4hn
Copy link

v4hn commented Aug 17, 2022

Thank you for tracking this down @exo-core ! It works.

@christian-rauch It's rather annoying that this is not the default behavior upstream yet. Can't you just squash-commit and maybe add your own cleanup commit?

@christian-rauch
Copy link
Contributor

Thank you for tracking this down @exo-core ! It works.

@christian-rauch It's rather annoying that this is not the default behavior upstream yet. Can't you just squash-commit and maybe add your own cleanup commit?

Which commit? I don't have a commit in this PR and I also cannot squash or change other people's PRs.

@exo-core
Copy link
Author

I guess we are a little spoiled from Gitlab, which has a "squash commits" option in the merge menu... (no clue what kind of back magic it does in the background)

I'm quite busy, finalizing my Ph.D. thesis at present, but I'll try to squeeze in a some time next week to update my PRs. For this one it should be straightforward. #240 seems to need some more thought and discussion though...

@christian-rauch
Copy link
Contributor

I'm quite busy, finalizing my Ph.D. thesis at present

Good luck with your thesis writeup :-)

@exo-core exo-core force-pushed the fix_unordered_point_cloud branch from b5d4b80 to 088d263 Compare August 25, 2022 08:47
@exo-core exo-core force-pushed the fix_unordered_point_cloud branch from 088d263 to 838bbc1 Compare August 25, 2022 08:49
@exo-core
Copy link
Author

I guess the PR should be fine now ;-)

Good luck with your thesis writeup :-)

Thanks!

@CalaW
Copy link

CalaW commented Sep 22, 2022

The process died after modifying and compiling the package in accordance with this commit. However I published ordered point clouds by simply remove the following line:

pcd_modifier.resize(point_count);

I am not familiar with point cloud representation in ROS, so I'm wondering if it's a valid solution.

@v4hn
Copy link

v4hn commented Oct 11, 2022 via email

ooeygui
ooeygui previously approved these changes Oct 18, 2022
Copy link
Member

@ooeygui ooeygui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@exo-core
Copy link
Author

The process died after modifying and compiling the package in accordance with this commit. However I published ordered point clouds by simply remove the following line:

pcd_modifier.resize(point_count);

I am not familiar with point cloud representation in ROS, so I'm wondering if it's a valid solution.

Thanks for pointing this out. I was able to get a camera in the lab today and could reproduce the issue.

@exo-core
Copy link
Author

exo-core commented Oct 24, 2022

Ok, so turned out the initial resize wasn't save to remove after all, since resizing at the end invalidated the iterators. Guess, skipping the resize entirely isn't a good idea either, so I just moved the iterator initializations behind the resize operation.

Sorry, I didn't run detailed tests before; it seemed trivial and I did not have a camera at hand...

@exo-core exo-core requested a review from ooeygui September 21, 2023 12:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants