pyrcf.components.callback_handlers.pb_gui_utils =============================================== .. py:module:: pyrcf.components.callback_handlers.pb_gui_utils Attributes ---------- .. autoapisummary:: pyrcf.components.callback_handlers.pb_gui_utils.QuatType pyrcf.components.callback_handlers.pb_gui_utils.Vector3D Classes ------- .. autoapisummary:: pyrcf.components.callback_handlers.pb_gui_utils.PybulletGUIButton pyrcf.components.callback_handlers.pb_gui_utils.PybulletGUISlider pyrcf.components.callback_handlers.pb_gui_utils.PybulletDebugFrameViz pyrcf.components.callback_handlers.pb_gui_utils.PybulletText pyrcf.components.callback_handlers.pb_gui_utils.PybulletTextWithRateTrigger pyrcf.components.callback_handlers.pb_gui_utils.PybulletDebugPoints Module Contents --------------- .. py:data:: QuatType :type: TypeAlias :value: np.ndarray Numpy array representating quaternion in format [x,y,z,w] .. py:data:: Vector3D :type: TypeAlias :value: np.ndarray Numpy array representating 3D cartesian vector in format [x,y,z] .. py:class:: PybulletGUIButton(name: str, cid: int) Create a button in Pybullet GUI, and check if it was pressed. Meant to be used in a loop. .. py:attribute:: cid .. py:attribute:: _id .. py:attribute:: _val :value: 1 .. py:method:: reset() Not really useful anymore (legacy) .. py:method:: was_pressed() -> bool Checks if this button was pressed since the last time this method was called. .. py:method:: remove() Remove the button from the gui. .. py:class:: PybulletGUISlider(name: str, lower_lim: float, upper_lim: float, default_val: float, cid: int, mapping_function: Callable[[float], float] = lambda x: x) Create a slider gui in pybullet. .. py:attribute:: cid .. py:attribute:: _id .. py:attribute:: _mapping_function .. py:attribute:: _last_recorded_val :value: None .. py:method:: get_value() -> float Read the value from the slider gui. .. py:property:: last_read_value :type: float .. py:method:: value_changed() -> bool .. py:method:: remove() Remove the slider from gui. .. py:method:: set_value(value: float) :abstractmethod: .. py:class:: PybulletDebugFrameViz(cid: int, position: Vector3D = None, orientation: QuatType = np.array([0, 0, 0, 1]), line_length: float = 0.2, line_width: float = 2, duration: float = 0.0, draw_at_init: bool = True) Draw a coordinate frame in pybullet as specified pose in the world. .. py:attribute:: _len .. py:attribute:: _lw .. py:attribute:: _duration .. py:attribute:: _cid .. py:attribute:: _line_ids .. py:method:: _draw_lines(pos: Vector3D, ori: QuatType) .. py:method:: update_frame_pose(position: Vector3D, orientation: QuatType) Update the pose of an existing frame viz in pybullet. :param position: Position of coordinate frame in world. :type position: Vector3D :param orientation: Orientation quaternion of the frame in the world. :type orientation: QuatType .. py:method:: remove() Remove the frame viz from gui. .. py:class:: PybulletText(text_position: Tuple[float, float, float], default_text: str = '', text_color: Tuple[float, float, float] = (0, 0, 0), text_size: float = 3.0, lifetime: float = 0.0, cid: int = 0) Add text to pybullet sim world gui. .. py:attribute:: cid .. py:attribute:: _pos .. py:attribute:: _color .. py:attribute:: _size .. py:attribute:: _t .. py:attribute:: _id .. py:method:: update_text(text: str) Update the text string for this debug object. :param text: The new text to replace with. :type text: str .. py:method:: remove() Remove text from pybullet. .. py:class:: PybulletTextWithRateTrigger(text_position: Tuple[float, float, float], rate: float = 1, default_text: str = '', text_color: Tuple[float, float, float] = (0, 0, 0), text_size: float = 3.0, lifetime: float = 0.0, cid: int = 0) Bases: :py:obj:`PybulletText` Add text to pybullet sim world gui, that will only change at the specified rate (even if `update_text` is called at a higher frequency). This is useful if this method is called in a high frequency loop such as a control loop, and text has to be rendered only at a lower frequency. .. py:attribute:: _trigger .. py:method:: update_text(text: str) Update the text string for this debug object. Will only be triggered if the specified rate is satisified (lower bound). :param text: The new text to replace with. :type text: str .. py:class:: PybulletDebugPoints(point_positions: List[Vector3D] = None, point_size: float = 1.0, rgb: Tuple[float, float, float] = (1, 0, 0), lifetime: float = 0.0, cid: int = 0) Add 3D points to pybullet sim world gui. .. py:attribute:: _lifetime .. py:attribute:: _size .. py:attribute:: _rgb .. py:attribute:: _cid .. py:attribute:: _points_id .. py:method:: _draw_points(point_positions: List[Vector3D]) .. py:method:: update_point_positions(point_positions: List[Vector3D]) Update the positions of the debug points in pybullet. :param point_positions: List of positions for the points in world. :type point_positions: List[Vector3D] .. py:method:: remove() Remove the debug points object from pybullet.