Implement manual mode arm API (freedrive) - #230
Draft
Nicolas Menard (npmenard) wants to merge 1 commit into
Draft
Nicolas Menard (npmenard) wants to merge 1 commit into
Nicolas Menard (npmenard) wants to merge 1 commit into
Conversation
Nicolas Menard (npmenard)
added this pull request to stack #231
September 11, 2026 13:45
Nicolas Menard (npmenard)
force-pushed
the
RSDK-14465-implement-manual-mode-api
branch
from
September 11, 2026 14:04
0969308 to
ea177c1
Compare
Nicolas Menard (npmenard)
requested a review
from Andrew C. Morrow (acmorrow)
September 11, 2026 14:04
Nicolas Menard (npmenard)
marked this pull request as ready for review
September 11, 2026 14:04
Nicolas Menard (npmenard)
force-pushed
the
RSDK-14465-implement-manual-mode-api
branch
from
September 11, 2026 15:29
ea177c1 to
00de455
Compare
Nicolas Menard (npmenard)
marked this pull request as draft
September 11, 2026 15:29
Andrew C. Morrow (acmorrow)
requested changes
Sep 11, 2026
Andrew C. Morrow (acmorrow)
left a comment
Contributor
There was a problem hiding this comment.
General feeling is that this is breaking the encapsulation of the state machine. Should freedrive just BE a state that the arm can be in?
| return {/*support_manual_mode=*/false, /*support_cartesian_commands=*/true}; | ||
| // Freedrive is UR's manual (gravity compensation) mode, and | ||
| // `move_to_position` provides direct cartesian commands. | ||
| return {/*support_manual_mode=*/true, /*support_cartesian_commands=*/true}; |
Contributor
There was a problem hiding this comment.
I'd drop the inline comments. This repo is C++20 so you can use designated initializer syntax here if you want to make it clear, probably:
return { .support_manual_mode. true, .support_cartesian_commands = true };
| // If we are no longer in the controlled state, the control script has | ||
| // already left freedrive (or is gone entirely); clearing our tracking | ||
| // above is all there is to do. | ||
| if (auto* const controlled = std::get_if<state_controlled_>(¤t_state_)) { |
Contributor
There was a problem hiding this comment.
It is more work, but the right way to do this is to delegate to the states.
| // MODE_FORWARD message would knock the control script out of freedrive) | ||
| // and enforces `freedrive_deadline_`, the automatic exit time, when set. | ||
| bool freedrive_active_{false}; | ||
| std::optional<std::chrono::steady_clock::time_point> freedrive_deadline_; |
Contributor
There was a problem hiding this comment.
Can you not use the deadline to know whether you are active or not? Do you also need the bool?
| } | ||
|
|
||
| void URArm::state_::send_noop_() { | ||
| if (handle_freedrive_()) { |
Contributor
There was a problem hiding this comment.
This makes me think that freedrive should be its own state?
Nicolas Menard (npmenard)
force-pushed
the
RSDK-14465-implement-manual-mode-api
branch
from
September 11, 2026 19:01
00de455 to
ed83caf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack created with GitHub Stacks CLI • Give Feedback 💬