You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b7d1767
Browse filesBrowse the repository at this point in the historyBrowse files
Drive the real arm through the carrier board (#45)
The ground station drives the real arm through the carrier board, the UNO R4 WiFi between the laptop's USB and the drives' CAN bus. drive_interface:=slcan opens it with slcan_bus.py, writes each tick's frames at once, reopens the port if the USB link drops or the carrier goes quiet, and shows the carrier's status and e-stop in a can.carrier row. A frame the carrier refuses goes out again on the next tick, and no more than 16 frames go unanswered, the size of the carrier's queue, so every answer matches its frame. Shutdown writes the stops at once and waits for their answers.
arm_drives.yaml uses the CAD gear ratios (26:1 on the base, shoulder and elbow, 3:1 on the wrist motors) at CAN IDs 1-5 and 1 Mbit/s. mks_setup scans the bus, sets a drive's CAN ID and bit rate, and repeats the F7h broadcast stop until the carrier takes it. The controller link reports loss, jitter, gaps and round trip from ping and pong packets. scripts/macos.sh gains flash, drives and arm.
The four-node vcan step now fails unless the test binary reports passed tests and no skips: this googletest has no --gtest_fail_if_skipped, which printed its help and exited 0 without running a test.
./scripts/macos.sh arm joy_source:=udp joy_udp_bind:=0.0.0.0
533
594
```
534
595
596
+
The receiver takes controller packets from any computer that can reach its port, so do
597
+
this only on a private network.
598
+
599
+
### The engineering monitor
600
+
601
+
With `teleop:=true` the monitor shows live rows:
602
+
603
+
| Row | Shows |
604
+
| --- | --- |
605
+
|`controller.link`| Remote controller only: packet rate, loss, jitter, longest gap and network round trip; warns past 2% loss, a 100 ms gap or a 50 ms round trip |
606
+
|`teleop.input`| Whether controller input is arriving; teleop disables itself after 0.5 s without it |
607
+
|`arm.command_gate`| Whether the drives take teleop's commands, or why they stopped |
608
+
|`can.carrier`| The carrier's USB link (reopened every second if unplugged), E-stop and supply (once wired), CAN controller errors, and frames the carrier refused |
609
+
|`can.bus`| Frames per second and bus load |
610
+
|`drive.*`, `arm.*`| Each drive's reply state and encoder, each joint against its target, and whether the arm is zeroed |
611
+
535
612
**Zeroing.** The encoders count from where the drives were powered on, so the host
536
613
publishes no joint states and moves nothing until the arm is zeroed. Put the arm in
537
614
the zero pose (the pose RViz shows before anything moves), leave teleop disabled, and
@@ -542,16 +619,37 @@ ros2 service call /sim_arm_drives/zero std_srvs/srv/Trigger
542
619
```
543
620
544
621
Then press Start. Real drives take commands through the same gate as the simulated ones.
545
-
If a drive stops answering, for example because the E-stop cut its power, or its encoder
546
-
count jumps further than `max_rpm` allows between two readings, as after a brief power
547
-
loss, every drive stops and the arm must be zeroed again. The same happens when a drive
548
-
reports a failed move (as when its stall protection releases the motor) or an end-limit
549
-
stop, or stays more than `following_error_counts` from its target for
550
-
`following_error_ticks` ticks; both are provisional values in `arm_drives.yaml`. If the
551
-
joint commands stop for 0.5 s, every drive stops where it is, and if the host stops, the
622
+
If a drive stops answering, for example because the E-stop cut its power or the carrier
623
+
was unplugged, or its encoder count jumps further than `max_rpm` allows between two
624
+
readings, as after a brief power loss, every drive stops and the arm must be zeroed
625
+
again. The same happens when a drive reports a failed move (as when its stall protection
626
+
releases the motor) or an end-limit stop, or stays more than `following_error_counts` from
627
+
its target for `following_error_ticks` ticks; both are provisional values in
628
+
`arm_drives.yaml`. Once Electrical wires the carrier's E-stop sense, pressing the E-stop
629
+
also stops every drive at once, and Start is refused until it is released. If the joint
630
+
commands stop for 0.5 s, every drive stops where it is, and if the host stops, the
552
631
drives' heartbeat stops them. A stop frame the adapter refuses is sent again on every
553
-
tick, and Start is refused until it has gone out. After any stop, disable teleop and press
554
-
Start again.
632
+
tick, and Start is refused until it has gone out. The carrier answers a frame it cannot
633
+
pass on yet with BELL; the host sends a refused move, stop or setup frame again on the
634
+
next tick, and a refused zero while the zero service waits. After any stop, disable
635
+
teleop and press Start again.
636
+
637
+
### On Linux
638
+
639
+
With the carrier, set up the drives with `mks_setup` (the commands in step 2 above), then
640
+
launch:
641
+
642
+
```bash
643
+
ros2 run waybionic_teleop mks_setup --channel /dev/ttyACM0 scan
Copy file name to clipboardExpand all lines: waybionic_can/README.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,10 +163,9 @@ Here is what an exchange looks like. Receivers 1 and 3 log `ignored (addressed t
163
163
164
164
## Hardware status and TODOs
165
165
166
-
-**Set CAN ID and bitrate:** 8Bh and 8Ah are not implemented in the shared C++ subset. F7h
167
-
emergency stop is implemented from MKS manual section 9.2.3. The Python `EMERGENCY_STOP`
168
-
helper matches [PR #45](https://github.com/Waybionic/waybionic_ground_station/pull/45); if
169
-
that PR lands first, keep main's copy of `emergency_stop()` and the F7h `sim_drives.py` branch.
166
+
-**Set CAN ID and bitrate:** 8Bh and 8Ah are not implemented in the shared C++ subset; the
167
+
Python `mks_can.py` has them for `mks_setup`. F7h emergency stop is implemented from MKS
168
+
manual section 9.2.3.
170
169
-**Broadcast ID 0 and other MKS commands:** not implemented in the C++ bench subset.
171
170
-**Physical receiver actuator:** the bench receivers use `SoftwareActuator`. A hobby-servo `IActuator` would need a defined mapping from MKS axis counts to angles and of what READ_ENCODER reports.
172
171
-**Carrier telemetry hardware:** status ID `0x7F0` reports unknown E-stop/supply plus CAN error
0 commit comments