Capability 007: Rotation¶
Status: Accepted
Context¶
The Robot Operator turns the robot around its center from the Web App: a Rotation. As a Translation of capability 006, it repeats its Remote Drive Command for the duration the Robot Operator asks for, so that the robot stops when the Web App falls silent.
References¶
- Remote Drive Command for a rotation (
POST /v1/rotation-commands):remote_control_api.json, capability 003 of the Superordinate Controller - Repetition, response timeout, and the messages for failures: capability 006
Stopand the Event Log: capability 003- Target picture:
target_picture.md - Accessibility: directives in
user_experience.md
Details¶
Rotation Form¶
The Command Pane holds, between the box Translation and the box Safe Mode, a box of its own
with the heading Rotation, two input fields, a selection, and the button Rotate:
| Label | Values | Default | Becomes |
|---|---|---|---|
Speed (%) |
Whole number, 0 to 100 | 20 |
Magnitude of speed |
Direction |
clockwise or counterclockwise, seen from above |
clockwise |
Sign of speed: positive clockwise, negative counterclockwise |
Duration (s) |
Whole number, 1 to 10 | 2 |
Duration of the Rotation |
A field with a value outside its range shows its message below it, as for capability 006. A
direction other than clockwise or counterclockwise, e.g., from a manipulated page, shows
Direction must be clockwise or counterclockwise.
Repetition¶
A click on Rotate sends POST /v1/rotation-commands with the values of the fields at once, and
again every Repetition Interval of capability 006, until the duration has elapsed: a duration of
2 s yields 8 commands.
Event Log¶
| Event | Severity | Message |
|---|---|---|
Rotate clicked with valid values |
INFO |
Rotation started: <direction>, speed <speed> %, for <duration> s. |
| The duration elapsed | INFO |
Rotation ended. |
| A command failed | ERROR |
The message of capability 006 for the failure, with Rotation failed: in place of Translation failed: |
As for a Translation, an accepted command adds no entry.
Functional Requirements¶
- A click on
Rotatewith valid values starts a Rotation as given under Repetition, and records its start and its end in the Event Log as given under Event Log. - At most one Translation or Rotation runs at a time: a click on
RotateorTranslateends the running one and starts the new one with the current values. - A click on
Stopduring a Rotation ends it at once; no Remote Drive Command of it follows the Stop Command. - A click on
Rotatewith a value outside its range sends nothing and shows the message under the field.
Non-Functional Requirements¶
None; the Rotation shares the repetition of the Translation, whose timing capability 006 measures.
Technical Requirements¶
None.
Error Handling¶
- As for capability 006: the first failed command ends the Rotation and is an
ERRORentry; the Web App never retries on its own. - The Web App checks every value before it sends a command, even that of the selection. The Superordinate Controller validates every command on its own and answers an invalid one with 400 (its capability 003), so the Remote Control API stays safe without the Web App.
Out of Scope¶
- A Translation and a Rotation at once, e.g., to drive a curve
- Showing the remaining time of a Rotation
- Steering with keyboard or joystick, or changing the values of a running Rotation
Acceptance Criteria¶
All criteria except the last run against a mocked Remote Control API, with a mocked clock where time matters.
- Page loaded: the box
Rotationstands between the boxesTranslationandSafe Mode, and shows20,clockwise, and2. - Speed 20, clockwise, duration 2,
Rotateclicked, the API answers 202: 8POST /v1/rotation-commandswith{"speed": 20}are sent within 2 s, none after; the Event Log showsINFORotation started: clockwise, speed 20 %, for 2 s., thenINFORotation ended.on top. - Speed 30, counterclockwise,
Rotateclicked: every command carries{"speed": -30}. - Duration 2,
Rotateclicked,Stopclicked 1 s later: the Stop Command is sent, and no Remote Drive Command after it. Translateclicked,Rotateclicked 1 s later: noPOST /v1/drive-commandsfollows the click onRotate; and the other way round, noPOST /v1/rotation-commandsfollows a click onTranslate.Rotateclicked, the API answers the third command with 503: no fourth command is sent, and the newest entry isERRORRotation failed: the robot is unavailable (<detail>). Check the CAN Adapter of the Superordinate Controller.Rotateclicked with speed101or empty, or duration0or11: no command is sent, and the field shows its message.- On the lifted robot, at speed 20, for 2 s each, clockwise and counterclockwise: the wheels
turn the robot as seen from above, and stop within 1 s after the duration (manual test
test/manual/robot.md).
Decisions¶
- The direction is a selection, the speed stays positive. The Robot Operator thinks in turning left or right, not in signed numbers; the Web App maps the selection to the sign the Remote Control API expects. Consequence: the speed field takes the same values as for a Translation.
- A new movement replaces the running one. Two movements at once would send conflicting Remote Drive Commands, each overriding the other at the Superordinate Controller. Consequence: a curve is not possible.