A flexible framework for connecting legged robots, input devices, and control algorithms, especially learning-based ones. Out-of-the-box policies and configurations can be found in stepit_zoo.
Caution
Disclaimer: User acknowledges that all risks and consequences arising from using this code shall be solely borne by the user, the author assumes no liability for any direct or indirect damages, and proper safety measures must be implemented prior to operation.
Note: This project is under active development, which means the interface is unstable and breaking changes are likely to occur frequently.
Setup the workspace, build StepIt, and run the demo configuration:
mkdir stepit_ws && cd stepit_ws
bash -c "$(curl -fsSL https://raw.githubusercontent.com/chengruiz/stepit/main/scripts/setup.sh)"
./scripts/build.sh
./scripts/run.sh ./configs/demo.conf.shTested on Ubuntu 20.04, 22.04 and 24.04.
sudo apt install cmake build-essential
sudo apt install libboost-dev libboost-filesystem-dev libboost-program-options-dev \
libeigen3-dev libfmt-dev libyaml-cpp-dev
mkdir -p stepit_ws/src && cd stepit_ws
git clone https://github.com/chengruiz/stepit.git src/stepit# In the stepit_ws directory
cmake -Bbuild -Ssrc/stepit -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install
cmake --build build -j && cmake --install buildYou can configure the build by passing CMake variables via -D flags:
STEPIT_WHITELIST_PLUGINS(string): semicolon-separated list of plugins to build. Default is all available plugins.STEPIT_BLACKLIST_PLUGINS(string): semicolon-separated list of plugins not to build. Default is"".STEPIT_PLUGIN_DIRS(string): semicolon-separated list of plugin root directories, each with aplugins.cmakeindex.
StepIt discovers build-time plugins through explicit indexes. The built-in index is
plugin/plugins.cmake; each directory specified by STEPIT_PLUGIN_DIRS must also contain a
plugins.cmake file that sets STEPIT_PLUGIN_PATHS. Read a plugin's README.md before using it.
Built-in plugins are organized by responsibility:
-
Control
control_console: Controlling with standard input.control_ros: Controlling through ROS topics and services.control_ros2: Controlling through ROS2 topics and services.
-
Examples
debugging_helper: Helper utilities for debugging.
-
Field
field_base: Field registration and generic field operators.pyutils: Python utilities for C++ modules.
-
Integrations
redis_base: Reusable Redis client support for other plugins.ros_base: ROS node lifecycle, spinning, and shared ROS utilities.ros2_base: ROS2 node lifecycle, spinning, QoS, and shared ROS2 utilities.
-
Joystick
joystick_base: Interface for general joystick and joystick control.joystick_redis: Controlling with joystick data read from Redis.joystick_ros: Joystick input from ROSsensor_msgs/Joytopics.joystick_ros2: Joystick input from ROS2sensor_msgs/msg/Joytopics.joystick_udp: Controlling with Retroid gamepads.joystick_usb: Controlling with USB joysticks, e.g. Xbox 360 controller.
-
Neural-network runtime
nnrt_base: Interface for neural networks.nnrt_onnxruntime: Neural network inference on general x86_64 processors.nnrt_tensorrt: Neural network inference on NVIDIA GPUs and Jetson platforms, e.g. Jetson Orin NX.nnrt_torchjit: Neural network inference with TorchScript (PyTorch JIT) models.
-
Modular policy
modular_policy_base: Core modular-policy modules and actuators.modular_policy_nn: Neural-network policy modules.modular_policy_locomotion: Locomotion inputs, observations, and commands.modular_policy_locomotion_ros: ROS support for locomotion modules.modular_policy_locomotion_ros2: ROS2 support for locomotion modules.modular_policy_motion_tracking: Motion-tracking policy modules.modular_policy_redis: Redis field sources for modular policies.modular_policy_ros: Generic ROS field subscribers for modular policies.modular_policy_ros2: Generic ROS2 field subscribers for modular policies.
-
Publishing
publisher_csv: Publisher for writing robot data to CSV files.publisher_ros: Publisher for ROS topics.publisher_ros2: Publisher for ROS2 topics.
-
Robots
robot_deeprobotics_lite3: Controlling the DeepRobotics Lite3 robot.robot_deeprobotics_x30: Controlling the DeepRobotics X30 robot (deprecated).robot_unitree_aliengo: Controlling the Unitree Aliengo robot.robot_unitree_b1: Controlling the Unitree B1 robot.robot_unitree_go1: Controlling the Unitree Go1 robot.robot_unitree2: Controlling Unitree Go2, B2, A2, and G1 robots, and Unitree joysticks.robot_unitree2_ros2: Controlling Unitree robots withunitree_ros2.
# Run StepIt to control the robot
./install/bin/stepitCommand line arguments:
| Option | Type | Description |
|---|---|---|
-c / --control |
string | The control input type. |
-f / --factory |
string | The default factory for a specified type. |
-P / --publisher |
string | The publisher type. |
-p / --policy |
string | The policy type and directory. |
-r / --robot |
string | The controlled robot type. |
-v / --verbosity |
int | Verbosity level ranging from [0, 3]. Defaults to 2. |
-- [arg1 arg2 ...] |
— | Additional arguments passed to plugins' entry function. |
Run ./install/bin/stepit --help for more information.
- Environment Variable: StepIt reads environment variables listed in
environment.sh. Environment variables have lower precedence than their corresponding command-line arguments. - Control Input: Generally, StepIt accepts strings as control inputs, and returns a response for each one. These inputs can be provided via the console, joysticks, or topics/services in ROS1/ROS2. See doc/control.md for more details.
- State Publishing: StepIt publishes the robot states to CSV files, or via ROS1 or ROS2 topics.
- Plugin Mechanism: StepIt provides a flexible plugin architecture to enable integration of new modules without modifying existing code. See doc/plugin.md for more details.
- ROS Integrations: StepIt works well with ROS1 and ROS2. Make sure you read the README.md of ROS1 or ROS2 before you start.
- Simulation: StepIt supports unitree_mujoco-based simulation. See robot_unitree2 or stepit_sim for more details.
