Skip to content

Conversation

parth-20-07
Copy link

Description

Add a native support to generate Rust Package rather than breaking workflow from ros2_rust using:

ros2 pkg create --build_type ament_cargo <library_name>

Fixes #1104

Is this user-facing behavior change?

Now users can natively generate rust packages for ros2 using ros2 pkg create rather than using ros2_rust api.

Did you use Generative AI?

No

Additional Information

  • Generates package with file structure:
.
├── Cargo.lock
├── Cargo.toml
├── package.xml
└── src
    └── main.rs

1 directory, 4 files
  • Initial format/structure provided by @ibrahimsel has been used to develop this.
  • Optional node_name parameter can be passed to name the node in main.rs but in absence of the parameter, the <library_name>_node is used in place to generate node_name.

Signed-off-by: Parth Patel [email protected]

- fix incorrect parsing for maintainer name and email
- remove parameter for node name for ament_cargo and only pass library
name

Signed-off-by: Parth Patel <[email protected]>
- use library_name as node_name
- correct path for rust file resource
- correctly generate rust package

Signed-off-by: Parth Patel <[email protected]>
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.

Support Rust package creation in ros2 pkg create

1 participant