feat: C控制程序对接KCP
This commit is contained in:
71
ros-control-c/README.md
Normal file
71
ros-control-c/README.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# ros-control-c
|
||||
|
||||
`ros-control-c` keeps the original 24-byte `twist_cmd_t` control payload and now supports two runtime transports:
|
||||
|
||||
- `udp` (default): unchanged from the original implementation
|
||||
- `kcp`: sent through OmniSocket using `MSG_TYPE_BINARY`
|
||||
|
||||
## Build
|
||||
|
||||
On Linux:
|
||||
|
||||
```bash
|
||||
make -C ros-control-c
|
||||
```
|
||||
|
||||
If the robot-side Python bridge will use KCP, build and install the OmniSocket Python extension from the repo root first:
|
||||
|
||||
```bash
|
||||
make python-ext
|
||||
make python-install
|
||||
```
|
||||
|
||||
## UDP Mode
|
||||
|
||||
Sender:
|
||||
|
||||
```bash
|
||||
./ros-control-c/build/keyboard_controller -i 192.168.1.100 -p 9870
|
||||
./ros-control-c/build/gamepad_controller -i 192.168.1.100 -p 9870
|
||||
```
|
||||
|
||||
Robot bridge:
|
||||
|
||||
```bash
|
||||
python3 ros-control-c/robot/udp_ros_bridge.py
|
||||
```
|
||||
|
||||
## KCP Mode
|
||||
|
||||
Start the existing OmniSocket KCP hub from the repo root:
|
||||
|
||||
```bash
|
||||
./bin/kcpserver -listen :9002
|
||||
```
|
||||
|
||||
Sender:
|
||||
|
||||
```bash
|
||||
./ros-control-c/build/keyboard_controller -t kcp -s 192.168.1.50:9002 -I ros-keyboard-ctrl -T ros-bridge-ctrl
|
||||
./ros-control-c/build/gamepad_controller -t kcp -s 192.168.1.50:9002 -I ros-gamepad-ctrl -T ros-bridge-ctrl
|
||||
```
|
||||
|
||||
If a relay is needed, add `-r <relay_addr>` to the controller command.
|
||||
|
||||
Robot bridge:
|
||||
|
||||
```bash
|
||||
python3 ros-control-c/robot/udp_ros_bridge.py --ros-args \
|
||||
-p transport:=kcp \
|
||||
-p kcp_server:=192.168.1.50:9002 \
|
||||
-p peer_id:=ros-bridge-ctrl
|
||||
```
|
||||
|
||||
Optional sender filtering:
|
||||
|
||||
```bash
|
||||
python3 ros-control-c/robot/udp_ros_bridge.py --ros-args \
|
||||
-p transport:=kcp \
|
||||
-p peer_id:=ros-bridge-ctrl \
|
||||
-p expected_sender:=ros-keyboard-ctrl
|
||||
```
|
||||
Reference in New Issue
Block a user