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

Getting intensity field #148

Closed
ghost opened this issue May 3, 2023 · 5 comments
Closed

Getting intensity field #148

ghost opened this issue May 3, 2023 · 5 comments

Comments

@ghost
Copy link

ghost commented May 3, 2023

Environment

Ubuntu 22.04

Gazebo

Problem

I am trying to use https://github.com/RobotecAI/RGLGazeboPlugin in my project, and it works great apart from the fact that it does not provide the intensity field. I have looked thorugh the api briefly and tried to get the intensity fields like so:

        if (!CheckRGL(rgl_graph_get_result_data(rglNodeRaytrace, RGL_FIELD_INTENSITY_F32, resultIntensities.data()))) {
            ignerr << "Failed to get intensity result data from RGL lidar.\n";
            return;
        }

This for some reason completely breaks the plugin with the following error:

[Err][Utils.cc:32] invalid state - unrecoverable error occurred 

Reading through the API code, I now see that the intensity field might not even be calculated? From this line, it seems that the intensity field, even if I can somehow access it, will only contain 100.

Are there any plans to add the intensity field calculations or lase_retro support? or is it already implemented somewhere that I am missing?

Thanks.

@prybicki
Copy link
Collaborator

prybicki commented May 4, 2023

Thank you for reaching out @AJsamk!

Your observations are correct - at the moment intensity field is a placeholder so that we can emit ROS2 messages that require this field.

Good news: we are already working on intensity simulation. This a pretty complex topic since intensity can be modeled with a varying degree of sophistication. We aim to release a PoC (sampling a pre-baked texture) by the end of June.

The unrecoverable error you encountered should not happen regardless of the intensity being dummy. Thank you for the report! CC @nebraszka to add appropriate tests.

@ghost
Copy link
Author

ghost commented May 4, 2023

Hi @prybicki,

Thanks for responding and that is very good news! Just wanted to also check if you are planning on providing support for laser_retro. As we do have some Models where we would like to be in control of the reflective intensity (that we will have tested out in the real-world).

I will maybe work on trying to see if this can be added myself since we do need it, and I would be grateful if you could support.

@prybicki
Copy link
Collaborator

prybicki commented May 5, 2023

@AJsamk
As far as I know, laser_retro is a single number per entity that describes uniform reflectivity. That's much simpler than the solution we currently develop (we aim to pre-bake textures).

Recently, we implemented a quite similar feature to provide instance segmentation, i.e., assigning an integer to an entity and including it in point attributes. Uniform reflectivity could be implemented similarly. You can look at this branch implementing instance segmentation. I'd start with adding an API call (in core.h) rgl_entity_set_reflectance_uniform(rgl_entity_t, float). Please reach out if you'd have any questions.

@msz-rai
Copy link
Collaborator

msz-rai commented Aug 10, 2023

@AJsamk @prybicki
I believe we can close this issue since we have implemented intensity in v0.14.0. Some plugins still are waiting for the update, but here in the native library, the feature is done.

@ghost
Copy link
Author

ghost commented Aug 14, 2023

@msz-rai apologies for the delayed response, yes I'm happy to follow along with the plugin issue and close the base one.

@ghost ghost closed this as completed Aug 14, 2023
This issue was closed.
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

No branches or pull requests

2 participants