curobo.rollout module¶
Rollout module.
Rollouts define the cost function and dynamics that an optimizer minimizes over. cuRobo’s built-in solvers use robot-specific rollouts internally; this public surface exposes rollouts useful for writing standalone optimization examples and benchmarks.
- Currently exposes:
RosenbrockRollout/RosenbrockCfg: A canonical non-convex test function, useful for validating custom optimizer configurations against a well-known problem.
Example
from curobo.rollout import RosenbrockRollout, RosenbrockCfg
rollout = RosenbrockRollout(RosenbrockCfg(...))
- class RosenbrockCfg(
- device_cfg,
- a=1.0,
- b=100.0,
- dimensions=2,
- time_horizon=1,
- time_action_horizon=1,
- sum_horizon=False,
- sampler_seed=1312,
Bases:
objectConfiguration for the Rosenbrock rollout class.
- Parameters:
- device_cfg: curobo._src.types.device_cfg.DeviceCfg¶
Device and dtype for tensors.
- classmethod create(
- config_dict,
- device_cfg=DeviceCfg(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
Create RosenbrockCfg from a dictionary.
- Parameters:
config_dict (Dict)
device_cfg (curobo._src.types.device_cfg.DeviceCfg)
- __init__(
- device_cfg,
- a=1.0,
- b=100.0,
- dimensions=2,
- time_horizon=1,
- time_action_horizon=1,
- sum_horizon=False,
- sampler_seed=1312,
- class RosenbrockRollout(
- config=None,
- use_cuda_graph=False,
Bases:
objectRollout that evaluates the Rosenbrock cost for optimizer testing.
f(x, y) = (a - x)^2 + b(y - x^2)^2
For higher dimensions, uses the generalized form: f(x) = sum_{i=1}^{n-1} [ (a - x_i)^2 + b(x_{i+1} - x_i^2)^2 ]
Useful for verifying optimizer convergence without a full robot model. Supports optional CUDA-graph wrapping via
use_cuda_graph.- Parameters:
config (Optional[RosenbrockCfg])
use_cuda_graph (bool)
- __init__(
- config=None,
- use_cuda_graph=False,
- Parameters:
config (curobo._src.rollout.rollout_rosenbrock.RosenbrockCfg | None)
use_cuda_graph (bool)
- property action_bound_lows: torch.Tensor¶
- property action_bound_highs: torch.Tensor¶
- property action_bounds: torch.Tensor¶
- evaluate_action(
- act_seq,
- **kwargs,
- Return type:
RolloutResult- Parameters:
act_seq (torch.Tensor)
- compute_metrics_from_state(
- state,
- **kwargs,
- Return type:
RolloutMetrics- Parameters:
- compute_metrics_from_action(
- act_seq,
- **kwargs,
- Return type:
RolloutMetrics- Parameters:
act_seq (torch.Tensor)
- get_initial_action(
- use_random=True,
- use_zero=False,
- **kwargs,
- get_all_cost_components()¶