Taccel APIs¶
The Taccel Simulator is built upon the Warp-IPC. It provides the importing and simulating of VBTS-integrated robots, and synthesizes tactile signals for the sensors.
- class taccel.taccel.TaccelModel(num_envs: int = 1, viz_envs: list[int] = [], device='cuda:0')¶
Bases:
ASRModel
- add_joint_robot(urdf_path: str, env_id: int = 0, start_coll_layer: int = 2, coll_layers: list[int] = [], disable_coll_layers: list[int] = [], mu: float = 0.3, self_collision: bool = False, use_collision_mesh: bool = False, fix_base: bool = True, root_pose: ndarray[Any, dtype[_ScalarType_co]] = array([[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]]), rest_joint_states: Dict[str, float] | Sequence[float] | None = None, enable_joint_control: bool = True)¶
- add_robot(urdf_path: str, env_id: int = 0, start_coll_layer: int = 2, coll_layers: list[int] = [], disable_coll_layers: list[int] = [], mu: float = 0.3, no_bodies: bool = False, self_collision: bool = False, use_collision_mesh: bool = False)¶
Add a robot from URDF and register its bodies and constraints.
Supported URDFs must include rest_mesh for each link. Each link with a valid surface mesh will be registered as an affine body with default material and collision settings.
Must be called before
init()
.- Parameters:
urdf_path (str) – Path to the URDF file describing the robot.
env_id (int) – Environment index for the robot instance. Defaults to 0.
start_coll_layer (int) – Starting collision layer ID for robot links. Defaults to 2.
coll_layers (list[int]) – Additional layers this robot can collide with. Defaults to [].
disable_coll_layers (list[int]) – Unused in current implementation. Defaults to [].
mu (float) – Friction coefficient for all link surfaces. Defaults to 0.3.
self_collision (bool) – Whether to enable collision between links of the same robot. Defaults to False.
**kwargs – Additional arguments passed to the Robot constructor.
- Returns:
Handle of the Robot.
- Return type:
- add_vbts_to_sim(robot: TactileRobot, coll_layers: int | List[int] = 1) list[TetMeshBodyHandle] ¶
Add the VBTS of a given robot to the simulation, and set the colliding layers.
- Parameters:
robot (TactileRobot) – The robot to add VBTS to.
coll_layers (int | List[int], optional) – The colliding layer of each gel pad, int or list[int]. If int given, all the gel pads will be in the same colliding layer. Defaults to 1.
- Returns:
_description_
- Return type:
list[TetMeshBodyHandle]
- draw_marker_on_rgb(rgb: ndarray[Any, dtype[_ScalarType_co]], markers: ndarray[Any, dtype[_ScalarType_co]], flows: ndarray[Any, dtype[_ScalarType_co]] | None = None)¶
- property dummy_robot: TactileRobot | None¶
Return the first added robot, or None if no robot has been added.
- finalize(ignore_tactile: bool = False) None ¶
Finalize the
ASRModel
.This function must be called once after all bodies, joints, and constraints are added, and after
init()
has been called. It initializes sparse matrix structures for Hessians, allocates buffers for per-step simulation, and builds collision and constraint metadata.Must be called only once and after
init()
.
- property gel_coat_mesh_indexers_wp¶
- get_marker_flow_2d()¶
Transform the markers, rest markers, and their flows back to 2D space on the pixel coordinate.
- get_tac_markers_and_rest(local: bool = False, return_numpy: bool = True)¶
- render_tactile(render_marker: bool = False, render_flow: bool = False) tuple[Tensor, Tensor, Tensor] ¶
- robots: list[TactileRobot] = []¶
- property sensor_xy_queries_local: tuple[Tensor, Tensor]¶
- set_robot_states(joint_params: list[dict[str, float]] | ndarray[Any, dtype[_ScalarType_co]] | Tensor, root_tf: ndarray[Any, dtype[_ScalarType_co]] | Tensor | None = None, env_ids: list[int] = [])¶
Set the current states (pose) of the robot in each environment.
This function directly overwrites the affine state of each link using the given joint parameters and root transform. It is typically used once during initialization to place robots into their starting poses.
- Parameters:
joint_params (list[dict[str, float]] | NDArray | torch.Tensor) – Joint configuration per robot.
root_tf (NDArray | torch.Tensor | None) – Optional root transformation per robot (SE(3) matrix).
env_ids (list[int]) – Environment indices to apply the states to. Defaults to all.
- set_robot_targets(joint_params: list[dict[str, float]] | ndarray[Any, dtype[_ScalarType_co]] | Tensor, root_tf: ndarray[Any, dtype[_ScalarType_co]] | Tensor | None = None, env_ids: list[int] = [])¶
Set the target poses for the robot links for the next simulation step.
Unlike
set_robot_states()
, this function does not immediately update the current state. Instead, it sets the optimization targets used by the simulator in the next time step to apply kinematic constraints.- Parameters:
joint_params (list[dict[str, float]] | NDArray | torch.Tensor) – Joint configuration per robot.
root_tf (NDArray | torch.Tensor | None) – Optional root transformation per robot (SE(3) matrix).
env_ids (list[int]) – Environment indices to apply the targets to. Defaults to all.
- property tac_coat_rest_and_current: tuple[list[Trimesh], list[Trimesh]]¶
Accquire the current and rest states of the gel pads.
- Returns:
coat_current and coat_rest, each is a list of trimesh.Trimesh with length of num_envs
- Return type:
tuple[list[tm.Trimesh], list[tm.Trimesh]]
- property tac_markers: Tensor¶
Accquire the current markers of the gel pads.
- Returns:
torch.Tensor markers, in shape [num_envs, num_markers_all, 3]
- property tac_markers_local: Tensor¶
- property tac_markers_rest_and_current: tuple[Tensor, Tensor]¶
Accquire the current markers and their rest states (for reference) of the gel pads.
- Returns:
markers and rest markers, each in shape [num_envs, num_markers_all, 3]
- Return type:
tuple[torch.Tensor, torch.Tensor]
- property tac_markers_rest_and_current_hand_local: tuple[Tensor, Tensor]¶
Accquire the current markers and their rest states (for reference) of the gel pads.
- Returns:
markers and rest markers, each in shape [num_envs, num_markers_all, 3]
- Return type:
tuple[torch.Tensor, torch.Tensor]
- property tac_markers_rest_and_current_local: tuple[Tensor, Tensor]¶
Accquire the current markers and their rest states (for reference) of the gel pads.
- Returns:
markers and rest markers, each in shape [num_envs, num_markers_all, 3]
- Return type:
tuple[torch.Tensor, torch.Tensor]
- property tac_markers_rest_and_current_stacks: tuple[Tensor, Tensor]¶
Accquire the current markers and their rest states (for reference) of the gel pads.
- Returns:
markers and rest markers, each in shape [num_envs, num_markers_all, 3]
- Return type:
tuple[torch.Tensor, torch.Tensor]
- property tac_tf: Tensor¶
Accquire the current state of the gel pads”
- Returns:
gel pad frame transformation, in shape [num_envs, num_tac, 3, 3]
- Return type:
torch.Tensor
- property tac_tf_robot_local: Tensor¶
Accquire the current state of the gel pads”
- Returns:
gel pad frame transformation, in shape [num_envs, num_tac, 3, 3]
- Return type:
torch.Tensor
- update_gel_coat_meshes_wp()¶
- vbts_depths: <warp.types.array object at 0x7c331310bf40>¶
- vbts_normals: <warp.types.array object at 0x7c331310ac80>¶