fastdev.sim_webui ================= .. py:module:: fastdev.sim_webui Submodules ---------- .. toctree:: :maxdepth: 1 /api/fastdev/sim_webui/maniskill_webui/index /api/fastdev/sim_webui/webui/index Package Contents ---------------- .. py:class:: SimWebUI(host: str = 'localhost', port: int = 8080, enable_geometry_option: bool = False) WebUI for simulator and 3D scene visualization. .. py:method:: __repr__() -> str .. py:method:: __str__() -> str .. py:property:: scene_index :type: int .. py:method:: set_scene_index(value: int) .. py:method:: add_robot_asset(urdf_or_mjcf_path: Optional[Union[str, pathlib.Path]] = None, mesh_dir: Optional[Union[str, pathlib.Path]] = None, articulation: Optional[fastdev.robo.articulation.Articulation] = None) -> str Add a robot asset to the asset library. :param urdf_or_mjcf_path: Path to the URDF or MJCF file of the robot. :type urdf_or_mjcf_path: Union[str, Path] :param mesh_dir: Directory path of the robot meshes. Will use the directory of the URDF/MJCF file if not provided. Defaults to None. :type mesh_dir: Optional[Union[str, Path]], optional :returns: Asset ID of the robot asset. :rtype: str .. py:method:: add_mesh_asset(vertices: Optional[VerticesLike] = None, faces: Optional[FacesLike] = None, trimesh_mesh: Optional[trimesh.Trimesh] = None, mesh_path: Optional[Union[str, pathlib.Path]] = None, disable_cache: bool = False) -> str Add a mesh asset to the asset library. :param vertices: Vertices of the mesh. Defaults to None. :type vertices: Optional[VerticesLike], optional :param faces: Faces of the mesh. Defaults to None. :type faces: Optional[FacesLike], optional :param trimesh_mesh: Trimesh mesh object. Defaults to None. :type trimesh_mesh: Optional[trimesh.Trimesh], optional :param mesh_path: Path to the mesh file. Defaults to None. :type mesh_path: Optional[Union[str, Path]], optional :returns: Asset ID of the mesh asset. :rtype: str .. note:: Either trimesh_mesh or vertices and faces or mesh_path must be provided, but not both. .. py:method:: add_sphere_asset(radius: ScaleLike, subdivisions: int = 3, disable_cache: bool = False) -> str Add a single sphere asset to the asset library. :param radius: Radius of the sphere. :type radius: float :param subdivisions: Number of subdivisions. Defaults to 3. :type subdivisions: int, optional :returns: Asset ID of the sphere asset. :rtype: str .. py:method:: add_point_cloud_asset(points: VerticesLike) -> str Add a point cloud asset to the asset library. :param points: Points of the point cloud. :type points: VerticesLike :returns: Asset ID of the point cloud asset. :rtype: str .. py:method:: add_axes_asset(positions: AxesPositionsLike, rotations: AxesWXYZsLike) -> str Add an axes asset to the asset library. :param positions: Positions of the axes. :type positions: AxesPositionLike :param rotations: Rotations of the axes, could be in rotation matrices or wxyz quaternions. :type rotations: AxesWXYZsLike :returns: Asset ID of the axes asset. :rtype: str .. py:method:: set_robot_state(asset_id: str, scene_index: Optional[int] = None, joint_values: Optional[JointValuesLike] = None, root_poses: Optional[PosesLike] = None, color: ColorLike = 'silver') Set the state of a robot asset. :param asset_id: Asset ID of the robot asset. :type asset_id: str :param joint_values: Multi-frame (or single-frame) joint values. Defaults to None. :type joint_values: Optional[JointValuesT], optional :param root_poses: Multi-frame (or single-frame) root poses. Defaults to None. :type root_poses: Optional[PosesT], optional :param scene_index: Scene index. Defaults to None. :type scene_index: Optional[int], optional .. note:: The number of frames of the asset state is determined by the number of joint values provided. .. py:method:: set_mesh_state(asset_id: str, scene_index: Optional[int] = None, poses: Optional[PosesLike] = None, scale: ScaleLike = 1.0, color: Optional[ColorLike] = None, frame_range: Optional[Union[int, Tuple[int, int]]] = None) Set the state of a mesh asset. :param asset_id: Asset ID of the mesh asset. :type asset_id: str :param scene_index: Scene index. Defaults to None. :type scene_index: Optional[int], optional :param poses: Multi-frame (or single-frame) poses. Defaults to None. :type poses: Optional[PosesLike], optional :param scale: Scale factor. Defaults to 1.0. :type scale: ScaleLike, optional :param color: Color of the mesh, use random color if not provided. Defaults to None. :type color: ColorLike, optional .. note:: The number of frames of the asset state is determined by the number of poses provided. .. py:method:: set_sphere_state(asset_id: str, scene_index: Optional[int] = None, poses: Optional[PosesLike] = None, scale: ScaleLike = 1.0, color: Optional[ColorLike] = None, frame_range: Optional[Union[int, Tuple[int, int]]] = None) Set the state of a sphere asset. :param asset_id: Asset ID of the sphere asset. :type asset_id: str :param scene_index: Scene index. Defaults to None. :type scene_index: Optional[int], optional :param poses: Multi-frame (or single-frame) poses. Defaults to None. :type poses: Optional[PosesLike], optional :param scale: Scale factor. Defaults to 1.0. :type scale: ScaleLike, optional :param color: Color of the sphere. Defaults to None. :type color: Optional[ColorLike], optional .. note:: The number of frames of the asset state is determined by the number of poses provided. .. py:method:: set_point_cloud_state(asset_id: str, scene_index: Optional[int] = None, poses: Optional[PosesLike] = None, point_size: ScaleLike = 0.02, color: Optional[ColorLike] = None, frame_range: Optional[Union[int, Tuple[int, int]]] = None) Set the state of a point cloud asset. :param asset_id: Asset ID of the point cloud asset. :type asset_id: str :param scene_index: Scene index. Defaults to None. :type scene_index: Optional[int], optional :param poses: Multi-frame (or single-frame) poses. Defaults to None. :type poses: Optional[PosesLike], optional :param scale: Scale factor. Defaults to 1.0. :type scale: ScaleLike, optional :param color: Color of the point cloud. Defaults to None. :type color: Optional[ColorLike], optional .. note:: The number of frames of the asset state is determined by the number of poses provided. .. py:method:: set_axes_state(asset_id: str, scene_index: Optional[int] = None, axes_length: ScaleLike = 0.1, axes_radius: ScaleLike = 0.005, poses: Optional[PosesLike] = None) Set the state of a point cloud asset. :param asset_id: Asset ID of the point cloud asset. :type asset_id: str :param scene_index: Scene index. Defaults to None. :type scene_index: Optional[int], optional :param axes_length: Length of the axes. Defaults to 0.1. :type axes_length: ScaleLike, optional :param axes_radius: Radius of the axes. Defaults to 0.005. :type axes_radius: ScaleLike, optional :param poses: Multi-frame (or single-frame) poses. Defaults to None. :type poses: Optional[PosesLike], optional .. note:: The number of frames of the asset state is determined by the number of poses provided. .. py:method:: reset() Reset the state manager and Viser server.