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

Support occupancy grid cells #3032

Merged
merged 1 commit into from
Mar 17, 2024

Conversation

SamerKhshiboun
Copy link
Collaborator

Tracked by [LRS-996]

msg.cell_width = cell_size;
msg.cell_height = cell_size;

for (auto i = 0; i < cols * rows; ++i)
Copy link
Contributor

Choose a reason for hiding this comment

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

@SamerKhshiboun, just thinking out loud for future enhancement. Maybe it makes sense to parallelize this operation by using SSSE3 or GPU acceleration. your thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I think it worth checking if we can accelerate this.
If so, we can do this in a separated task.
Thanks for the advice !

msg.cell_width = cell_size;
msg.cell_height = cell_size;

for (auto i = 0; i < cols * rows; ++i)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this means rows and columns represent the cells and not the bytes?
meaning they are in bit units?
raws = 8 is 1 byte?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

rows = grid cell height, cols = grid cell width
added more documentation for this code

geometry_msgs::msg::Point p3d;
uint32_t row = (i / cols);
uint32_t col = (i % cols);
p3d.x = (cell_size * static_cast<float>(rows)) - cell_size * (static_cast<float>(row) + 0.5f);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would expect x axis will use columns and not rows, can you explain this line?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in ROS CS, X is forward, Y is left, and Z is up.
in AICV algo ROWS represents the height is and COLS represents the width.
image

{
// find x,y,z positions of current index
geometry_msgs::msg::Point p3d;
uint32_t row = (i / cols);
Copy link
Collaborator

Choose a reason for hiding this comment

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

raw is calculates from cols?
Why not from RS2_FRAME_METADATA_OCCUPANCY_GRID_ROWS?

@Nir-Az Nir-Az merged commit 18a6282 into IntelRealSense:ros2-hkr Mar 17, 2024
4 of 5 checks passed
@SamerKhshiboun SamerKhshiboun deleted the occupancy-fix branch June 8, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants