fastdev.robo.articulation_spec

Module Contents

fastdev.robo.articulation_spec.logger[source]
fastdev.robo.articulation_spec.ROOT_JOINT_NAME: str = '__root__'[source]
class fastdev.robo.articulation_spec.Geometry[source]

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstractmethod get_trimesh_mesh() trimesh.Trimesh[source]
Return type:

trimesh.Trimesh

class fastdev.robo.articulation_spec.Box[source]

Bases: Geometry

Helper class that provides a standard way to create an ABC using inheritance.

size: List[float][source]
get_trimesh_mesh() trimesh.Trimesh[source]
Return type:

trimesh.Trimesh

class fastdev.robo.articulation_spec.Cylinder[source]

Bases: Geometry

Helper class that provides a standard way to create an ABC using inheritance.

radius: float[source]
length: float[source]
get_trimesh_mesh() trimesh.Trimesh[source]
Return type:

trimesh.Trimesh

class fastdev.robo.articulation_spec.Capsule[source]

Bases: Geometry

Helper class that provides a standard way to create an ABC using inheritance.

radius: float[source]
length: float[source]
get_trimesh_mesh() trimesh.Trimesh[source]
Return type:

trimesh.Trimesh

class fastdev.robo.articulation_spec.Sphere[source]

Bases: Geometry

Helper class that provides a standard way to create an ABC using inheritance.

radius: float[source]
get_trimesh_mesh() trimesh.Trimesh[source]
Return type:

trimesh.Trimesh

class fastdev.robo.articulation_spec.Mesh[source]

Bases: Geometry

Helper class that provides a standard way to create an ABC using inheritance.

scale: List[float][source]
filename: str | None = None[source]
mesh_dir: str | None = None[source]
is_collision_geometry: bool = False[source]
vertices: numpy.ndarray | None = None[source]
faces: numpy.ndarray | None = None[source]
get_trimesh_mesh() trimesh.Trimesh[source]
Return type:

trimesh.Trimesh

class fastdev.robo.articulation_spec.Material[source]
name: str | None = None[source]
color: numpy.ndarray | None = None[source]
texture: str | None = None[source]
class fastdev.robo.articulation_spec.Visual[source]
origin: numpy.ndarray[source]
geometry: Geometry[source]
name: str | None = None[source]
material: Material | None = None[source]
get_trimesh_mesh() trimesh.Trimesh[source]
Return type:

trimesh.Trimesh

class fastdev.robo.articulation_spec.Collision[source]
origin: numpy.ndarray[source]
geometry: Geometry[source]
name: str | None = None[source]
get_trimesh_mesh() trimesh.Trimesh[source]
Return type:

trimesh.Trimesh

class fastdev.robo.articulation_spec.JointType(*args, **kwds)[source]

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

    >>> Color.RED
    <Color.RED: 1>
    
  • value lookup:

    >>> Color(1)
    <Color.RED: 1>
    
  • name lookup:

    >>> Color['RED']
    <Color.RED: 1>
    

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

ROOT = -1[source]
FIXED = 0[source]
PRISMATIC = 1[source]
REVOLUTE = 2[source]
class fastdev.robo.articulation_spec.Joint[source]
name: str[source]
type: JointType[source]
origin: jaxtyping.Float[numpy.ndarray, 4 4][source]
axis: jaxtyping.Float[numpy.ndarray, 3][source]
limit: jaxtyping.Float[numpy.ndarray, 2] | None[source]
mimic_joint: str | None = None[source]
mimic_multiplier: float | None = None[source]
mimic_offset: float | None = None[source]
Parameters:

child_link_name (str)

__post_init__()[source]
name: str[source]
visuals: List[Visual] = [][source]
collisions: List[Collision] = [][source]
joint_name: str[source]
set_joint_name(joint_name: str)[source]
Parameters:

joint_name (str)

get_trimesh_mesh(mode: Literal['visual', 'collision'] = 'collision') trimesh.Trimesh[source]
Parameters:

mode (Literal['visual', 'collision'])

Return type:

trimesh.Trimesh

class fastdev.robo.articulation_spec.ArticulationSpec(urdf_or_mjcf_path: str | pathlib.Path, mesh_dir: str | pathlib.Path | None = None, format: Literal['urdf', 'mjcf'] | None = None, base_link_name: str | None = None, ee_link_names: str | List[str] | None = None, mjcf_assets: Dict[str, Any] | None = None, enable_mimic_joints: bool = True)[source]

Specification for a single articulation.

Parameters:
  • urdf_or_mjcf_path (str) – Path to the URDF or MJCF file.

  • mesh_dir (str, optional) – Directory to store mesh files. Defaults to None.

  • format (str, optional) – Format of the file, either “urdf” or “mjcf”. Defaults to None.

  • mjcf_assets (Dict[str, Any], optional) – Assets for MJCF files. Defaults to None.

  • enable_mimic_joints (bool, optional) – Whether to enable mimic joints. Defaults to True.

  • base_link_name (Optional[str])

  • ee_link_names (Optional[Union[str, List[str]]])

Examples

>>> arti_spec = ArticulationSpec(urdf_or_mjcf_path="assets/robot_description/panda.urdf")
>>> arti_spec.num_dofs
8
num_dofs: int[source]
active_joint_names: List[str][source]
has_mimic_joints: bool[source]
mimic_joint_names: List[str][source]
full_joint_names: List[str][source]
num_full_joints: int[source]
urdf_or_mjcf_path = ''[source]
mesh_dir = ''[source]
format = None[source]
mjcf_assets = None[source]
enable_mimic_joints = True[source]
num_mimic_joints[source]
parse_urdf() Tuple[Dict[str, Joint], Dict[str, Link]][source]
Return type:

Tuple[Dict[str, Joint], Dict[str, Link]]

parse_mjcf() Tuple[Dict[str, Joint], Dict[str, Link]][source]
Return type:

Tuple[Dict[str, Joint], Dict[str, Link]]

__repr__() str[source]
Return type:

str

__str__() str[source]
Return type:

str

property joint_limits: Optional[jaxtyping.Float[numpy.ndarray, num_dofs 2]][source]
Return type:

Optional[jaxtyping.Float[numpy.ndarray, num_dofs 2]]

property mimic_joint_limits: Optional[jaxtyping.Float[numpy.ndarray, num_mimic_joints 2]][source]
Return type:

Optional[jaxtyping.Float[numpy.ndarray, num_mimic_joints 2]]

property mimic_joint_indices: jaxtyping.Int[numpy.ndarray, num_mimic_joints][source]
Return type:

jaxtyping.Int[numpy.ndarray, num_mimic_joints]

property mimic_multipliers: jaxtyping.Float[numpy.ndarray, num_mimic_joints][source]
Return type:

jaxtyping.Float[numpy.ndarray, num_mimic_joints]

property mimic_offsets: jaxtyping.Float[numpy.ndarray, num_mimic_joints][source]
Return type:

jaxtyping.Float[numpy.ndarray, num_mimic_joints]

Return type:

jaxtyping.Int[numpy.ndarray, num_links]

Return type:

jaxtyping.Int[numpy.ndarray, num_links]

Return type:

jaxtyping.Int[numpy.ndarray, num_links]

Return type:

Optional[jaxtyping.Float[numpy.ndarray, num_links 3]]

property full_joint_axes: jaxtyping.Float[numpy.ndarray, num_full_joints 3][source]
Return type:

jaxtyping.Float[numpy.ndarray, num_full_joints 3]

Return type:

jaxtyping.Float[numpy.ndarray, num_links 4 4]

Return type:

jaxtyping.Int[numpy.ndarray, num_links]

Parameters:

link_name_or_idx (Union[str, int])

Return type:

jaxtyping.Int[numpy.ndarray, num_links]

Parameters:
  • mode (Literal['visual', 'collision'])

  • return_empty_meshes (bool)

Return type:

Dict[str, trimesh.Trimesh]