Drive a robot arm to press buttons and move fixtures
Move a Rotrics Dexarm to press a DUT’s buttons, place a fixture, or actuate anything
a test needs a physical hand for. All coordinates are millimetres.
move_to_with_timeout(...) and move_by_with_timeout(...)
The same moves with an explicit box-side timeout in seconds, for a move that needs
longer than the default 15. The client widens its own HTTP budget to match.
enable_motor() -> Result<()> and disable_motor() -> Result<()>
Energize or release the steppers.
A released arm is back-driveable and will sag under its own weight. Do not leave
the motors disabled with the arm over a workpiece or a populated board.
Set the print, travel and retract acceleration in mm/s2 (G-code M204).Returns: what the arm reports after the change, so a value that the arm did not
take shows up. A box at 0.59.0 or older sends no readback, and the call returns None.
use lager::LagerBox;let lager = LagerBox::from_env()?;let arm = lager.arm("arm1");let led = lager.gpio("status_led");arm.enable_motor()?;arm.go_home()?;// Approach above the button, press, retract.arm.move_to(50.0, 250.0, 0.0)?;arm.move_to(50.0, 250.0, -18.0)?;std::thread::sleep(std::time::Duration::from_millis(200));arm.move_to(50.0, 250.0, 0.0)?;assert!(led.input()?.is_high(), "DUT did not register the press");arm.go_home()?;