-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
ebda453
to
ebdc11e
Compare
msg.cell_width = cell_size; | ||
msg.cell_height = cell_size; | ||
|
||
for (auto i = 0; i < cols * rows; ++i) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ | ||
// find x,y,z positions of current index | ||
geometry_msgs::msg::Point p3d; | ||
uint32_t row = (i / cols); |
There was a problem hiding this comment.
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
?
ebdc11e
to
f6886c0
Compare
Tracked by [LRS-996]