storm_kit.geom.sdf.robot module

class RobotCapsuleCollision(robot_collision_params, batch_size=1, tensor_args={'device': 'cpu', 'dtype': torch.float32})[source]

Bases: object

This class holds a batched collision model where the robot is represented as capsules [one per link]

load_robot_collision_model(robot_collision_params)[source]

Update link collision poses :param link_pos: [batch, n_links , 3] :param link_rot: [batch, n_links , 3 , 3]

class RobotMeshCollision(robot_collision_params, batch_size=1, tensor_args={'device': 'cpu', 'dtype': torch.float32})[source]

Bases: object

This class holds a batched collision model with meshes loaded using trimesh. Points are sampled from the mesh which can be used for collision checking.

build_batch_features(clone_points=False, clone_pose=True, batch_size=None)[source]
load_robot_collision_model(robot_collision_params)[source]
update_batch_robot_collision_points(links_pos, links_rot)[source]
update_batch_robot_collision_pose(links_pos, links_rot)[source]

Update link collision poses :param link_pos: [batch, n_links , 3] :param link_rot: [batch, n_links , 3 , 3]

update_robot_collision_points(links_pos, links_rot)[source]
update_robot_collision_pose(links_pos, links_rot)[source]

Update link collision poses :param link_pos: [n_links, 3] :param link_rot: [n_links, 3, 3]

class RobotSphereCollision(robot_collision_params, batch_size=1, tensor_args={'device': 'cpu', 'dtype': torch.float32})[source]

Bases: object

This class holds a batched collision model where the robot is represented as spheres. All points are stored in the world reference frame, obtained by using update_pose calls.

Initialize with robot collision parameters, look at franka_reacher.py for an example.

Parameters
  • robot_collision_params (Dict) – collision model parameters

  • batch_size (int, optional) – Batch size of parallel sdf computation. Defaults to 1.

  • tensor_args (dict, optional) – compute device and data type. Defaults to {‘device’:”cpu”, ‘dtype’:torch.float32}.

build_batch_features(clone_objs=False, clone_pose=True, batch_size=None)[source]

clones poses/object instances for computing across batch. Use this once per batch size change to avoid re-initialization over repeated calls.

Parameters
  • clone_objs (bool, optional) – clones objects. Defaults to False.

  • clone_pose (bool, optional) – clones pose. Defaults to True.

  • batch_size ([type], optional) – batch_size to clone. Defaults to None.

check_self_collisions(link_trans, link_rot)[source]

Analytic method to compute signed distance between links. This is used to train the NN method check_self_collisions_nn() amd is not used directly as it is slower.

Parameters
  • link_trans ([tensor]) – link translation as batch [b,3]

  • link_rot ([type]) – link rotation as batch [b,3,3]

Returns

signed distance [b,1]

Return type

[tensor]

check_self_collisions_nn(q)[source]

compute signed distance using NN, uses an instance of nn_model.robot_self_collision.RobotSelfCollisionNet

Parameters

q ([type]) – [description]

Returns

[description]

Return type

[type]

load_robot_collision_model(robot_collision_params)[source]

Load robot collision model, called from constructor

Parameters

robot_collision_params (Dict) – loaded from yml file

update_batch_robot_collision_objs(links_pos, links_rot)[source]

update pose of link spheres

Args: links_pos: bxnx3 links_rot: bxnx3x3

update_batch_robot_collision_pose(links_pos, links_rot)[source]

Update link collision poses :param link_pos: [batch, n_links , 3] :param link_rot: [batch, n_links , 3 , 3]

update_robot_collision_objs(links_pos, links_rot)[source]

update pose of link spheres

Args: links_pos: nx3 links_rot: nx3x3

update_robot_collision_pose(links_pos, links_rot)[source]

Update link collision poses :param link_pos: [n_links, 3] :param link_rot: [n_links, 3, 3]