[](https://gitlab.com/rust_projects3505446/ros_new/-/blob/ros_new/LICENSE?ref_type=heads)
[](https://crates.io/crates/ros_new)
[](https://crates.io/crates/ros_new)
[](https://docs.rs/ros_new/latest/ros_new/)
[](https://crates.io/crates/ros_new)
# cargo-ros-new
A Cargo plugin for creating new Rust packages with ROS `package.xml` files.
## Features
- Creates a standard Rust package using `cargo new` with all its features
- Generates a ROS-compatible `package.xml` file with:
- Package name and version
- Maintainer information (name and email)
- License declaration
- Description
- Correct format specification
- Ament build type declaration
- Supports all `cargo new` options:
- Binary or library template (`--bin`/`--lib`)
- Edition specification (`--edition`)
- VCS initialization (`--vcs`)
## Installation
Install from `crates.io`:
```sh
cargo install cargo-ros-new
```
## Usage
### Basic usage
```sh
cargo ros-new my_package
```
This will create:
- A new Rust package named `my_package`
- A `package.xml` file with default values
### With options
```sh
cargo ros-new my_package \
--maintainer "John Doe" \
--mail "john@example.com" \
--license "MIT" \
--description "My awesome ROS package" \
--edition 2024 \
--vcs git
```
### As a Cargo subcommand
You can also use it as a regular Cargo subcommand:
```sh
cargo new --ros my_package
```
## Configuration
The following default values are used if not specified:
- Maintainer: "user"
- Email: "you@email.com"
- License: "TODO: License declaration"
- Description: "TODO: Package description"
- Format: "3" (ROS package format 3)
## Building from source
### With Nix
If you have Nix installed, you can build and enter a development environment with:
```bash
nix develop
```
Then build with:
```bash
cargo build
```
### Without Nix
Standard Rust build process:
```bash
cargo build
```
## License
Apache-2.0
## Contributing
Contributions are welcome! Please open issues or merge requests on our [GitLab repository](https://gitlab.com/rust_projects3505446/ros_new).
## ROS Compatibility
The generated packages are compatible with ROS 2 and the Ament build system through the `ament_cargo` build type.