How hy-liyihan/robot_control works
Robot Control provides one Python API and CLI for Piper and Franka FR3, with MuJoCo simulation, real-hardware control, twin mirroring, and RGB-D camera access. The principal workflow selects a robot and backend, connects through the API or shared-scene client, issues state or motion commands, and optionally captures camera frames with extrinsics. The graph includes the distinct simulation, hardware, twin, and sensing stages; several subsystem links are documented in the README or SOURCE INDEX rather than shown in sampled implementation excerpts.
Main entry points: robot.py Robot API · service.py Camera Service · cli.py Command CLI · scene.py Scene Server
Components 21
User Entry
- Command CLI
src/robot_control/cli.py
Control API
- Robot API
src/robot_control/api/robot.py - Backend Selection
src/robot_control/selection.py - Robot Data Types
src/robot_control/api/types.py - Piper IK
src/robot_control/kinematics/ik.py - FR3 IK
src/robot_control/fr3/ik.py
Robot Runtimes
- Scene Client
src/robot_control/scene.py - Scene Server
src/robot_control/scene.py - Piper Simulation
src/robot_control/backends/mujoco.py - FR3 Simulation
src/robot_control/fr3/mujoco.py - Piper Hardware
src/robot_control/backends/real.py - Franka Hardware
src/robot_control/backends/franka_direct.py - Twin Runtime
src/robot_control/twin.py - Piper Scene Builder
src/robot_control/backends/scene_builder.py - FR3 Scene Builder
src/robot_control/fr3/scene_builder.py
RGB-D Sensing
- Camera Service
src/robot_control/sensors/service.py - MuJoCo RGB-D
src/robot_control/sensors/mujoco_rgbd.py - RealSense Camera
src/robot_control/sensors/realsense.py - Camera Extrinsics
src/robot_control/sensors/extrinsics.py - RGB-D Frame
src/robot_control/sensors/frame.py
Other components
- Operator
Connections 29
- Operator → Command CLI: issues commands
README.md - Operator → Robot API: calls API
README.md - Command CLI → Robot API: dispatches commands
src/robot_control/cli.py - Robot API → Backend Selection: validates choice
src/robot_control/api/robot.py - Robot API → Scene Client: connects shared scene
src/robot_control/api/robot.py - Command CLI → Scene Server: starts scene
src/robot_control/cli.py - Scene Client → Scene Server: sends requests
src/robot_control/scene.py - Scene Server → Piper Simulation: dispatches commands
README.md - Scene Server → FR3 Simulation: dispatches commands
README.md - Robot API → Piper Simulation: selects backend
src/robot_control/api/robot.py - Robot API → FR3 Simulation: selects backend
src/robot_control/api/robot.py - Robot API → Piper Hardware: selects backend
src/robot_control/api/robot.py - Robot API → Franka Hardware: selects backend
src/robot_control/api/robot.py - Command CLI → Twin Runtime: starts twin
README.md - Twin Runtime → Piper Hardware: mirrors feedback
src/robot_control/twin.py - Twin Runtime → Franka Hardware: mirrors feedback
src/robot_control/twin.py - Piper Simulation → Piper Scene Builder: validates scene
src/robot_control/backends/mujoco.py - FR3 Simulation → FR3 Scene Builder: validates scene
src/robot_control/fr3/mujoco.py - Piper Simulation → Piper IK: solves targets
src/robot_control/backends/mujoco.py - FR3 Simulation → FR3 IK: solves targets
src/robot_control/fr3/mujoco.py - Robot API → Camera Service: captures camera
src/robot_control/api/robot.py - Command CLI → Camera Service: captures camera
src/robot_control/cli.py - Camera Service → Scene Client: reads shared camera
src/robot_control/sensors/service.py - Camera Service → MuJoCo RGB-D: creates simulator camera
src/robot_control/sensors/service.py - Camera Service → RealSense Camera: reads hardware camera
src/robot_control/sensors/service.py - Camera Service → Camera Extrinsics: computes transform
src/robot_control/sensors/service.py - Camera Service → RGB-D Frame: returns frame
src/robot_control/sensors/service.py - MuJoCo RGB-D → RGB-D Frame: produces frame
src/robot_control/sensors/mujoco_rgbd.py - RealSense Camera → RGB-D Frame: produces frame
src/robot_control/sensors/realsense.py