cargo ros-add - ROS Dependency Management Tool
A Cargo subcommand for adding dependencies to ROS Rust packages, handling both package.xml and Cargo.toml files automatically.
Installation
Usage
This will:
- Add the dependency to your
package.xmlfile - Attempt to add the dependency to
Cargo.tomlwith a wildcard version (*)
Features
- Automatic XML Handling: Adds
<depend>tags topackage.xmlwhile preserving formatting - Dual Configuration: Updates both ROS (
package.xml) and Rust (Cargo.toml) dependency files - Idempotent Operation: Won't duplicate existing dependencies
- Error Handling: Provides clear error messages for common issues
Examples
Add a standard ROS dependency:
Add a custom ROS package dependency:
Requirements
- Rust toolchain (cargo)
- ROS development environment
- Existing ROS package with
package.xmlandCargo.tomlfiles
Limitations
- Currently only adds dependencies with wildcard versions (
*) inCargo.toml - Requires the package to have a valid
package.xmlfile - Only adds
<depend>tags (not<build_depend>or<exec_depend>)
Contributing
Contributions are welcome! Please open an issue or pull request on GitHub.