You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @George-Gi, this is due to our complex message generation and consumption pipeline. When you put std_msgs = "*" in your Cargo.toml, there should be an accompanying .cargo/config.toml file in the root of your colcon workspace which "patches" any dependency on a std_msgs crate with some local crate. The local crate we patch to, should be generated by the rosidl_generator_rs package when you colcon build within a workspace which also has an interfaces package containing .msg etc files.
So if you're seeing this issue, it generally means one of these things
You may not have built with colcon yet.
Does the .cargo/ folder exist in the root of your workspace?
You may not have the rosidl_generator_rs and/or std_msgs package(s) in your workspace or a sourced overlay
Does the .cargo/config.toml file exist but there are no entries?
I recognize this is really quite confusing, you're not the first person to bring this up and you won't be the last. There is an ongoing community discussion on how we might simplify this experience (#471) if you're interested.
Hi @George-Gi, this is due to our complex message generation and consumption pipeline. When you put std_msgs = "*" in your Cargo.toml, there should be an accompanying .cargo/config.toml file in the root of your colcon workspace which "patches" any dependency on a std_msgs crate with some local crate. The local crate we patch to, should be generated by the rosidl_generator_rs package when you colcon build within a workspace which also has an interfaces package containing .msg etc files.
So if you're seeing this issue, it generally means one of these things
You may not have built with colcon yet.
Does the .cargo/ folder exist in the root of your workspace?
You may not have the rosidl_generator_rs and/or std_msgs package(s) in your workspace or a sourced overlay
Does the .cargo/config.toml file exist but there are no entries?
I recognize this is really quite confusing, you're not the first person to bring this up and you won't be the last. There is an ongoing community discussion on how we might simplify this experience (#471) if you're interested.
Hi @maspe36 , thank you for the reply. I didn't realize from the instructions that it is necessary to install the generator and the rest of the repo. I thought this was optional only for development purposes and that by including only the relevant dependency in the Cargo.toml should do the job. So, cloning the whole repo is mandatory, right? My intention was to create the smallest possible container, that's why I want to avoid any extra stuff, not required.
You don't need to clone the whole ros2_rust repo, you can pull rclrs from crates.io via your crates Cargo.toml. But at the moment, the rosidl_rust package (which includes rosidl_generator_rs) needs to be in some underlay or the current colcon workspace.
We are in a weird transitional period where rosidl_rust is working its way into the rolling release[1]. Soon it should be sufficient to just pull rclrs from crates.io to write Rust-y ROS 2 nodes.
Formal Decision: Add rosidl_rust to REP 2005 (ROS Project Charter - article 4.9.ii)
Activity
maspe36 commentedon Apr 11, 2025
Hi @George-Gi, this is due to our complex message generation and consumption pipeline. When you put
std_msgs = "*"
in yourCargo.toml
, there should be an accompanying.cargo/config.toml
file in the root of your colcon workspace which "patches" any dependency on astd_msgs
crate with some local crate. The local crate we patch to, should be generated by the rosidl_generator_rs package when youcolcon build
within a workspace which also has an interfaces package containing.msg
etc files.So if you're seeing this issue, it generally means one of these things
You may not have built with colcon yet.
Does the
.cargo/
folder exist in the root of your workspace?You may not have the
rosidl_generator_rs
and/orstd_msgs
package(s) in your workspace or a sourced overlayDoes the
.cargo/config.toml
file exist but there are no entries?I recognize this is really quite confusing, you're not the first person to bring this up and you won't be the last. There is an ongoing community discussion on how we might simplify this experience (#471) if you're interested.
George-Gi commentedon Apr 14, 2025
Hi @maspe36 , thank you for the reply. I didn't realize from the instructions that it is necessary to install the generator and the rest of the repo. I thought this was optional only for development purposes and that by including only the relevant dependency in the Cargo.toml should do the job. So, cloning the whole repo is mandatory, right? My intention was to create the smallest possible container, that's why I want to avoid any extra stuff, not required.
maspe36 commentedon May 8, 2025
You don't need to clone the whole ros2_rust repo, you can pull
rclrs
from crates.io via your crates Cargo.toml. But at the moment, therosidl_rust
package (which includesrosidl_generator_rs
) needs to be in some underlay or the current colcon workspace.We are in a weird transitional period where
rosidl_rust
is working its way into the rolling release[1]. Soon it should be sufficient to just pullrclrs
from crates.io to write Rust-y ROS 2 nodes.https://discourse.ros.org/t/ros-pmc-minutes-for-april-22-2025/43346