roboplan.viser_visualizer ========================= .. py:module:: roboplan.viser_visualizer .. autoapi-nested-parse:: TEMPORARY FILE: Can be removed when Pinocchio 3.9.0 is available on all platforms. Attributes ---------- .. autoapisummary:: roboplan.viser_visualizer.import_viser_succeed roboplan.viser_visualizer.MESH_TYPES Classes ------- .. autoapisummary:: roboplan.viser_visualizer.ViserVisualizer Module Contents --------------- .. py:data:: import_viser_succeed :value: False .. py:data:: MESH_TYPES .. py:class:: ViserVisualizer(model=pin.Model(), collision_model=None, visual_model=None, copy_models=False, data=None, collision_data=None, visual_data=None) Bases: :py:obj:`pinocchio.visualize.BaseVisualizer` A Pinocchio visualizer using Viser. .. py:attribute:: static_objects :value: [] .. py:method:: initViewer(viewer=None, open=False, loadModel=False, host='localhost', port='8000') Start a new Viser server and client. Note: the server can also be passed in through the `viewer` argument. :param viewer: An existing ViserServer instance, or None. If None, creates a new ViserServer in this visualizer. :param open: If True, automatically opens a browser tab to the visualizer. :param loadModel: If True, loads the Pinocchio models passed in. :param host: If `viewer` is None, this will be the host URL. :param port: If `viewer` is None, this will be the host port. .. py:method:: loadViewerModel(rootNodeName='pinocchio', collision_color=None, visual_color=None, frame_axis_length=0.2, frame_axis_radius=0.01) Load the robot in a Viser viewer. :param rootNodeName: name to give to the robot in the viewer :param collision_color: optional, color to give to the collision model of the robot. Format is a list of four RGBA floating-point numbers (between 0 and 1) :param visual_color: optional, color to give to the visual model of the robot. Format is a list of four RGBA floating-point numbers (between 0 and 1) :param frame_axis_length: optional, length of frame axes if displaying frames. :param frame_axis_radius: optional, radius of frame axes if displaying frames. .. py:method:: loadViewerGeometryObject(geometry_object, prefix='', color=None) Loads a single geometry object. .. py:method:: display(q=None) Display the robot at configuration q in the viewer by placing all the bodies .. py:method:: displayCollisions(visibility) .. py:method:: displayVisuals(visibility) .. py:method:: displayFrames(visibility) .. py:method:: drawFrameVelocities(*args, **kwargs) :abstractmethod: .. py:method:: updatePlacements(geometry_type) .. py:method:: updateFrames() .. py:method:: captureImage(w=None, h=None, client_id=None, transport_format='jpeg') Capture an image from the Viser viewer and return an RGB array. :param w: The width of the captured image. :param h: The height of the captured image. :param client_id: The ID of the Viser client handle. If None, uses the first available client. :param transport_format: The transport format to use for the captured image. Can be "jpeg" (default) or "png". .. py:method:: setBackgroundColor(preset_name = 'gray', col_top=None, col_bot=None) :abstractmethod: .. py:method:: setCameraTarget(target) :abstractmethod: .. py:method:: setCameraPosition(position) :abstractmethod: .. py:method:: setCameraZoom(zoom) :abstractmethod: .. py:method:: setCameraPose(pose = np.eye(4)) :abstractmethod: .. py:method:: disableCameraControl() :abstractmethod: .. py:method:: enableCameraControl() :abstractmethod: