First test of direct can control on the wheels
This commit is contained in:
1 parent
e317c10f7f
commit
3f12a62044
20 files changed
+1101
-127
No files matched your search
@@ -56,3 +56,59 @@ colcon build
|
||||
# User manual
|
||||
|
||||
[myagvPro_docs](https://github.com/elephantrobotics/myagvPro_docs/tree/main/MYAGV_PRO_EN/6-SDKDevelopment/6.2-ApplicationBaseROS2)
|
||||
|
||||
# Docker Compose services
|
||||
|
||||
`docker-compose.yml` defines two services built from the same image:
|
||||
|
||||
- `agv_pro` (default) — exact current behaviour: wheels + IMU/voltage/digital-IO/LED are all
|
||||
controlled over the serial base controller at `/dev/agvpro_controller`. On target hardware
|
||||
this device comes from a udev rule; if you're testing without it (e.g. a raw USB-serial
|
||||
adapter), override the host-side path with `AGV_PRO_SERIAL_DEVICE`:
|
||||
```bash
|
||||
AGV_PRO_SERIAL_DEVICE=/dev/ttyUSB0 docker compose up agv_pro
|
||||
```
|
||||
- `agv_pro_can` — wheels are controlled directly over CAN using the RobStride private
|
||||
protocol instead of serial, via the community [`robstride_ros2`](https://github.com/s2015-turtle/robstride_ros2)
|
||||
`ros2_control` driver (built from source, see `upstream.jazzy.repos`). IMU/voltage/digital-IO/LED
|
||||
remain on the serial base controller (`/dev/agvpro_controller`), unchanged. This replaces an
|
||||
earlier CANopen-based attempt (`agv_pro_canopen_config`/`ros2_canopen`) that was never
|
||||
confirmed against real hardware and has been removed — real, direction-confirmed CAN
|
||||
communication with the wheel drives (RobStride RS01 motors, CAN IDs 1-4) was subsequently
|
||||
verified empirically, including commanding all 4 wheels to spin forward together; see
|
||||
`/memories/repo/agv_can_serial_hw_notes.md`.
|
||||
|
||||
**Power-on sequencing**: the servos only get 24V once the serial base controller's
|
||||
POWER_ON handshake succeeds, and on this hardware the CAN interface must stay
|
||||
administratively *down* until that happens (bringing it up any earlier blocks the serial
|
||||
port's DTR/RTS ioctl on the shared USB bus). `agv_pro_hardware/AgvProHardwareInterface`
|
||||
(running in sensors-only mode alongside `robstride_ros2/RobStrideSystem` in this mode)
|
||||
now brings the CAN interface up itself, automatically, right after POWER_ON succeeds — so
|
||||
only load the kernel driver beforehand and leave the link down:
|
||||
|
||||
```bash
|
||||
sudo modprobe gs_usb
|
||||
```
|
||||
|
||||
Do **not** run `ip link set can0 up` yourself — the hardware interface does this (along
|
||||
with `txqueuelen 1000` and the confirmed real bitrate, 1 Mbit/s) once it's safe to do so.
|
||||
|
||||
Then launch the robot with `wheel_interface:=can` (see `agv_pro_bringup.launch.py`), e.g.:
|
||||
|
||||
```bash
|
||||
ros2 launch agv_pro_bringup agv_pro_bringup.launch.py wheel_interface:=can can_interface_name:=can0
|
||||
```
|
||||
|
||||
This starts a `ros2_socketcan` bridge node on `can_interface_name` (publishing/subscribing
|
||||
`can_msgs/msg/Frame` on `to_can_bus`/`from_can_bus`) in addition to the usual nodes;
|
||||
`robstride_ros2/RobStrideSystem` talks to the physical bus through that bridge. The bridge
|
||||
binds the CAN socket at startup even while the link is still down — it simply starts
|
||||
seeing frames once the hardware interface brings the link up a few seconds later.
|
||||
|
||||
**Verified**: `can_id` (1-4) to physical corner mapping, and motor `direction`, both
|
||||
confirmed by rotating/spinning real wheels — see `/memories/repo/agv_can_serial_hw_notes.md`.
|
||||
**Still placeholder/unverified**: `gear_ratio`, and the `kp`/`kd` velocity-mode gains in
|
||||
`agv_pro.ros2_control.xacro` — tune for the real mecanum drivetrain before relying on this
|
||||
for real motion. See [`agv_pro.ros2_control.xacro`](src/elephant_robotics/agv_pro_description/urdf/control/agv_pro.ros2_control.xacro).
|
||||
|
||||
|
||||
Reference in new issue
Block a user