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

does ros2_rust support autogeneration of code from .idl and .msg files, is there any example implementation to autogenerate rust nodes from .idl/.msg files? #348

Open
vignesh-tw opened this issue Nov 10, 2023 · 1 comment

Comments

@vignesh-tw
Copy link

No description provided.

@maspe36
Copy link
Collaborator

maspe36 commented Nov 11, 2023

We can generate rust code for idl and msg files thanks to the rosidl_generator_rs and rosidl_runtime_rs packages in this repo.

In the rclrs_example_msgs package, we define a few .msg files and then we consume them in message_demo example. There is nothing special about the rclrs_example_msgs package, the "magic" is in message_demo's package.xml where we specify our dependency on the rosidl_runtime_rs package.

As for the second part of your question, there is no way to generate nodes from just .idl/.msg files. To quote the ROS 2 docs

A node is a fundamental ROS 2 element that serves a single, modular purpose in a robotics system.

So having codegen for types defined in .idl/.msg files is different from automatically generating a node. You'll still need to write code that uses your auto-generated types.

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