curobo.rollout.cost.primitive_collision_cost module

class curobo.rollout.cost.primitive_collision_cost.PrimitiveCollisionCostConfig(weight, tensor_args=None, distance_threshold=0.0, classify=False, terminal=False, run_weight=None, dof=7, vec_weight=None, max_value=None, hinge_value=None, vec_convergence=None, threshold_value=None, return_loss=False, world_coll_checker=None, use_sweep=False, use_sweep_kernel=False, sweep_steps=4, use_speed_metric=False, speed_dt=0.01, activation_distance=0.0, sum_distance=True)

Bases: CostConfig

Create Collision Cost Configuration.

Parameters:
  • weight (Tensor | float | List[float]) –

  • tensor_args (TensorDeviceType) –

  • distance_threshold (float) –

  • classify (bool) –

  • terminal (bool) –

  • run_weight (float | None) –

  • dof (int) –

  • vec_weight (Tensor | List[float] | float | None) –

  • max_value (float | None) –

  • hinge_value (float | None) –

  • vec_convergence (List[float] | None) –

  • threshold_value (float | None) –

  • return_loss (bool) –

  • world_coll_checker (WorldCollision | None) –

  • use_sweep (bool) –

  • use_sweep_kernel (bool) –

  • sweep_steps (int) –

  • use_speed_metric (bool) –

  • speed_dt (Tensor | float) –

  • activation_distance (Tensor | float) –

  • sum_distance (bool) –

world_coll_checker: WorldCollision | None = None

WorldCollision instance to use for distance queries.

use_sweep: bool = False

Sweep for collisions between timesteps in a trajectory.

use_sweep_kernel: bool = False
sweep_steps: int = 4
use_speed_metric: bool = False

Speed metric scales the collision distance by sphere velocity (similar to CHOMP Planner ICRA’09). This prevents the optimizer from speeding through obstacles to minimize cost and instead encourages the robot to move around the obstacle.

speed_dt: Tensor | float = 0.01

dt to use for computation of velocity and acceleration through central difference for speed metric. Value less than 1 is better as that leads to different scaling between acceleration and velocity.

activation_distance: Tensor | float = 0.0

The distance outside collision at which to activate the cost. Having a non-zero value enables the robot to move slowly when within this distance to an obstacle. This enables our post optimization interpolation to not hit any obstacles.

sum_distance: bool = True

Setting this flag to true will sum the distance across spheres of the robot.

class curobo.rollout.cost.primitive_collision_cost.PrimitiveCollisionCost(config)

Bases: CostBase, PrimitiveCollisionCostConfig

Creates a primitive collision cost instance.

See note on Collision Checking Implementation for details on the cost formulation.

Parameters:

config (PrimitiveCollisionCostConfig) – Cost

sweep_kernel_fn(robot_spheres_in, env_query_idx=None)
Parameters:

env_query_idx (Tensor | None) –

sweep_fn(robot_spheres_in, env_query_idx=None)
Parameters:

env_query_idx (Tensor | None) –

discrete_fn(robot_spheres_in, env_query_idx=None)
Parameters:

env_query_idx (Tensor | None) –

update_dt(dt)
Parameters:

dt (float | Tensor) –

get_gradient_buffer()