ROC is a ROS 2 command-line tool implemented in Rust. It implements many ROS 2 workflows directly and uses command naming close to the ros2 CLI.
For detailed command-by-command implementation status, see COMPAT.md.
cargo install roccgit clone https://github.com/bresilla/roc.git
cd roc
cargo build --releaseroc <COMMAND> [SUBCOMMAND] [OPTIONS]Main command groups:
topic- topic discovery, publish, echo, bandwidth/rate/delay toolsservice- service discovery;service callcurrently delegates toros2action- action discovery;action goalcurrently delegates toros2node- node discovery and introspectionparam- parameter operationsinterface- ROS interface inspectionframe- TF frame toolsbag- MCAP recording/playback and rosbag metadata toolsrun- executable discovery and executionlaunch- launch file discovery with execution delegated toros2 launchwork- workspace package create/list/info/buildidl- protobuf and ROS message conversion tools
Use command help to inspect options:
roc --help
roc work --help
roc topic pub --helproc work includes package and workspace utilities:
roc work create- scaffold packages (ament_cmake,ament_python,cmake)roc work list- list discovered packages and build stateroc work info <package>- print package metadataroc work build- build workspace packages with dependency ordering
Examples:
# Build all packages in the current workspace
roc work build
# Build selected packages
roc work build --packages-select my_pkg other_pkg
# Build with merged install layout
roc work build --merge-install
# Create a CMake package
roc work create my_pkg --build_type ament_cmake --node_name talker
# Inspect package details
roc work info my_pkgroc idl protobuf converts between .proto and .msg files.
# Proto -> msg
roc idl protobuf robot.proto
# Msg -> proto
roc idl protobuf RobotStatus.msg
# Write generated files to a directory
roc idl protobuf --output ./generated robot.protoThe project is organized into command modules under src/commands and argument definitions under src/arguments.
- ROS interactions are implemented through Rust code and ROS 2 bindings.
- Some subcommands intentionally delegate to
ros2today. Current delegated paths are:roc service callroc action goalroc launch <pkg> <launch>
- Workspace package discovery logic is shared across
workcommands.
Refer to:
COMPAT.mdfor feature statusFEATURES.mdfor high-level feature notesbook/for extended project documentation
Requirements:
- Rust toolchain
- ROS 2 environment available/sourced for ROS-dependent commands
- clang/libclang for bindgen-based builds
Build and test:
cargo build --release
cargo testLicensed under MIT. See LICENSE.md.
