Skip to content

ARKit phone teleop for the arm, and a sim that the app can find - #740

Draft
DavidDobas wants to merge 6 commits into
mainfrom
feat/arkit-teleop
Draft

ARKit phone teleop for the arm, and a sim that the app can find#740
DavidDobas wants to merge 6 commits into
mainfrom
feat/arkit-teleop

Conversation

@DavidDobas

Copy link
Copy Markdown
Collaborator

Summary

Two things the controller app needs from the OS, on the real robot and in the sim:

Phone teleop (ARKit)arm_sdk_server gains /armsdk/stream_pose (std_msgs/String JSON {session, x, y, z, qx, qy, qz, qw}): a 6-DoF end-effector delta in base_link axes relative to the arm's pose when the operator pressed the button. A latest-wins follower anchors on the live /fk_pose the first time a session is seen, composes anchor ⊕ delta, solves IK through the existing /ik_delta node and feeds Manipulation.stream_joints; it reports idle|following|unreachable|refused on /armsdk/stream_pose/status. Manipulation.stream_pose() is the one-tick IK→stream step. The IK node logs each solve at debug (30 Hz would flood) and keeps the current-posture solution when it already fits, so a streamed target doesn't hop IK branches.

Sim discovery/robot/info carries simulation: true in the container. The host world server runs a LAN beacon on udp/19090 (broadcast, plus unicast replies to app probes); the launcher passes it the published ports, data/robot_info.json and the git version, and restarts a world server that isn't announcing. INNATE_SIM_BEACON=0 opts out.

Companion app PR: innate-inc/innate-controller-app (ARKit control screen, sim-aware camera/WebRTC, discovery).

Testing

  • Sim: streamed +5/0/+3 cm from a working pose landed at +5.0/0.0/+2.8; a second press with 0/−3/0 cm + 0.3 rad pitch landed at 0.0/−3.0/−0.2 relative to the new pose; status transitions following → idle per session; move_to via the action unaffected.
  • Beacon exercised standalone (broadcast, probe → unicast reply, live rename); /robot/info over rosbridge shows simulation: true in the sim.
  • ruff + format clean; brain_client pytest 282 passed; launcher tests 67 passed; no new basedpyright errors in touched files.
  • Real-robot run of the teleop is still pending.

/robot/info now carries simulation=true (the CLI's /.dockerenv rule), so the
app can skip WebRTC and tag the robot. The host world server runs a LAN
discovery beacon (udp/19090: broadcast + unicast replies to probes, on the
sender's port and the port the probe declares); the launcher passes it the
published ports, the robot-name file and the checkout version, and restarts
a world server that is not announcing.
@axelpey axelpey added the 0.7.5 label Sep 3, 2026
…t arm state

Gripper and joint-space commands read the measured arm; issued right after a
park they raced the feeds coming back and were refused with "No arm state
available" — the first tap after a minute of idling always failed.
/armsdk/stream_pose gains "grip" (0 closed … 1 open); the follower streams it
as j6 alongside the IK joints, so the operator's thumb drives the claw through
the same velocity-clamped slew as the arm and the last value becomes the
standing grip when the stream ends. Absent, the standing grip is kept.
The LMA solver has no notion of limits; from a folded posture it returned
joints past their range that the driver then clamped silently, so a small
requested step moved the arm somewhere else entirely (a +3 cm lift from
rest went 4 cm down in the sim). Out-of-range solutions are now dropped per
seed, and a target with none left is reported as unreachable — which the
pose follower shows the operator — instead of being mis-executed.
…t seed tried

on_delta stored q_out — the last seed's raw result, None when that seed's
solve failed — as the seed for the next solve. With the current posture
succeeding and the zero seed failing (the edge of reach, where teleop lives)
the node kept None and crashed on the next /mars/arm/state message. Seed
with best_solution; and respawn the IK node so a crash cannot leave the arm
without IK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants