1import os
2os.environ["PRISMATIC_DATA_ROOT"] = "./"
3os.environ["TOKENIZERS_PARALLELISM"] = "false"
4
5from prismatic.models import load_vla
6from deploy.mybot_deploy import MyBotDeploy
7
8# 1. Load model
9vla = load_vla("purplehihi/minivla-myCobot280pi-task2-v6", hf_token="dummy")
10
11# 2. Load deployment controller
12deploy = MyBotDeploy(stats_path="dataset_statistics.json")
13deploy.set_current_encoders(current_encoders) # from robot
14
15# 3. Per-frame inference
16action = vla.predict_action(image, instruction, unnorm_key="mycobot_task2")
17encoders, gripper_pwm, info = deploy.step(action)
18robot.send_angles(encoders.tolist(), speed=50)
19robot.set_gripper(gripper_pwm)
VLA output [dx,dy,dz,droll,dpitch,dyaw,gripper]
→ unnormalize (BOUNDS: q01/q99)
→ current EEF + delta = target EEF
→ numerical IK (damped least squares)
→ 6 joint angles → motor encoders
→ gripper [0,1] → PWM [0,100]
The IK uses damped least squares (Levenberg-Marquardt) with numerical Jacobian.
Accuracy: ~0.3mm position, ~0.2° orientation (100 random tests).