A web-based control and visualization application for the SO-ARM101 robotic arm.
This project provides a React-based interface for controlling and monitoring the SO-ARM101 6-DOF robotic arm via WebSocket communication. It includes:
- 3D Visualization: Real-time URDF-based robot model rendering using React Three Fiber
- Joint Control: Individual and synchronized control of all 6 joints
- Calibration System: Zero position setting, limit recording, and dead zone configuration
- Torque Control: Freeup/lock motors for manual movement during calibration
- Mock Server: Node.js WebSocket server that simulates robot behavior for development
| Category | Technology |
|---|---|
| Frontend | React 18 + TypeScript |
| Build Tool | Vite |
| 3D Rendering | React Three Fiber + Three.js |
| URDF Loading | urdf-loader |
| State Management | Zustand |
| Styling | Tailwind CSS |
| Mock Server | Node.js + ws |
robot_control/
├── public/robot/ # URDF and STL mesh files
├── src/
│ ├── components/ # React components
│ │ ├── calibration/ # CalibrationPanel
│ │ ├── connection/ # ConnectionPanel
│ │ ├── controls/ # JointControlPanel, JointSlider, ModeSwitch
│ │ └── viewer/ # RobotViewer, RobotModel, Scene
│ ├── constants/ # Robot joint configurations
│ ├── hooks/ # useWebSocket, useURDFLoader
│ ├── services/ # WebSocket service
│ ├── stores/ # Zustand store (robotStore)
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Unit conversion utilities
├── server/ # Mock WebSocket server
│ ├── index.js # Server entry point
│ └── robotSimulator.js # Robot state simulator
└── protocol.md # WebSocket protocol documentation
src/stores/robotStore.ts- Central state management with Zustandsrc/services/websocketService.ts- WebSocket client implementationsrc/hooks/useWebSocket.ts- React hook for WebSocket operationssrc/components/viewer/RobotModel.tsx- URDF 3D model componentsrc/constants/robot.ts- Joint configurations and limitsserver/robotSimulator.js- Simulates robot arm physics
6 joints with motor IDs 1-6:
| Motor ID | Joint Name | Limits (rad) |
|---|---|---|
| 1 | shoulder_pan | -1.92 to 1.92 |
| 2 | shoulder_lift | -1.75 to 1.75 |
| 3 | elbow_flex | -1.69 to 1.69 |
| 4 | wrist_flex | -1.66 to 1.66 |
| 5 | wrist_roll | -2.74 to 2.84 |
| 6 | gripper | -0.17 to 1.75 |
# Start mock WebSocket server
node server/index.js
# Start frontend dev server
npm run devnpm run buildSee protocol.md for complete WebSocket message format documentation.
Key message types:
list_motors- Query available motorsget_positions/positions- Get/receive joint positionsset_position/set_all_positions- Control joint positionssubscribe/unsubscribe- Real-time position updatesfreeup/lock- Motor torque control
- Readonly: View real-time position data, sliders disabled
- Control: Send position commands via sliders
- Set current position as zero reference
- Record min/max limits by moving robot to positions
- Configure dead zones per joint
- Save/load calibration to localStorage
- Freeup: Disable motor torque for manual positioning
- Lock: Enable motor torque for servo control