curobo.rollout.arm_base module¶
- class 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
- 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: Dict,
- robot_config: RobotConfig,
- world_coll_checker: WorldCollision | None = None,
- tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
- static _get_formatted_dict(
- data_dict: Dict,
- cost_key_list: Dict,
- robot_config: RobotConfig,
- world_coll_checker: WorldCollision | None = None,
- tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
- class ArmBaseConfig(
- tensor_args: 'TensorDeviceType',
- sum_horizon: 'bool' = False,
- sampler_seed: 'int' = 1312,
- model_cfg: curobo.rollout.dynamics_model.kinematic_model.KinematicModelConfig | None = None,
- cost_cfg: curobo.rollout.arm_base.ArmCostConfig | None = None,
- constraint_cfg: curobo.rollout.arm_base.ArmCostConfig | None = None,
- convergence_cfg: curobo.rollout.arm_base.ArmCostConfig | None = None,
- world_coll_checker: curobo.geom.sdf.world.WorldCollision | None = None,
Bases:
RolloutConfig
- model_cfg: KinematicModelConfig | None = None¶
- cost_cfg: ArmCostConfig | None = None¶
- constraint_cfg: ArmCostConfig | None = None¶
- convergence_cfg: ArmCostConfig | None = None¶
- world_coll_checker: WorldCollision | None = None¶
- static model_from_dict(
- model_data_dict: Dict,
- robot_cfg: RobotConfig,
- tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
- static cost_from_dict(
- cost_data_dict: Dict,
- robot_cfg: RobotConfig,
- world_coll_checker: WorldCollision | None = None,
- tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
- static world_coll_checker_from_dict(
- world_coll_checker_dict: Dict | None = None,
- world_model_dict: WorldConfig | Dict | None = None,
- world_coll_checker: WorldCollision | None = None,
- tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
- classmethod from_dict(
- robot_cfg: Dict | RobotConfig,
- model_data_dict: Dict,
- cost_data_dict: Dict,
- constraint_data_dict: Dict,
- convergence_data_dict: Dict,
- world_coll_checker_dict: Dict | None = None,
- world_model_dict: Dict | None = None,
- world_coll_checker: WorldCollision | None = None,
- tensor_args: TensorDeviceType = TensorDeviceType(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 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_
- tensor_args: TensorDeviceType¶
- class ArmBase(
- config: ArmBaseConfig | None = None,
Bases:
RolloutBase
,ArmBaseConfig
This rollout function is for reaching a cartesian pose for a robot
- _init_after_config_load()¶
- cost_fn(
- state: KinematicModelState,
- action_batch=None,
- return_list=False,
- constraint_fn(
- state: KinematicModelState,
- out_metrics: RolloutMetrics | None = None,
- use_batch_env: bool = True,
- get_metrics(
- state: JointState | KinematicModelState,
Compute metrics given state
- Parameters:
state (Union[JointState, URDFModelState]) – _description_
- Returns:
_description_
- Return type:
_type_
- get_metrics_cuda_graph(
- state: JointState,
Use a CUDA Graph to compute metrics
- Parameters:
state – _description_
- Raises:
ValueError – _description_
- Returns:
_description_
- abstract convergence_fn(
- state: KinematicModelState,
- out_metrics: RolloutMetrics | None = None,
- _get_augmented_state(
- state: JointState,
- compute_kinematics(
- state: JointState,
- rollout_constraint( ) RolloutMetrics ¶
- 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])
- get_ee_pose(current_state)¶
- current_cost(
- current_state: JointState,
- no_coll=False,
- return_state=True,
- **kwargs,
- filter_robot_state(
- current_state: JointState,
- get_robot_command(
- current_state: JointState,
- act_seq: Tensor,
- shift_steps: int = 1,
- state_idx: Tensor | None = None,
- reset()¶
- property d_action¶
- property action_bound_lows¶
- property action_bound_highs¶
- property dt¶
- property horizon¶
- property action_horizon¶
- reset_shape()¶
- reset_cuda_graph()¶
- get_action_from_state(
- state: JointState,
- get_state_from_action(
- start_state: JointState,
- act_seq: Tensor,
- state_idx: Tensor | None = None,
- property kinematics¶
- property cspace_config: CSpaceConfig¶
- get_full_dof_from_solution(
- q_js: JointState,
This function will all the dof that are locked during optimization.
- Parameters:
q_sol – _description_
- Returns:
_description_
- property retract_state¶
- update_traj_dt(
- dt: float | Tensor,
- base_dt: float | None = None,
- max_dt: float | None = None,
- base_ratio: float | None = None,
- abstract property action_bounds¶
- break_cuda_graph()¶
- constraint_cfg: ArmCostConfig | None = None¶
- convergence_cfg: ArmCostConfig | None = None¶
- cost_cfg: ArmCostConfig | None = None¶
- static cost_from_dict(
- cost_data_dict: Dict,
- robot_cfg: RobotConfig,
- world_coll_checker: WorldCollision | None = None,
- tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
- property cuda_graph_instance¶
- classmethod from_dict(
- robot_cfg: Dict | RobotConfig,
- model_data_dict: Dict,
- cost_data_dict: Dict,
- constraint_data_dict: Dict,
- convergence_data_dict: Dict,
- world_coll_checker_dict: Dict | None = None,
- world_model_dict: Dict | None = None,
- world_coll_checker: WorldCollision | None = None,
- tensor_args: TensorDeviceType = TensorDeviceType(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 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_
- model_cfg: KinematicModelConfig | None = None¶
- static model_from_dict(
- model_data_dict: Dict,
- robot_cfg: RobotConfig,
- tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
- reset_seed()¶
- world_coll_checker: WorldCollision | None = None¶
- static world_coll_checker_from_dict(
- world_coll_checker_dict: Dict | None = None,
- world_model_dict: WorldConfig | Dict | None = None,
- world_coll_checker: WorldCollision | None = None,
- tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
- tensor_args: TensorDeviceType¶