robonix.primitive.lynx_chassis
primitive
v0.0.2
TODO: describe what this primitive package provides.
DeepRobotics Lynx S10 Chassis Primitive for Robonix
This repository provides a Robonix chassis Primitive for the DeepRobotics Lynx S10 wheeled quadruped. It converts standard robonix/primitive/chassis/move requests into Lynx UDP control commands and selects ratio-based or direct-value control through deployment configuration.
Upper-layer Skills always send generic distance or angle commands and do not need to know the Lynx control protocol or calibration parameters.
Features
- Provides the standard
robonix/primitive/chassis/movegRPC capability. - Supports
forward_m,rotate_deg, and direct three-axis control values. - Selects the underlying Lynx control method at startup through
control_mode: ratio: uses ratio-basedMotion_Ctrl.direct: uses direct-valueReal_Motion_Ctrl.- Sends UDP control packets periodically at
ctl_hzfor the requested duration. - Supports
dry_runfor inspecting converted actions without connecting to the robot. - Makes the robot stand during initialization and sit during normal shutdown before releasing UDP resources.
Capability
| Contract | Transport | Description |
|---|---|---|
robonix/primitive/chassis/move |
gRPC | Executes one time-bounded chassis motion |
The request uses the standard Robonix MoveCommand and supports these fields:
| Field | Unit or range | Description |
|---|---|---|
forward_m |
metres | Open-loop forward or backward distance |
rotate_deg |
degrees | Open-loop in-place rotation; direction can be adjusted with yaw_sign |
linear_x |
Depends on control_mode |
Direct X-axis control value |
linear_y |
Depends on control_mode |
Direct Y-axis control value |
angular_z |
Depends on control_mode |
Direct yaw control value |
duration_sec |
seconds | Duration for direct control values; a non-positive value uses default_dur |
forward_m and rotate_deg cannot both be non-zero. Distance and angle fields take precedence over direct control fields. If all motion fields are zero, the request is treated as a noop and no UDP packet is sent.
The response field status.data contains a JSON string. For example:
{
"status": "done",
"dry_run": false,
"udp_sent": true,
"action": {
"mode": "forward",
"mc_type": "Motion_Ctrl",
"x": 0.3,
"y": 0.0,
"yaw": 0.0,
"dur": 1.0
}
}
Control modes
ratio
The ratio mode uses Lynx Motion_Ctrl:
forward_musesforward_ratioas the X-axis ratio and calculates duration withforward_sec_per_meter.rotate_degusesturn_ratioas the yaw ratio and calculates duration withturn_sec_per_degree.- Direct
linear_x,linear_y, andangular_zvalues are interpreted as ratios in[-1, 1].
With the default configuration, forward_m: 0.25 is converted to:
Motion_Ctrl: X=0.30, Y=0.00, Yaw=0.00, duration=1.00s
direct
The direct mode uses Lynx Real_Motion_Ctrl:
forward_musesmove_vas the open-loop linear velocity. Duration isabs(forward_m) / move_v.rotate_degusesturn_was the open-loop angular velocity. Duration isabs(radians(rotate_deg)) / turn_w.- Direct three-axis values are passed unchanged as
Real_Motion_Ctrlvalues.
With the default configuration, forward_m: 0.25 is converted to:
Real_Motion_Ctrl: X=0.20, Y=0.00, Yaw=0.00, duration=1.25s
Requirements
- A DeepRobotics Lynx S10 configured to accept SDK control.
- Network connectivity between the host running the Primitive and the robot's UDP control endpoint.
- Python 3.10+.
- Robonix Python API and code-generated modules.
- The Lynx UDP client and protocol-packing utilities included in this repository.
Before starting, verify connectivity:
ping <robot_ip>
Also verify the robot IP address, UDP port, and vendor SDK control permissions.
Build
Run the following commands from the Primitive repository root:
rbnx validate .
bash scripts/build.sh
Run the tests and Python compilation check with:
python3 -m unittest discover -s tests -v
python3 -m py_compile lynx_chassis/main.py lynx_chassis/robot_control.py
Deployment configuration
Add the Primitive to the robot deployment repository's robonix_manifest.yaml:
primitive:
- name: lynx_chassis
path: ../primitive-deep-robotics-lynx-chassis-rbnx
config:
dry_run: true
robot_ip: 10.21.33.103
robot_port: 30004
timeout: 3.0
ctl_hz: 20.0
# ratio: Motion_Ctrl
# direct: Real_Motion_Ctrl
control_mode: ratio
# Ratio-mode parameters
forward_ratio: 0.30
turn_ratio: 0.40
forward_sec_per_meter: 4.0
turn_sec_per_degree: 0.0666667
# Direct-mode parameters
move_v: 0.20
turn_w: 0.50
default_dur: 0.50
yaw_sign: 1.0
Configuration fields:
| Field | Default | Description |
|---|---|---|
dry_run |
false |
Logs the converted action without sending UDP packets |
robot_ip |
10.21.33.103 |
IP address of the Lynx control endpoint |
robot_port |
30004 |
Lynx UDP control port |
timeout |
3.0 |
UDP socket timeout, in seconds |
ctl_hz |
20.0 |
Motion-control packet frequency, in Hz |
control_mode |
ratio |
Control mode: ratio or direct |
forward_ratio |
0.30 |
Forward magnitude in ratio mode, in the range (0, 1] |
turn_ratio |
0.40 |
Turning magnitude in ratio mode, in the range (0, 1] |
forward_sec_per_meter |
4.0 |
Open-loop forward travel time per metre in ratio mode |
turn_sec_per_degree |
0.0666667 |
Open-loop turning time per degree in ratio mode |
move_v |
0.20 |
Forward velocity in direct mode |
turn_w |
0.50 |
Angular velocity in direct mode, in rad/s |
default_dur |
0.50 |
Default duration when a direct control request omits a positive duration |
yaw_sign |
1.0 |
Yaw-direction correction; must be 1.0 or -1.0 |
Parameters for the inactive control mode are still validated during initialization and must therefore remain valid positive values.
Calibration
The relationship between control ratios, speed, and displacement depends on the robot state, floor surface, battery level, and payload. Calibrate the open-loop parameters in a clear area:
- Set
dry_run: trueand verify the command fields and directions. - Set
dry_run: falseand begin with smallforward_ratioandturn_ratiovalues. - Send a known
forward_mcommand, measure the actual distance, and adjustforward_sec_per_meter. - Send a known
rotate_degcommand, measure the actual angle, and adjustturn_sec_per_degree. - If the yaw direction is reversed, change
yaw_signfrom1.0to-1.0.
Increasing forward_ratio or turn_ratio increases instantaneous speed. Changing the per-metre or per-degree duration changes only the motion duration.
Start and verify
Run the following commands from the robot deployment repository:
rbnx build -f robonix_manifest.yaml
rbnx boot -v -f robonix_manifest.yaml
rbnx caps -v
Confirm that the capability list contains:
robonix/primitive/chassis/move
Keep the following setting for the first end-to-end test:
dry_run: true
The logs show the converted mc_type, X/Y/Yaw values, and duration. Disable dry_run and connect to the physical robot only after confirming that these values are correct.
Runtime behavior and safety
- After successful initialization, the Primitive sends the motion-state command that makes the Lynx stand.
- During shutdown, it attempts to make the Lynx sit before closing the UDP client.
- When a time-bounded motion ends, the Primitive stops periodic transmission and does not send an additional zero-valued motion packet.
- An all-zero
moverequest is anoop, not an emergency-stop command. - Distance and angle control are currently open-loop estimates based on time and do not use odometry feedback. Actual motion will contain error.
- The Primitive does not provide obstacle avoidance, collision detection, or a hardware emergency stop. Test in an open area and ensure an operator can take over at any time with the manufacturer's remote controller or emergency-stop mechanism.
License
Apache-2.0