Use asFinger for a user
This page is for an agent that builds or edits a tool config for a person.
Install
Section titled “Install”git clone https://github.com/asEmbodiedAISyst/asFinger.gitcd asFingerpython3 -m pip install .- The package needs Python 3.11 or later.
- The import name is
asfinger(lowercase). The command isasfinger. - The configs are in
hardware/configs/. The meshes they import are inhardware/assets/.
Entry points
Section titled “Entry points”| Entry point | Function |
|---|---|
asfinger build CONFIG -o OUT |
Write STL, MJCF, preview, resolved.json and report.json to OUT. |
asfinger frames CONFIG |
Print the pose of each frame. |
--set NAME=VALUE |
Change a parameter for this run. Repeat the flag for more parameters. |
--option NAME=0 or NAME=1 |
Switch an option for this run. |
--resolve |
Run the solvers again. Without --set and --option, this also rewrites the config file. |
from asfinger import Model |
The Python interface. |
Common calls
Section titled “Common calls”Build the default tool:
asfinger build hardware/configs/iphone17pro_default.json -o out/defaultBuild a variant and keep the config file unchanged:
asfinger build hardware/configs/iphone17pro_default.json -o out/variant --resolve --set rod_L=160 --set rod_tilt=25Get the TCP pose and the test results in Python:
from asfinger import Model
m = Model.load('hardware/configs/iphone17pro_default.json').set(rod_L=160)R = m.resolve(resolve=True) # solve again after a parameter changetcp = m.root_to('T_tcp', R) # pose in the root frame F_robotprint(tcp.p, tcp.quat()) # mm, [w, x, y, z]print(m.check(R, lang='en')) # [] = no failed checkprint(m.interference(R, lang='en')) # [] = no overlapm.build('out/rod_160', resolve=True)Save a changed config as a new file:
m.cfg['name'] = 'my_variant'm.save('hardware/configs/my_variant.json')Inputs and outputs
Section titled “Inputs and outputs”- Input: one JSON config. The format is in The config file and Frames.
- Units: millimetres, degrees, g/cm³. The MJCF file is in metres. Quaternions are
[w, x, y, z]. Model.frames()returns(world, local, info).world[name]is a pose with.p(position),.R(3×3 matrix) and.quat().Model.build(out_dir)returns(resolved, report)and writes the files listed in Quick start.Model.check()andModel.interference()return lists of strings. An empty list means that no test failed.- Errors:
KeyErrorfor an unknown parameter or option,asfinger.expr.ExprErrorfor a bad expression,ValueErrorfor a bad frame tree or a mesh that is not a closed solid,FileNotFoundErrorfor a missing mesh.
- After you change a parameter, pass
--resolve(command line) orresolve=True(Python). Without it, the phone pose is stale and the checks are not valid. - Before you tell the user that a variant is ready to print, confirm that
check()andinterference()return empty lists and that each print set inreport.jsonhas"bodies": 1,"groups": 1and an empty"face_only". - If a test fails, report the message and the rule name to the user. Do not raise
tol_mm3or remove a rule to make it pass. - Do not run
asfinger build ... --resolvewithout--seton a config inhardware/configs/unless the user asks you to update that file. That command rewrites the file. - Write a variant to a new file. Do not overwrite
iphone17pro_default.jsonorrebot_rs_flange.json. - Keep a config in a folder that has
assets/as its neighbour. Mesh paths in a config are relative to the parent of the config folder. - Before you share
resolved.json, remove the keybase_dir. It contains a local path. - Use
asfinger sendonly when the user asks for it and runs the Fusion add-in. The command changes the design that is open in Fusion, and--saverewrites the config file. It does not return the result: ask the user what the palette shows. - Tell the user about the limits that apply to their request. The pages Checks and interference rules and Frames list them.
back_to_mountmust match the phone case of the user. - When the user describes a tool in words (a spoon, a hook, a scoop), read Design a tool from a request. If you are the model, run
asfinger design --prompt, write the brief yourself and build it withasfinger design --brief; with the MCP serverasfinger-mcp, calldesign_guideandbuild_designinstead. Tell the user the warnings indesign.jsonand the value ofmatch. - If the user has no Python environment, send them to the web editor.
- The scripts in
robot/control a real arm. Read Arm tools and safety rules before you use them for a user. Run a tool with--simfreely. Run a command that connects to the real arm or to a phone only when the operator is at the arm, has heard what will happen, and agrees. After a program failed, runrobot/arm stateand tell the user if the motors are still enabled.