curobo.rollout.arm_base module

class curobo.rollout.arm_base.ArmCostConfig(bound_cfg: curobo.rollout.cost.bound_cost.BoundCostConfig | None = None, null_space_cfg: curobo.rollout.cost.dist_cost.DistCostConfig | None = None, manipulability_cfg: curobo.rollout.cost.manipulability_cost.ManipulabilityCostConfig | None = None, stop_cfg: curobo.rollout.cost.stop_cost.StopCostConfig | None = None, self_collision_cfg: curobo.rollout.cost.self_collision_cost.SelfCollisionCostConfig | None = None, primitive_collision_cfg: curobo.rollout.cost.primitive_collision_cost.PrimitiveCollisionCostConfig | None = None)

Bases: object

Parameters:
bound_cfg: BoundCostConfig | None = None
null_space_cfg: DistCostConfig | None = None
manipulability_cfg: ManipulabilityCostConfig | None = None
stop_cfg: StopCostConfig | None = None
self_collision_cfg: SelfCollisionCostConfig | None = None
primitive_collision_cfg: PrimitiveCollisionCostConfig | None = None
static _get_base_keys()
static from_dict(data_dict, robot_config, world_coll_checker=None, tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32))
Parameters:
static _get_formatted_dict(data_dict, cost_key_list, robot_config, world_coll_checker=None, tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32))
Parameters:
class curobo.rollout.arm_base.ArmBaseConfig(tensor_args: 'TensorDeviceType', model_cfg: curobo.rollout.dynamics_model.kinematic_model.KinematicModelConfig, cost_cfg: curobo.rollout.arm_base.ArmCostConfig, constraint_cfg: curobo.rollout.arm_base.ArmCostConfig, convergence_cfg: curobo.rollout.arm_base.ArmCostConfig, world_coll_checker: curobo.geom.sdf.world.WorldCollision | None = None)

Bases: RolloutConfig

Parameters:
model_cfg: KinematicModelConfig
cost_cfg: ArmCostConfig
constraint_cfg: ArmCostConfig
convergence_cfg: ArmCostConfig
world_coll_checker: WorldCollision | None = None
static model_from_dict(model_data_dict, robot_cfg, tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32))
Parameters:
static cost_from_dict(cost_data_dict, robot_cfg, world_coll_checker=None, tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32))
Parameters:
static world_coll_checker_from_dict(world_coll_checker_dict=None, world_model_dict=None, world_coll_checker=None, tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32))
Parameters:
classmethod from_dict(robot_cfg, model_data_dict, cost_data_dict, constraint_data_dict, convergence_data_dict, world_coll_checker_dict=None, world_model_dict=None, world_coll_checker=None, tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32))

Create ArmBase class from dictionary

NOTE: We declare this as a classmethod to allow for derived classes to use it.

Parameters:
  • robot_cfg (Union[Dict, RobotConfig]) – _description_

  • model_data_dict (Dict) – _description_

  • cost_data_dict (Dict) – _description_

  • constraint_data_dict (Dict) – _description_

  • convergence_data_dict (Dict) – _description_

  • world_coll_checker_dict (Optional[Dict], optional) – _description_. Defaults to None.

  • world_model_dict (Optional[Dict], optional) – _description_. Defaults to None.

  • world_coll_checker (Optional[WorldCollision], optional) – _description_. Defaults to None.

  • tensor_args (TensorDeviceType, optional) – _description_. Defaults to TensorDeviceType().

Returns:

_description_

Return type:

_type_

class curobo.rollout.arm_base.ArmBase(config=None)

Bases: RolloutBase, ArmBaseConfig

This rollout function is for reaching a cartesian pose for a robot

Parameters:

config (ArmBaseConfig | None) –

_init_after_config_load()
cost_fn(state, action_batch=None, return_list=False)
Parameters:

state (KinematicModelState) –

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

RolloutMetrics

get_metrics(state)
Compute metrics given state

#TODO: Currently does not compute velocity and acceleration costs.

Parameters:

state (Union[JointState, URDFModelState]) – _description_

Returns:

_description_

Return type:

_type_

get_metrics_cuda_graph(state)

Use a CUDA Graph to compute metrics

Parameters:

state (JointState) – _description_

Raises:

ValueError – _description_

Returns:

_description_

abstract convergence_fn(state, out_metrics=None)
Parameters:
_get_augmented_state(state)
Parameters:

state (JointState) –

Return type:

KinematicModelState

compute_kinematics(state)
Parameters:

state (JointState) –

Return type:

KinematicModelState

rollout_constraint(act_seq, use_batch_env=True)
Parameters:
  • act_seq (Tensor) –

  • use_batch_env (bool) –

Return type:

RolloutMetrics

rollout_constraint_cuda_graph(act_seq, use_batch_env=True)
Parameters:
  • act_seq (Tensor) –

  • use_batch_env (bool) –

rollout_fn(act_seq)

Return sequence of costs and states encountered by simulating a batch of action sequences

Parameters:

action_seq (torch.Tensor [num_particles, horizon, d_act]) –

Return type:

Trajectory

update_params(goal)

Updates the goal targets for the cost functions.

Parameters:

goal (Goal) –

get_ee_pose(current_state)
current_cost(current_state, no_coll=False, return_state=True, **kwargs)
Parameters:

current_state (JointState) –

filter_robot_state(current_state)
Parameters:

current_state (JointState) –

Return type:

JointState

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

  • act_seq (Tensor) –

  • shift_steps (int) –

  • state_idx (Tensor | None) –

Return type:

JointState

reset()
property d_action
property action_bound_lows
property action_bound_highs
property state_bounds: Dict[str, List[float]]
property dt
property horizon
property action_horizon
get_init_action_seq()
Return type:

Tensor

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

state (JointState) –

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

  • act_seq (Tensor) –

  • state_idx (Tensor | None) –

property kinematics
property cspace_config: CSpaceConfig
get_full_dof_from_solution(q_js)

This function will all the dof that are locked during optimization.

Parameters:
Returns:

_description_

Return type:

JointState

property joint_names: List[str]
property retract_state
update_traj_dt(dt, base_dt=None, max_dt=None, base_ratio=None)
Parameters:
  • dt (float | Tensor) –

  • base_dt (float | None) –

  • max_dt (float | None) –

  • base_ratio (float | None) –

update_cost_dt(dt)
Parameters:

dt (float) –