A reference to a parameter for use in DSL fields.
Instead of providing a literal unit value in the DSL, users can reference a parameter that will be resolved at runtime. This enables runtime-adjustable configuration for values that would otherwise be compile-time constants.
Usage
parameters do
group :motion do
param :max_effort, type: {:unit, :newton_meter}, default: ~u(10 newton_meter)
end
end
topology do
link :base do
joint :shoulder do
limit do
effort(param([:motion, :max_effort]))
end
end
end
endThe param/1 function creates a reference that:
- Is validated at compile-time to ensure the parameter exists
- Is resolved at robot startup to get the current parameter value
- Subscribes to parameter changes to keep the robot struct updated
Summary
Functions
Create a parameter reference for DSL fields.