Trash Picking Sample

This example demonstrates the basic interaction process between the Quanta X1 SDK Client and the inference service: reading robot status and camera data, sending observations and task instructions to the inference service, receiving action sequences, and controlling the robot via the SDK to perform trash picking tasks.

Sample code

https://github.com/X-Square-Robot/sdk_robot/tree/main/samples/quanta_x1

External environment

Place the robot on an open, flat ground without obstacles, and place the trash can and the trash to be picked up in front of the robot. Confirm that sufficient space is reserved around the robot for movement and robotic arm operation, and ensure that the emergency stop is accessible at all times.

Network connection

According to the current SDK standard network configuration, connect the development PC to the robot using an Ethernet cable, and configure the robot-side wired interface of the development PC to 192.168.10.10/24.

The sample in this document uses the following robot network configuration:

  • Robot wired IP: 192.168.10.1

  • Robot SDK Server: 192.168.10.1:50051

Before running the sample, please confirm that the robot and the SDK Server are reachable:

ping 192.168.10.1
python3 check_connect.py --server 192.168.10.1:50051

The sample also needs to access the model inference service ws://<INFERENCE_SERVER_IP>:<PORT>. The development PC can connect to the robot via a wired network while accessing the model service via Wi-Fi or another network, but you must ensure that the two network routes do not conflict. The sample is not responsible for configuring system routes, selecting network cards, or performing network failover.

Software environment

Run in the SDK repository root directory:

cd /path/to/sdk_robot
source .venv/bin/activate
python -m pip install -r samples/quanta_x1/requirements.txt
Run the Example

Replace the inference service address and port with the actual values provided by the service publisher. The robot SDK Server address is explicitly passed via the 6th positional parameter:

INFERENCE_SERVER_IP='REPLACE_WITH_CONFIRMED_IP_OR_HOST'
INFERENCE_SERVER_PORT='REPLACE_WITH_CONFIRMED_PORT'

bash samples/quanta_x1/scripts/start_sdk_ex001.sh \
  "$INFERENCE_SERVER_IP" \
  "$INFERENCE_SERVER_PORT" \
  "Move and pick up the garbage around the trash can and put it into the trash can." \
  end_pose \
  10 \
  192.168.10.1:50051

The six positional parameters of start_sdk_ex001.sh are, in order:

MODEL_ADDRESS
MODEL_PORT
INSTRUCTION
CONTROL_MODE
INTERPOLATE_MULTIPLIER
ROBOT_SDK_URL
  • MODEL_ADDRESS: IP address or domain name of the model inference service.

  • MODEL_PORT: Actual listening port of the model inference service.

  • INSTRUCTION: Task instruction sent to the model.

  • CONTROL_MODE: The example uses end_pose, indicating end-effector pose control.

  • INTERPOLATE_MULTIPLIER: 10 in the example is the action interpolation multiplier, not the number of executions.

  • ROBOT_SDK_URL: Robot SDK Server address in the format of host:port, without adding the x2:// prefix. When omitted, the script uses 192.168.10.1:50051 by default.

The inference service port is not a fixed SDK constant. Please use the current port confirmed by the service publisher, and do not continue using 40189 from historical documents.

Modify the robot IP

If the robot does not use the default address 192.168.10.1, please adjust the robot-side network configuration on the development PC accordingly, and pass the actual SDK Server address via the 6th positional parameter of the startup script.

For example, if the robot SDK Server is modified to 192.168.10.2:50051:

bash samples/quanta_x1/scripts/start_sdk_ex001.sh \
  "$INFERENCE_SERVER_IP" \
  "$INFERENCE_SERVER_PORT" \
  "Move and pick up the garbage around the trash can and put it into the trash can." \
  end_pose \
  10 \
  192.168.10.2:50051

Note: Do not attempt to override the script's default values using environment variables with the same name. For example, the following syntax will not modify ROBOT_SDK_URL:

ROBOT_SDK_URL=192.168.10.2:50051 \
  bash samples/quanta_x1/scripts/start_sdk_ex001.sh \
  "$INFERENCE_SERVER_IP" \
  "$INFERENCE_SERVER_PORT" \
  "INSTRUCTION" \
  end_pose \
  10

When the robot SDK Server address needs to be modified, always pass it explicitly via the 6th positional parameter.

Running instructions
  • The script will connect to both the model inference WebSocket and the robot SDK Server.

  • After startup, the script will switch the robot to the SDK operating mode and initialize the relevant control modules.

  • Clear irrelevant personnel and obstacles around the robot before running, and operators should be ready to stop the robot at any time.

  • If the inference service or SDK connection is disconnected, first confirm that the robot has safely stopped before troubleshooting the model service, robot SDK Server, and system network routing.

  • Rerunning the script will establish a new client session. The current sample does not implement persistence and recovery of the previous inference process, so automatic resumption from the point of interruption cannot be guaranteed.

On this page