curobo.rollout.rollout_base module

class curobo.rollout.rollout_base.RolloutMetrics(cost: 'Optional[T_BValue_float]' = None, constraint: 'Optional[T_BValue_float]' = None, feasible: 'Optional[T_BValue_bool]' = None, state: 'Optional[State]' = None)

Bases: Sequence

Parameters:
  • cost (Tensor | None) –

  • constraint (Tensor | None) –

  • feasible (Tensor | None) –

  • state (State | None) –

cost: Tensor | None = None
constraint: Tensor | None = None
feasible: Tensor | None = None
state: State | None = None
clone(clone_state=False)
_abc_impl = <_abc._abc_data object>
class curobo.rollout.rollout_base.Trajectory(actions: 'T_BHDOF_float', costs: 'T_BHValue_float', state: 'Optional[State]' = None, debug: 'Optional[dict]' = None)

Bases: object

Parameters:
  • actions (Tensor) –

  • costs (Tensor) –

  • state (State | None) –

  • debug (dict | None) –

actions: Tensor
costs: Tensor
state: State | None = None
debug: dict | None = None
class curobo.rollout.rollout_base.Goal(name='goal', goal_state=None, goal_pose=Pose(position=None, quaternion=None, rotation=None, batch=1, n_goalset=1, name='ee_link', normalize_rotation=True), links_goal_pose=None, current_state=None, retract_state=None, batch=-1, batch_pose_idx=None, batch_goal_state_idx=None, batch_retract_state_idx=None, batch_current_state_idx=None, batch_enable_idx=None, batch_world_idx=None, update_batch_idx_buffers=True, n_goalset=1)

Bases: Sequence

Goal data class used to update optimization target.

#NOTE: We can parallelize Goal in two ways: 1. Solve for current_state, pose pair in same environment 2. Solve for current_state, pose pair in different environment For case (1), we use batch_pose_idx to find the memory address of the current_state, pose pair while keeping batch_world_idx = [0] For case (2), we add a batch_world_idx[0,1,2..].

Parameters:
  • name (str) –

  • goal_state (State | None) –

  • goal_pose (Pose) –

  • links_goal_pose (Dict[str, Pose] | None) –

  • current_state (State | None) –

  • retract_state (Tensor | None) –

  • batch (int) –

  • batch_pose_idx (Tensor | None) –

  • batch_goal_state_idx (Tensor | None) –

  • batch_retract_state_idx (Tensor | None) –

  • batch_current_state_idx (Tensor | None) –

  • batch_enable_idx (Tensor | None) –

  • batch_world_idx (Tensor | None) –

  • update_batch_idx_buffers (bool) –

  • n_goalset (int) –

name: str = 'goal'
goal_state: State | None = None
goal_pose: Pose = Pose(position=None, quaternion=None, rotation=None, batch=1, n_goalset=1, name='ee_link', normalize_rotation=True)
current_state: State | None = None
retract_state: Tensor | None = None
batch: int = -1
batch_pose_idx: Tensor | None = None
batch_goal_state_idx: Tensor | None = None
batch_retract_state_idx: Tensor | None = None
batch_current_state_idx: Tensor | None = None
batch_enable_idx: Tensor | None = None
batch_world_idx: Tensor | None = None
update_batch_idx_buffers: bool = True
n_goalset: int = 1
_update_batch_size()
repeat_seeds(num_seeds)
Parameters:

num_seeds (int) –

clone()
_tensor_repeat_seeds(tensor, num_seeds)
apply_kernel(kernel_mat)
to(tensor_args)
Parameters:

tensor_args (TensorDeviceType) –

copy_(goal, update_idx_buffers=True)

Copy data from another goal object.

Parameters:
  • goal (Goal) – _description_

  • update_idx_buffers (bool) –

Raises:
  • NotImplementedError – _description_

  • NotImplementedError – _description_

Returns:

_description_

Return type:

_type_

_copy_buffer(ref_buffer, buffer)
_copy_tensor(ref_buffer, buffer)
get_batch_goal_state()
create_index_buffers(batch_size, batch_env, batch_retract, num_seeds, tensor_args)
Parameters:
  • batch_size (int) –

  • batch_env (bool) –

  • batch_retract (bool) –

  • num_seeds (int) –

  • tensor_args (TensorDeviceType) –

classmethod create_idx(pose_batch_size, batch_env, batch_retract, num_seeds, tensor_args)
Parameters:
  • pose_batch_size (int) –

  • batch_env (bool) –

  • batch_retract (bool) –

  • num_seeds (int) –

  • tensor_args (TensorDeviceType) –

_abc_impl = <_abc._abc_data object>
class curobo.rollout.rollout_base.RolloutConfig(tensor_args: 'TensorDeviceType')

Bases: object

Parameters:

tensor_args (TensorDeviceType) –

tensor_args: TensorDeviceType
class curobo.rollout.rollout_base.RolloutBase(config=None)

Bases: object

Parameters:

config (Optional[RolloutConfig]) –

_init_after_config_load()
abstract cost_fn(state)
Parameters:

state (State) –

abstract constraint_fn(state, out_metrics=None)
Parameters:
Return type:

RolloutMetrics

abstract convergence_fn(state, out_metrics=None)
Parameters:
Return type:

RolloutMetrics

get_metrics(state)
Parameters:

state (State) –

get_metrics_cuda_graph(state)
Parameters:

state (State) –

rollout_fn(act)
current_cost(current_state)
abstract update_params(goal)
Parameters:

goal (Goal) –

abstract property action_bounds
abstract filter_robot_state(current_state)
Parameters:

current_state (State) –

Return type:

State

abstract get_robot_command(current_state, act_seq, shift_steps=1, state_idx=None)
Parameters:
  • shift_steps (int) –

  • state_idx (Tensor | None) –

reset_seed()
reset()
abstract property d_action: int
abstract property action_bound_lows
abstract property action_bound_highs
abstract property dt
property horizon: int
property action_horizon: int
update_start_state(start_state)
Parameters:

start_state (Tensor) –

abstract get_init_action_seq()
property state_bounds: Dict[str, List[float]]
sample_random_actions(n=0)
Parameters:

n (int) –

abstract rollout_constraint(act_seq)
Parameters:

act_seq (Tensor) –

Return type:

RolloutMetrics

reset_cuda_graph()
reset_shape()
abstract get_action_from_state(state)
Parameters:

state (State) –

abstract get_state_from_action(start_state, act_seq, state_idx=None)
Parameters:
  • start_state (State) –

  • act_seq (Tensor) –

  • state_idx (Tensor | None) –

abstract property cspace_config: CSpaceConfig
get_full_dof_from_solution(q_js)
Parameters:

q_js (JointState) –

Return type:

JointState