Skip to content

Conversation

@BCSol
Copy link

@BCSol BCSol commented Aug 19, 2025

Proposal for structured parameters derive macro (#496)

Changes:

  • added trait StructuredParameters
  • added derive macro in new rclrs_proc_macros
  • added poc some tests
  • install test_msgs and example_messages with apt, without the cargo build without colon would fail to link rosidl message (I'd be happy about some help there)

TODO:

  • proper documentation of traits
  • default values should be made possible
  • more tests
  • add generic declare macro to NodeState/Node

@mxgrey before I continue here, I'd be happy about some feedback, whether this is what you had in mind or how we could improve upon this POC.

@BCSol BCSol marked this pull request as draft August 19, 2025 23:08
@BCSol BCSol marked this pull request as ready for review September 29, 2025 17:33
@BCSol BCSol changed the title Draft: Derive macro for StructuredParameters Derive macro for StructuredParameters Sep 29, 2025
@esteve esteve self-requested a review January 8, 2026 10:34
Copy link
Collaborator

@esteve esteve left a comment

Choose a reason for hiding this comment

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

@balthasarschuess @BCSol thanks for the PR, it doesn't seem necessary to have a separate crate only for the macros, can you move that into rclrs? Thanks.

@balthasarschuess
Copy link

balthasarschuess commented Jan 8, 2026

@balthasarschuess @BCSol thanks for the PR, it doesn't seem necessary to have a separate crate only for the macros, can you move that into rclrs? Thanks.

Hey @esteve :)
thanks for having a look. I think this is not possible as proc-macros require the crate to be marked as proc macro and cannot be used inside the crate they are defined in (https://doc.rust-lang.org/reference/procedural-macros.html#r-macro.proc.def)
I think it's better to have the proc macro tests inside rclrs.

I might be mistaken, but I could not find any resource claiming that this restriction has been lifted.
In case can you point me towards the resource.

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.

3 participants