curobo.rollout.arm_reacher module

class ArmReacherMetrics(
cost: 'Optional[T_BValue_float]' = None,
constraint: 'Optional[T_BValue_float]' = None,
feasible: 'Optional[T_BValue_bool]' = None,
state: 'Optional[State]' = None,
cspace_error: torch.Tensor | None = None,
position_error: torch.Tensor | None = None,
rotation_error: torch.Tensor | None = None,
pose_error: torch.Tensor | None = None,
goalset_index: torch.Tensor | None = None,
null_space_error: torch.Tensor | None = None,
)

Bases: RolloutMetrics

cspace_error: Tensor | None = None
position_error: Tensor | None = None
rotation_error: Tensor | None = None
pose_error: Tensor | None = None
goalset_index: Tensor | None = None
null_space_error: Tensor | None = None
clone(
clone_state=False,
)
_abc_impl = <_abc._abc_data object>
_is_protocol = False
constraint: T_BValue_float | None = None
cost: T_BValue_float | None = None
count(
value,
) integer -- return number of occurrences of value
feasible: T_BValue_bool | None = None
index(
value[,
start[,
stop,]]
) integer -- return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

state: State | None = None
class ArmReacherCostConfig(
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,
pose_cfg: curobo.rollout.cost.pose_cost.PoseCostConfig | None = None,
cspace_cfg: curobo.rollout.cost.dist_cost.DistCostConfig | None = None,
straight_line_cfg: curobo.rollout.cost.cost_base.CostConfig | None = None,
zero_acc_cfg: curobo.rollout.cost.cost_base.CostConfig | None = None,
zero_vel_cfg: curobo.rollout.cost.cost_base.CostConfig | None = None,
zero_jerk_cfg: curobo.rollout.cost.cost_base.CostConfig | None = None,
link_pose_cfg: curobo.rollout.cost.pose_cost.PoseCostConfig | None = None,
)

Bases: ArmCostConfig

pose_cfg: PoseCostConfig | None = None
cspace_cfg: DistCostConfig | None = None
straight_line_cfg: CostConfig | None = None
zero_acc_cfg: CostConfig | None = None
zero_vel_cfg: CostConfig | None = None
zero_jerk_cfg: CostConfig | None = None
static _get_base_keys()
static from_dict(
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 _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),
)
bound_cfg: BoundCostConfig | None = None
manipulability_cfg: ManipulabilityCostConfig | None = None
null_space_cfg: DistCostConfig | None = None
primitive_collision_cfg: PrimitiveCollisionCostConfig | None = None
self_collision_cfg: SelfCollisionCostConfig | None = None
stop_cfg: StopCostConfig | None = None
class ArmReacherConfig(
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_reacher.ArmReacherCostConfig = None,
constraint_cfg: curobo.rollout.arm_reacher.ArmReacherCostConfig = None,
convergence_cfg: curobo.rollout.arm_reacher.ArmReacherCostConfig = None,
world_coll_checker: curobo.geom.sdf.world.WorldCollision | None = None,
)

Bases: ArmBaseConfig

cost_cfg: ArmReacherCostConfig = None
constraint_cfg: ArmReacherCostConfig = None
convergence_cfg: ArmReacherCostConfig = 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),
)
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),
)
sampler_seed: int = 1312
sum_horizon: bool = False
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
_compute_g_dist_jit(
rot_err_norm,
goal_dist,
)
class ArmReacher(
config: ArmReacherConfig | None = None,
)

Bases: ArmBase, ArmReacherConfig

Inheritance diagram of curobo.rollout.arm_reacher.ArmReacher

cost_fn(
state: KinematicModelState,
action_batch=None,
)

Compute cost given that state dictionary and actions

curobo.rollout.cost.PoseCost curobo.rollout.cost.DistCost

convergence_fn(
state: KinematicModelState,
out_metrics: ArmReacherMetrics | None = None,
) ArmReacherMetrics
update_params(
goal: Goal,
)

Update params for the cost terms and dynamics model.

enable_pose_cost(
enable: bool = True,
)
_get_augmented_state(
state: JointState,
) KinematicModelState
_init_after_config_load()
property action_bound_highs
property action_bound_lows
abstract property action_bounds
property action_horizon
break_cuda_graph()
compute_kinematics(
state: JointState,
) KinematicModelState
constraint_cfg: ArmReacherCostConfig = None
constraint_fn(
state: KinematicModelState,
out_metrics: RolloutMetrics | None = None,
use_batch_env: bool = True,
) RolloutMetrics
convergence_cfg: ArmReacherCostConfig = None
cost_cfg: ArmReacherCostConfig = 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 cspace_config: CSpaceConfig
property cuda_graph_instance
current_cost(
current_state: JointState,
no_coll=False,
return_state=True,
**kwargs,
)
property d_action
property dt
enable_cspace_cost(
enable: bool = True,
)
filter_robot_state(
current_state: JointState,
) JointState
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_

get_action_from_state(
state: JointState,
)
get_ee_pose(current_state)
get_full_dof_from_solution(
q_js: JointState,
) JointState

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

Parameters:

q_sol – _description_

Returns:

_description_

get_init_action_seq() Tensor
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_

get_robot_command(
current_state: JointState,
act_seq: Tensor,
shift_steps: int = 1,
state_idx: Tensor | None = None,
) JointState
get_state_from_action(
start_state: JointState,
act_seq: Tensor,
state_idx: Tensor | None = None,
)
property horizon
property joint_names: List[str]
property kinematics
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()
reset_cuda_graph()
reset_seed()
reset_shape()
property retract_state
rollout_constraint(
act_seq: Tensor,
use_batch_env: bool = True,
) RolloutMetrics
rollout_constraint_cuda_graph(
act_seq: Tensor,
use_batch_env: bool = True,
)
rollout_fn(
act_seq,
) Trajectory

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

Parameters:

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

sample_random_actions(
n: int = 0,
)
sampler_seed: int = 1312
property state_bounds: Dict[str, List[float]]
sum_horizon: bool = False
update_cost_dt(dt: float)
update_start_state(
start_state: Tensor,
)
update_traj_dt(
dt: float | Tensor,
base_dt: float | None = None,
max_dt: float | None = None,
base_ratio: float | None = None,
)
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
get_pose_costs(
include_link_pose: bool = False,
include_convergence: bool = True,
)
update_pose_cost_metric(
metric: PoseCostMetric,
)
cat_sum_reacher(
tensor_list: List[Tensor],
)
cat_sum_horizon_reacher(
tensor_list: List[Tensor],
)