Target Go — Python Example
Source: rbq_sdk/python/example/sport/rbq_target_go.py
Python port of the C++ Target Go. Commands the robot to walk to a target pose (x, y, heading) with a chosen gait by publishing a single TargetGo message on rt/rbq/cmd/target_go.
How it works
- Reads
interfaceand optionalx y theta gait modefrom the command line. - Calls
ChannelFactoryInitialize(0, interface), then createsChannelPublisher("rt/rbq/cmd/target_go", TargetGo_). - Waits ~0.5 s for DDS discovery, fills the
TargetGo_message, publishes once, prints what it sent, and exits.
The on-robot QuadWalk locomotion engine subscribes to the topic and executes the walk.
Prerequisites
rbq_sdk_pyimportable — see Python SDK Overview.- Robot stack running (simulator or hardware) on the same DDS interface.
- The robot must be powered on / in control and standing first. Otherwise QuadWalk rejects the command with
Can't Receive cmd: CON_START first.
Run
bash
cd RBQ/rbq_sdk/python/example/sport
python3 rbq_target_go.py <networkInterface> [x] [y] [theta_deg] [gait] [mode]
# simulator, 1 m forward with wave gait:
python3 rbq_target_go.py lo 1.0 0.0 0.0 0 0Arguments, gaits and modes are identical to the C++ version. Use the same interface as the running robot/sim (see the Image Echo interface note — lo is often not multicast-capable).
Example output
[rbq_target_go] published: gait=0 mode=0 x=1.0 y=0.0 theta=0.0Verified against the MuJoCo simulator — QuadWalk receives the command on rt/rbq/cmd/target_go (it logs Can't Receive cmd: CON_START first until control is started, then walks).
