Downloads · 30 days
0
lz15254123876/RoboChallengeInference-PI0
RoboChallengeInference-PI0 is a machine learning model from lz15254123876. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
demo.py now contains a PI0/OpenPI inference policy. The default backend expects the same OpenPI runtime used for training to be installed in the environment.
Downloads · 30 days
0
Access
Public
Updated Jun 5, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py60.8 KB · 57%
From the Hugging Face model README
- RoboChallengeInference/
- README.md
- requirements.txt
- demo.py
- test.py # Main test entry script
- robot/
- __init__.py
- interface_client.py
- job_worker.py
- mock_server
- mock_rc_robot.py
- mock_robot_server.py
- mock_settings.py
- utils.py
- utils/
- __init__.py
- enums.py
- log.py
- util.py
# Clone the repository and checkout the specified branch
git clone https://github.com/RoboChallenge/RoboChallengeInference.git
cd RoboChallengeInference
# (Recommended) Create and activate a virtual environment to avoid polluting your global Python environment
python -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Checkout
git checkout -b my-feature-branch
# Follow the instructions in demo.py to modify parameters and implement your custom inference logic based on DummyPolicy.
# Open the mock_settings.py file and set the ROBOT_TAG and RECORD_DATA_DIR variables according to your robot and data directory requirements.
# Notes:
# Only one pair of ROBOT_TAG and RECORD_DATA_DIR should be active at a time.
# Ensure that the RECORD_DATA_DIR path matches the structure of your data folder.
# You can find the appropriate ROBOT_TAG in your training data or on our website.
# Start the test service
python3 mock_robot_server.py
# Use test.py for testing; it will automatically invoke the mock interface to help you debug your model
# Replace {your_args} with the actual parameters you want to test, for example: --checkpoint xxx.
python3 test.py {your_args}
demo.py now contains a PI0/OpenPI inference policy. The default backend expects the same OpenPI runtime used for
training to be installed in the environment.
Local mock test:
python3 test.py \
--checkpoint /path/to/checkpoint \
--pi0_config your_training_config_name \
--prompt "your task instruction" \
--input_preset auto \
--action_type joint
Run for RoboChallenge evaluation:
python3 demo.py \
--user_token <your_user_token> \
--submission_id <submission_id> \
--checkpoint /path/to/checkpoint \
--pi0_config your_training_config_name \
--prompt "your task instruction" \
--input_preset auto \
--action_type joint
Useful options:
--action_type: use joint for Aloha dual-arm; use leftjoint or leftpos for Arx5/Ur5/Franka single-arm robots.--image_type: comma-separated camera list, default is high,left_hand,right_hand.--action_horizon: how many model actions to post each inference step, default is 8.--max_delta: optional per-step action clamp; 0 disables it.--backend identity: repeats the current robot state as actions. Use this only for API/shape testing, not evaluation.--backend custom --custom_policy my_pkg.policy:create_policy: use your own factory if your PI0 training code is not OpenPI-compatible.Once your task has been executed, you can view the results by visiting the "My Submissions" page on the website.
This is the direct interface for the robot.
The base URL is /api/robot/<id>/direct. For example, if the robot ID is 1, the full URL to get the state is
/api/robot/1/direct/state.pkl.
Endpoint: /clock-sync
Method: GET
None
{
"timestamp": 0.0
}
| Field | Type | Description |
|---|---|---|
| timestamp | float | unix timestamp on the robot |
Endpoint: /state.pkl
Method: GET
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| width | integer | No | 224 | Width of the image |
| height | integer | No | 224 | Height of the image |
| image_type | list of str | Yes | None | Camera positions; can be one or more of left_hand, right_hand, high |
| action_type | str | Yes | None | Control mode; must be joint or pos, and can optionally be concatenated with left or right. All possible options are joint, pos, leftjoint, leftpos, rightjoint, rightpos. The value should remain consistent during a job. Usually this is consistent with the parameter in Post Action. See the Robot specific Notes section for detailed information. |
Additional notes on camera positions:
For a dual-arm robot, left_hand and right_hand refer to the cameras mounted on the left and right arms,
respectively. The high camera is positioned above the robot, providing a top-down view of the workspace.
For a single-arm robot, left_hand always refers to the camera mounted on the arms. right_hand is on the opposite
side of the robot, and high is on the right side of the robot.
Some single-arm robots may lack cameras on the arm or right side. left_hand or right_hand are not available for
those robots. See the Robot specific Notes section for detailed information.
The response is a pickle file containing a dictionary with the following structure:
{
"state": 'normal',
"timestamp": 0.0,
"pending_actions": 10,
"action": [0.0, 0.0, ..., 0.0],
"images": {
"high": b'PNG',
"left_hand": b'PNG',
"right_hand": b'PNG'
}
}
| Field | Type | Description |
|---|---|---|
| state | string | Robot state. Should be normal if the robot is operational. If the value is fault or abnormal, there is an issue with the robot. If the value is size_none, the request parameter image_type or action_type is missing. |
| timestamp | float | Unix timestamp on the robot |
| pending_actions | integer | Number of pending actions in the queue |
| action | list of float | Current robot joint or position values. If action_type in the request contains joint, the joint values will be returned. If it contains pos, the tool end positions will be returned. If it contains left or right, only the values for the left or right arm will be returned. If neither is specified, values for both arms will be returned. For example, if the robot is Aloha with two arm, the list consists with [joints of left arm, gripper of left arm, joints of right arm, gripper of right arm]. See the Robot specific Notes section for detailed information. |
| images | dict | Dictionary of images. Only includes camera positions specified in the image_type request parameter. |
| images.high | bytes | PNG image bytes, if present |
| images.left_hand | bytes | PNG image bytes, if present |
| images.right_hand | bytes | PNG image bytes, if present |
Endpoint: /action
Method: POST
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| action_type | str | Yes | None | Control mode. All possible options are joint, pos, leftjoint, leftpos, rightjoint, rightpos. The value should remain consistent during a job. See the Robot specific Notes section for detailed information. |
The HTTP body should be a JSON object with the following structure:
{
"actions": [
[
0.0,
0.0
],
[
0.0,
0.0
],
[
0.0,
0.0
]
],
"duration": 0.0
}
| Field | Type | Description |
|---|---|---|
| actions | 2D float list | Target joint or position values. If action_type in the request contains joint, the target values control the robot joints. If it contains pos, the tool end positions will be controlled. If it contains left or right, only the left or right arm will be controlled. If neither is specified, both arms will be controlled. The shape of the array is (number of actions, target values per action). For example, if you are using ALOHA and action_type is joint, then the shape of the actions array should be (N, 14): 6 joints and 1 gripper per arm, N is the number of steps your model infers. See the Robot specific Notes section for detailed information. |
| duration | float | Duration (second) per action |
{
"result": "success",
"message": ""
}
| Field | Type | Description |
|---|---|---|
| result | string | Result of the request. Only success or error will be returned. |
| message | string | Reason for error result, if any. possible message: the robot is not running (fault or logging), the action shape is wrong, action queue is full, other exception |
Different robots have different action shapes and camera placement.
Aloha
[6 joints, 1 gripper][left 6 joints, left 1 gripper, right 6 joints, right 1 gripper][x, y, z, quaternion(xyzw), gripper][left x, left y, left z, left quaternion(xyzw), left gripper, right x, right y, right z, right quaternion(xyzw), right gripper]Arx5
[6 joints, 1 gripper][x, y, z, roll, pinch, yaw, gripper]left in the action_type parameter, e.g., leftjoint or leftpos.Ur5
[6 joints, 1 gripper][x, y, z, quaternion(xyzw), gripper]left in the action_type parameter, e.g., leftjoint or leftpos.Franka
[7 joints, 1 gripper][x, y, z, quaterion(xyzw), gripper]left in the action_type parameter, e.g., leftjoint or leftpos.For official inquiries or support, you can reach us via: