Repository navigation
Feature/workspace limits richard - #47
richardnguyen165 wants to merge 21 commits into
Conversation
The arm is a base yaw, three parallel pitch joints and a roll through the tool tip, so kinematics.py solves any tip position and tool tilt in closed form from the URDF. The new Cartesian group (Y) moves the tip along straight lines in base_link with the tilt fixed; LB keeps only the strongest axis. At a joint speed limit or the workspace edge the whole step shrinks, so the tip stops on the line, and the roll turns against the yaw to keep the tool's heading. Each drive now gets the next setpoint one period ahead and the speed that reaches it in exactly one period, measured from its encoder, so all drives arrive together. acc is 255 because a gentle drive ramp adds the same rpm/s to every drive and the one with the largest change falls behind. In simulation a sideways cut at 30:1 gearing stays within 7-17 um of the line, compared with up to 186 um with the old 1.5x speed rule. At the 1:1 placeholder gearing it stays within about 0.13 mm, one encoder count at the tip.
D-pad left/right changes the tool pitch while the tip stays in place, so the shoulder, elbow and wrist move around a fixed point. The tilt uses the same closed-form step as straight moves, so a joint limit stops it with the tip still in place. It runs at up to 30 deg/s, scaled by the speed level.
- Start is refused while a tilt button or A is held, like the sticks. - Homing clears the Cartesian rates, so releasing A can't resume the last move. - Cartesian roll ramps with the acceleration limit and scales with the accepted step. - The drives' setpoint one period ahead stays within the URDF joint limits, which the drive node now reads from robot_description. - If one drive would pass max_rpm, every drive slows by the same factor, so they still arrive together. - The roll compensation is documented as stopping the tool spinning about its own axis; that keeps a blade's heading only when the tool points straight down. - The Cartesian launch test is registered where it won't conflict with #22.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
| Layer / File(s) | Summary |
|---|---|
Define bounds and constrain kinematic jogs waybionic_teleop/config/xbox_teleop.yaml, waybionic_teleop/waybionic_teleop/kinematics.py, waybionic_teleop/test/test_kinematics.py |
The configuration defines the box bounds. Kinematic jogs check candidate tool-tip positions against those bounds and report keep_in when the box blocks a step. Tests cover box boundaries, return movement, diagonal cuts, and tilt and roll at a boundary. |
Load bounds and enforce them in teleop waybionic_teleop/waybionic_teleop/teleop.py, waybionic_teleop/test/test_teleop.py, waybionic_teleop/test/test_incision.py, waybionic_teleop/test/test_collision.py |
Teleop loads and validates the bounds, checks that the home tool tip is inside the box, and constrains joint, Cartesian, and incision motion. Tests cover bounds, blocking, target lookahead, and collision behavior. |
Display box and blocked state waybionic_teleop/waybionic_teleop/xbox_teleop_node.py, waybionic_teleop/test/test_xbox_teleop_node.py |
The Xbox node publishes a box marker in the base frame. The marker changes color when keep_in blocks motion. A test checks the stop state, summary, and diagnostic message. |
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant XboxTeleop
participant ArmTeleop
participant ArmKinematics
XboxTeleop->>ArmTeleop: Send motion input
ArmTeleop->>ArmKinematics: Solve jog with keep_in bounds
ArmKinematics-->>ArmTeleop: Return targets and blocker
ArmTeleop-->>XboxTeleop: Report keep_in stop state
Suggested reviewers: yassinsolim
Merge Risk: 
Minimal · previous review 1aead
-
No actionable keep-in constraint issue remains; the change is mergeable after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 28.30% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 53 functions across 8 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
3b57764f-f1a6-4efc-bb91-e4cca26b0938
📒 Files selected for processing: 9
-
waybionic_teleop/config/xbox_teleop.yaml
waybionic_teleop/test/test_collision.py
waybionic_teleop/test/test_incision.py
waybionic_teleop/test/test_kinematics.py
waybionic_teleop/test/test_teleop.py
waybionic_teleop/test/test_xbox_teleop_node.py
waybionic_teleop/waybionic_teleop/kinematics.py
waybionic_teleop/waybionic_teleop/teleop.py
waybionic_teleop/waybionic_teleop/xbox_teleop_node.py
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
3b57764f-f1a6-4efc-bb91-e4cca26b0938
📒 Files selected for processing: 9
-
waybionic_teleop/config/xbox_teleop.yamlwaybionic_teleop/test/test_collision.pywaybionic_teleop/test/test_incision.pywaybionic_teleop/test/test_kinematics.pywaybionic_teleop/test/test_teleop.pywaybionic_teleop/test/test_xbox_teleop_node.pywaybionic_teleop/waybionic_teleop/kinematics.pywaybionic_teleop/waybionic_teleop/teleop.pywaybionic_teleop/waybionic_teleop/xbox_teleop_node.py
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
-
Richard's October 17 commit keeps the tip in the box during the base and upper groups and homing, and draws the box in RViz. Merged with main's teleop, the box check also keeps the published lookahead inside, and it skips the incision group, which keeps the tool on its axis and checks the box itself. The collision tests for the joint groups put the box out of reach so the table check still stops them.
|
@richardnguyen165 #47 and #48 both conflicted because your October 17 commit was on your branch but the update wasn't, so I finished task 1 for you:
Your branch now points at that merge (1aead0c), so #48 is merged and #47 no longer conflicts. Pull before you change anything: Before #47 is ready for review, tasks 2 to 5 from the October 17 list are still open:
If a merge conflicts again, ask a lead before opening a PR. |
…/Waybionic/waybionic_ground_station into feature/workspace-limits-richard Updating current branch.
|
The test results are all passing. The added tests involve tools that, if they go out of bounds, cannot move further but can move back along the axis, preventing them from exceeding the boundaries. Cannot run code as it keeps crashing. |
yassinsolim
left a comment
There was a problem hiding this comment.
Thanks, Richard. The two-face tests are good: moves out through either face are refused, moves back in through both recover, and the third-face case stops on the wall. I applied this PR on top of current main and ran the full suite: 1279 tests, 0 failures. The CI failures here aren't from your change (a flaky Cartesian launch test, an xmllint schema download and a diagnostics test timeout on the runner), so you don't need to chase them.
Before it can merge:
-
Merge main. Git will report 18 conflicts, but none of them are real: main hasn't changed any of your files since #34, and you haven't changed any of the others. So keep yours for your four files and main's for the rest. CI runs the full suite when you push, so you don't need Docker for this.
git fetch origin git checkout feature/workspace-limits-richard git pull git merge origin/main mine="waybionic_teleop/config/xbox_teleop.yaml waybionic_teleop/test/test_teleop.py waybionic_teleop/waybionic_teleop/teleop.py waybionic_teleop/waybionic_teleop/xbox_teleop_node.py" git checkout --ours -- $mine git add -- $mine git diff --name-only --diff-filter=U | xargs git checkout --theirs -- git add -A git commit --no-edit git push
-
Test the box and the collision check together. Add a move that heads for both at once, for example the tool going down toward a table set just above or just below the box floor. Check that the arm stops at whichever comes first and that
blockednames it. -
Fill in the PR description: what it does, the test results, and what's still provisional, such as the box size until it's checked against the arm's reach.
…its-richard # Conflicts: # BuildInstructions.md # waybionic_bringup/CMakeLists.txt # waybionic_bringup/launch/ground_station.launch.py # waybionic_bringup/scripts/camera_follower.py # waybionic_teleop/config/arm_drives.yaml # waybionic_teleop/config/xbox_teleop.yaml # waybionic_teleop/setup.py # waybionic_teleop/test/test_gamepad.py # waybionic_teleop/test/test_mks_can.py # waybionic_teleop/test/test_sim_drives.py # waybionic_teleop/test/test_teleop.py # waybionic_teleop/waybionic_teleop/gamepad.py # waybionic_teleop/waybionic_teleop/joy_udp_receiver.py # waybionic_teleop/waybionic_teleop/mks_can.py # waybionic_teleop/waybionic_teleop/sim_arm_drives_node.py # waybionic_teleop/waybionic_teleop/teleop.py # waybionic_teleop/waybionic_teleop/xbox_teleop_node.py # waybionic_teleop/waybionic_teleop/xinput_bridge.py
|
Actual Reach: 0.49m, |
What this doesAdds a keep-in box for the tool tip. Teleop stops the tip at the box walls in every control mode.
Tests
Box vs. the real arm
The box was sized from the URDF reach (545 mm), so x and y reach about 55–60 mm past what the real arm can reach. That is safe, since it never blocks a reachable pose, but it isn't a real limit yet. Home matches: both are fully upright, and the home tip is inside the box. Still provisional
|
Runs the ground station's own drive, teleop, diagnostics and RViz nodes on the bench arm through the UNO R4 WiFi + MCP2515 carrier's SLCAN link, and fixes the CI flakes that were failing main. - Stop CI failing on shutdown races and float timing - Bring up the real arm through the MCP2515 carrier - Load vcan without linux-modules-extra on new runner kernels - Record why gravity compensation needs torque-controlled drives - Keep arrival order when a frame rolls over during a buffer read - Stop a failing frame log from interrupting drive control - Fix the bench-tool edge cases found in review of the carrier bring-up Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…its-richard Merging changes from main into branch.
…the base yaw. Pushing the stick right now turns the arm right instead of left.
Keep the tool tip inside a configurable workspace box (keep-in limits)ScopeAdds a keep-in box: an axis-aligned box in In scope
Out of scope
Tested evidenceAll tests run in simulation against the URDF kinematics; nothing here was measured on the
The 11 skips are CAN/firmware tests that need vcan or a C++ compiler; none are keep-in cases. Targeted command (from What the tests cover:
Fix after merging main: #55 reversed the base yaw stick, so the third-face test's Provisional bounds
These defaults are deliberately loose: they stop gross excursions, not task-specific ones. Unresolved mechanical assumptions
Reviewer checklist
|
|
@Gkong5020 @ovilikaris-dotcom Requesting re-review. |
|
Heads-up, Richard: I rewrote the history of To fix it, run: The merge should be clean because the contents match. Until you have done that, please do not land this PR with a merge commit (a squash merge is fine), or the old commit comes back into |
Summary by CodeRabbit