Repository navigation
mjguard 0.4.0: human-robot interaction
Human-robot interaction: a UI, phone app or voice front end can sit on top of mjguard. Everything below goes through
the same plan, check, follow and monitor path; nothing widens the envelope.
- Preview, then confirm:
preview=trueon every motion tool returns a checked plan (plan_id, duration, clearance,
obstacle gap, start and end tool pose, a downsampled tool path) without moving.execute(plan_id)runs it once,
within 60 s, if the measured arm is still at its start, after checking the waypoints again from the measured arm.
New codesPLAN_UNKNOWN,PLAN_USED,PLAN_EXPIRED,PLAN_STALE.--require-confirmation/[ui] require_confirmationmakes every motion tool preview only. - Jog:
jog(dx, dy, dz)(straight line, at most 50 mm) andjog_joint(joint, delta)(at most 10° or 10 mm). - Named poses:
save_pose,go_to_pose(gripper only withinclude_gripper=true),list_poses,delete_pose,
--poses FILE. A stored pose is only a target, checked against the envelope in force when you go there.
POSE_UNKNOWN. - Pause and resume:
pause()keeps the remaining waypoints,resume()re-checks from the measured arm and continues
or refuses and stays paused (PAUSED,NOTHING_TO_RESUME);stop()discards a paused motion. - Events: an in-process bus (
motion_started,progress,motion_finished,refused,stopped,paused,
resumed,breach,pose_saved,pose_deleted),mjguard://events/latest, andGET /eventsserver-sent
events over HTTP, with the MCP endpoint's Host/Origin checks. message_humanon every refusal and ahumansentence on suggestions, in--lang enorzh-TW([ui] lang).- Refusal details carry
limit_mmfor clearance refusals; suggestions carryfraction. - Callback subscribers run on their own thread, so a slow or failing callback can never delay a stop or a breach
halt (test: a callback that sleeps 1 s per event does not slow a stop).events.flush()waits for them. - A new motion that replaces a paused one says so:
discarded_paused_motion: truein its result. - Confirmation and pause are protocol steps, not authorization: any client of the server can call
executeor
resume. Put authentication in front of the server if people and agents share it.