# `cargo ros-add` - ROS Dependency Management Tool
[Cargo](https://doc.rust-lang.org/cargo/) subcommand for adding dependencies to [ROS](https://docs.ros.org/en/kilted/index.html) [Rust](https://www.rust-lang.org/) packages, handling both `package.xml` and `Cargo.toml` files automatically.
## Installation
```sh
cargo install ros-add
```
## Usage
```sh
cargo ros-add <dependency_name>
```
This will:
1. Add the dependency to your `package.xml` file
2. Attempt to add the dependency to `Cargo.toml` with a wildcard version (`*`)
## Features
- **Automatic [XML](https://en.wikipedia.org/wiki/XML) Handling**: Adds `depend` elements to `package.xml` while preserving formatting
- **Dual Configuration**: Updates both [ROS](https://docs.ros.org/en/kilted/index.html) (`package.xml`) and [Rust](https://www.rust-lang.org/) (`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:
```sh
cargo ros-add roscpp
```
Add a custom ROS package dependency:
```sh
cargo ros-add my_custom_msgs
```
## Requirements
- Rust toolchain ([cargo](https://doc.rust-lang.org/cargo/))
- Existing ROS package with `package.xml` and `Cargo.toml` files
## Limitations
- Currently only adds dependencies with wildcard versions (`*`) in `Cargo.toml`
- Requires the package to have a valid `package.xml` file
- Only adds `<depend>` tags (not `<build_depend>` or `<exec_depend>`)
## Contributing
Contributions are welcome! Please open an issue or pull request on [Gitlab](https://gitlab.com/rust_projects3505446/ros_add).
## License
[Apache-2.0](LICENSE)