Resolves parameter references in robot structs.
When a robot's DSL uses param([:path, :to, :param]) instead of literal unit
values, the Builder stores nil for those fields and records subscriptions
in param_subscriptions. This module handles:
- Initial resolution - At startup, resolve all param refs using current parameter values
- Dynamic updates - When a parameter changes, update all affected fields in the robot struct
Summary
Functions
Resolve all parameter references in a robot struct.
Update all fields that reference a specific parameter.
Functions
@spec resolve_all(BB.Robot.t(), BB.Robot.State.t()) :: BB.Robot.t()
Resolve all parameter references in a robot struct.
Iterates through robot.param_subscriptions and resolves each parameter
reference using the current value from robot_state.
Returns the updated robot struct with all param refs resolved to values.
@spec update_for_param(BB.Robot.t(), [atom()], term(), BB.Robot.State.t()) :: BB.Robot.t()
Update all fields that reference a specific parameter.
When a parameter changes, this function updates all robot struct fields that reference that parameter path.
Returns the updated robot struct.