-
Notifications
You must be signed in to change notification settings - Fork 615
refactor: make MovementManager click limits configurable (#2013) #2116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,6 +124,25 @@ def test_invalid_clicks_rejected(manager_and_captured): | |
| assert captured.goal == [] | ||
|
|
||
|
|
||
| def test_click_limit_rejects_when_lowered(manager_and_captured): | ||
| """A click within the default range is rejected once the limit is lowered below it.""" | ||
| manager, captured = manager_and_captured | ||
| manager.config.max_click_horizontal_m = 10.0 | ||
| manager._on_click(_click(x=50.0, y=0.0, z=0.0)) | ||
| assert captured.goal == [] | ||
| assert captured.way_point == [] | ||
|
|
||
|
|
||
| def test_click_limit_accepts_when_raised(manager_and_captured): | ||
| """A click beyond the default range is accepted once the limit is raised above it.""" | ||
| manager, captured = manager_and_captured | ||
| manager.config.max_click_horizontal_m = 1000.0 | ||
| far_click = _click(x=600.0, y=0.0, z=0.0) | ||
| manager._on_click(far_click) | ||
| assert captured.goal == [far_click] | ||
| assert captured.way_point == [far_click] | ||
|
Comment on lines
+127
to
+143
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
|
|
||
| def test_tele_cmd_vel_scaling(manager_and_captured): | ||
| """tele_cmd_vel_scaling multiplies each teleop twist component independently.""" | ||
| manager, captured = manager_and_captured | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
max_click_horizontal_mormax_click_vertical_mto0.0or any negative value and silently disable all click-based navigation —abs(msg.x) > 0.0isTruefor every non-zero coordinate, so every click gets dropped without an obvious error. A PydanticField(gt=0)constraint would surface the mistake at config-parse time instead of at runtime.