Go to file
lgv fb9f589446 feat: add Xiaozhao robot controls and refresh AprilTag assets
Add Xiaozhao arms and head models, device selection, and fresh GetPose queries
with configurable end links. Reset polling, commands, and plots on device changes.

Expose MoveJ jerk and joint zero calibration, improve joint naming and plot
handling, and cover model switching and request lifecycles with regression tests.

Update AprilTag generation to default to PDF and include the refreshed exports,
model meshes, and existing workspace artifacts.
2026-11-18 20:19:14 +08:00
.idea feat : add touch ui 2026-06-17 09:36:26 +08:00
clients feat: add Xiaozhao robot controls and refresh AprilTag assets 2026-11-18 20:19:14 +08:00
generated feat:Sync client with server-side gRPC updates 2026-06-24 15:49:54 +08:00
generated_apriltags_svg_check feat : add touch ui 2026-06-17 09:36:26 +08:00
output/pdf feat: add Xiaozhao robot controls and refresh AprilTag assets 2026-11-18 20:19:14 +08:00
protos/cmvr feat:Sync client with server-side gRPC updates 2026-06-24 15:49:54 +08:00
robot_model feat: add Xiaozhao robot controls and refresh AprilTag assets 2026-11-18 20:19:14 +08:00
scripts feat: add Xiaozhao robot controls and refresh AprilTag assets 2026-11-18 20:19:14 +08:00
tests feat: add Xiaozhao robot controls and refresh AprilTag assets 2026-11-18 20:19:14 +08:00
ui feat: add Xiaozhao robot controls and refresh AprilTag assets 2026-11-18 20:19:14 +08:00
actions.json feat:add generate js scripts 2025-12-17 14:03:31 +08:00
generate_json.py feat:add generate js scripts 2025-12-17 14:03:31 +08:00
README.md feat: add Xiaozhao robot controls and refresh AprilTag assets 2026-11-18 20:19:14 +08:00
requirements.txt feat : add touch ui 2026-06-17 09:36:26 +08:00
run_client.py feat:add readme.txt 2026-02-03 13:36:52 +08:00

grpc_client

Environment

  • Python: 3.9.25

Setup

python -m pip install -r requirements.txt

Use the same Python interpreter you run the clients with. For example:

C:\Users\lgv\miniconda3\envs\grpc_client\python.exe -m pip install -r requirements.txt

Troubleshooting

If you encounter the following error:

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in ".../site-packages/cv2/qt/plugins"

run:

pip uninstall opencv-python opencv-contrib-python -y
pip install opencv-python-headless

Generate gRPC code

From repo root:

python scripts/gen_grpc_py.py

This reads .proto files under protos/ and writes Python code to generated/.

Run (module mode)

python -m clients.movej_client
python -m clients.get_joint_state_client
python -m clients.get_pose_client
python -m clients.torque_on_client
python -m clients.torque_off_client
python -m clients.torque_key_client
python -m clients.save_joint_to_csv
python -m clients.http_server
python -m clients.hlc_client

UI (PyQt)

python -m ui.app

Select Settings → Robot Model for the robot in use. The UI remembers the selection and shows its URDF path:

Robot Model URDF Default GetPose links
xiaoyan (initial default) robot_model/xiaoyan_description/dual_arm.urdf PELVIS_S → R_FINGER_TIP
xiaozhao robot_model/xiaozhao/urdf/xiaozhao.urdf base_link → tcp-right

Settings → Device ID is a device dropdown populated from the configured joint groups present in the selected URDF. xiaoyan offers right_arm / left_arm; xiaozhao offers xiaozhao_right_arm / xiaozhao_left_arm / xiaozhao_head. These service IDs are mapped in ui/robot_models.py. Selecting a device updates the GetPose end link (L_WRIST_R_S for xiaoyan's left arm, tcp-left for xiaozhao's left arm) and uses that device ID for commands and polling. Xiaozhao's Head / Neck device has neck-joint1, neck-joint2, and neck-joint3 in that order, with GetPose defaults base_link → neck_Link3. Its joints are included in the joint status, MoveJ, SpeedJ, and plot lists; selecting it also sets the MoveL pose-query EE Link to neck_Link3. Changing the robot model keeps the selected joint group when available and falls back to the right arm otherwise; startup defaults to the right arm.

Switching refreshes Joint Status, MoveJ, SpeedJ, plots, and GetPose link choices from the selected URDF. Fixed joints are excluded from joint commands. It also stops JointState/GetPose polling and clears previous samples, selected joints, and command targets; changing the selected device clears this data as well. Start polling again after selecting the robot/device and setting Host and Port. URDF load errors appear in Log and keep the previous model active. The UI reads joint/link metadata without loading mesh files.

In Motion → MoveL, select EE Link (GetPose) and click Fill Current Pose to make one fresh GetPose request using the current Host, Port, Device ID, and the Base Link selected in the GetPose panel. Continuous GetPose polling is optional. A successful response fills all six pose fields; a failed request keeps their previous values. Changing the robot, device, address, or query links cancels any pending request. The EE Link defaults to the selected device's endpoint and is used only for this pose query. The filled coordinates are relative to the chosen Base Link; the MoveL command's Frame selection is retained.

Runtime parameters

  • gRPC server address/port: set in clients/base_client.py (default 192.168.0.222:50052).
  • HTTP server host/port: set in clients/http_server.py (default 0.0.0.0:8000).
  • Standalone clients default to right_arm; the UI uses the selected model's arm IDs listed above.
  • UI parameters (host/port/device_id/interval) are set in the PyQt window and passed to the runner.