Skip to content

Read velocity command range from ONNX metadata with config override #90

@kingb

Description

@kingb

Summary

Ros2VelocityInput._callback() currently hardcodes the velocity clamp range to [-1, 1]:

self.policy.lin_vel_command[0, 0] = max(-1.0, min(1.0, msg.twist.linear.x))

The training range may differ per model. This should follow the same resolution pattern as KP/KD:

  1. ONNX metadata — read vel_range (or similar) from model metadata
  2. Config/CLI override--task.velocity-range to explicitly set the range
  3. Default — fall back to [-1, 1] if neither source provides a value

Context

Introduced in PR #89 (input provider model). The clamp values are correct for current models but should be configurable for future ones.

Acceptance criteria

  • Velocity clamp range read from ONNX metadata when available
  • Config/CLI override takes precedence over ONNX metadata
  • Default to [-1, 1] when neither is provided
  • Applied in Ros2VelocityInput._callback() (and any future velocity providers that need clamping)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions