Skip to content

Add 2D Profile sensor interface - #93

Merged
traversaro merged 10 commits into
mainfrom
add-2DProfileSensor
Dec 2, 2026
Merged

traversaro merged 10 commits into
mainfrom
add-2DProfileSensor

Conversation

@lrapetti

Copy link
Copy Markdown
Contributor

Adding interface to read and control 2D profile sensor. For now I am keeping the interface minimal considering the device we are using.

PR is in draft because I still need to review some code and the interfaces are still open to discussion. Anyway any feedback is welcome.

@lrapetti lrapetti self-assigned this Nov 30, 2026
@lrapetti

Copy link
Copy Markdown
Contributor Author

cc @gbionics/team-argo @Luca0101

Comment thread docs/conventions-and-guidelines.md Resolved
@traversaro

Copy link
Copy Markdown
Contributor

Great, minor comments:

  • I would try to cleanup the naming between 2d_profile_sensor / 2DProfileSensor / ProfileSensor2D . As I would prefer to have a name in the device name with underscores, I would just go for profilometer2d for the lowercase contexts (such as device names) and Profilometer2D for the camel cases contexts.

Comment thread src/core/dinrail/IProfilometer2D.h Resolved
Comment thread src/core/dinrail/IProfilometer2D.h Resolved
Comment on lines +15 to +18
/** dinrail::StatusCode returned by IProfilometer2D::getProfile. */
1: i32 profile_status_code = 14;
/** dinrail::Profilometer2DStatus of the sensor, Unknown (5) by default. */
2: i32 sensor_status = 5;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I believe the dinrail::Status and ProfilometerStatus are inverted.

But is the sensor_status same as dinrail::Status?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

profile_status_code is the status returned by getProfile method, while sensor_status is the one returned by getProfilometer2DStatus. The status returned by getProfilometer2DStatus however is not transmitted. I don't know if it make sense to add it here or rework a bit the interfaces. I can try to review it.

@lrapetti

lrapetti commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Hi @traversaro, with 9790388 I have changed the wat the idl generated files are organized in folders. Let me know if it is ok.

I did it because as the message is currently implemented, I am using the dinrail::Status return for each method of the interface, but then to reflect it I need to define custom messages for all the data. (I don't know if that make sense, and if it was the intended usage of it, in case have a look at the https://github.com/gbionics/dinrail/blob/9790388bb45e6326fb8bec9e1e00bc6a00480cb2/src/yarp-devices/shared/idl/Profilometer2DYARPMsgs.thrift)

@lrapetti
lrapetti marked this pull request as ready for review December 1, 2026 11:03
@traversaro

Copy link
Copy Markdown
Contributor

Hi @traversaro, with 9790388 I have changed the wat the idl generated files are organized in folders. Let me know if it is ok.

I did it because as the message is currently implemented, I am using the dinrail::Status return for each method of the interface, but then to reflect it I need to define custom messages for all the data. (I don't know if that make sense, and if it was the intended usage of it, in case have a look at the https://github.com/gbionics/dinrail/blob/9790388bb45e6326fb8bec9e1e00bc6a00480cb2/src/yarp-devices/shared/idl/Profilometer2DYARPMsgs.thrift)

Ok for me. Can you fix the failing clang-format check?

xref @S-Dafarra @RiccardoGrieco , eventually we can also provide a way to expose 2D profile sensors also as cameras, but I guess there are some functionalities independent from the camera world (such as switching on and off the laser) so it make sense to have them as independent device for now.

@traversaro

Copy link
Copy Markdown
Contributor

Hi @traversaro, with 9790388 I have changed the wat the idl generated files are organized in folders. Let me know if it is ok.
I did it because as the message is currently implemented, I am using the dinrail::Status return for each method of the interface, but then to reflect it I need to define custom messages for all the data. (I don't know if that make sense, and if it was the intended usage of it, in case have a look at the https://github.com/gbionics/dinrail/blob/9790388bb45e6326fb8bec9e1e00bc6a00480cb2/src/yarp-devices/shared/idl/Profilometer2DYARPMsgs.thrift)

Ok for me. Can you fix the failing clang-format check?

It seems that the idl generated code is triggering the check, I guess we can exclude it from the clang-format check.

@lrapetti

lrapetti commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Hi @traversaro, with 9790388 I have changed the wat the idl generated files are organized in folders. Let me know if it is ok.
I did it because as the message is currently implemented, I am using the dinrail::Status return for each method of the interface, but then to reflect it I need to define custom messages for all the data. (I don't know if that make sense, and if it was the intended usage of it, in case have a look at the https://github.com/gbionics/dinrail/blob/9790388bb45e6326fb8bec9e1e00bc6a00480cb2/src/yarp-devices/shared/idl/Profilometer2DYARPMsgs.thrift)

Ok for me. Can you fix the failing clang-format check?

It seems that the idl generated code is triggering the check, I guess we can exclude it from the clang-format check.

Removed the idl files and formatted.

@traversaro

Copy link
Copy Markdown
Contributor

Thanks, this is fine for me. @S-Dafarra @RiccardoGrieco I think this is a bit ortoghonal w.r.t. to the camera work, and even if eventually we may want to expose a subset of the profilometer 2d functionality in the camera interfaces, I would like to merge this to unblock the work related to that, any objections?

@S-Dafarra

Copy link
Copy Markdown
Contributor

Thanks, this is fine for me. @S-Dafarra @RiccardoGrieco I think this is a bit ortoghonal w.r.t. to the camera work, and even if eventually we may want to expose a subset of the profilometer 2d functionality in the camera interfaces, I would like to merge this to unblock the work related to that, any objections?

No objections from me. I think it is safe to consider cameras and 2D profile sensors as two different sensors

@traversaro
traversaro merged commit 167019d into main Dec 2, 2026
3 checks passed
@traversaro
traversaro deleted the add-2DProfileSensor branch December 2, 2026 08:40
@traversaro

Copy link
Copy Markdown
Contributor

@lrapetti please let me know if you need a release/conda-forge package etc etc with these.

@lrapetti

lrapetti commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@lrapetti please let me know if you need a release/conda-forge package etc etc with these.

If possibile it would be ideal

@traversaro

Copy link
Copy Markdown
Contributor

@lrapetti please let me know if you need a release/conda-forge package etc etc with these.

If possibile it would be ideal

Thanks, I would like to sort out the output type of Python bindings (xref #95 (comment)) and then we are ready to release for me.

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.

4 participants