pyrcf.components.callback_handlers.pb_gui_utils
Attributes
Numpy array representating quaternion in format [x,y,z,w] |
|
Numpy array representating 3D cartesian vector in format [x,y,z] |
Classes
Create a button in Pybullet GUI, and check if it was pressed. |
|
Create a slider gui in pybullet. |
|
Draw a coordinate frame in pybullet as specified pose in the world. |
|
Add text to pybullet sim world gui. |
|
Add text to pybullet sim world gui, that will only change at the |
|
Add 3D points to pybullet sim world gui. |
Module Contents
- pyrcf.components.callback_handlers.pb_gui_utils.QuatType: TypeAlias = np.ndarray
Numpy array representating quaternion in format [x,y,z,w]
- pyrcf.components.callback_handlers.pb_gui_utils.Vector3D: TypeAlias = np.ndarray
Numpy array representating 3D cartesian vector in format [x,y,z]
- class pyrcf.components.callback_handlers.pb_gui_utils.PybulletGUIButton(name: str, cid: int)
Create a button in Pybullet GUI, and check if it was pressed. Meant to be used in a loop.
- cid
- _id
- _val = 1
- reset()
Not really useful anymore (legacy)
- was_pressed() bool
Checks if this button was pressed since the last time this method was called.
- remove()
Remove the button from the gui.
- class pyrcf.components.callback_handlers.pb_gui_utils.PybulletGUISlider(name: str, lower_lim: float, upper_lim: float, default_val: float, cid: int, mapping_function: Callable[[float], float] = lambda x: ...)
Create a slider gui in pybullet.
- cid
- _id
- _mapping_function
- _last_recorded_val = None
- get_value() float
Read the value from the slider gui.
- property last_read_value: float
- value_changed() bool
- remove()
Remove the slider from gui.
- abstract set_value(value: float)
- class pyrcf.components.callback_handlers.pb_gui_utils.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.
- _len
- _lw
- _duration
- _cid
- _line_ids
- _draw_lines(pos: Vector3D, ori: QuatType)
- update_frame_pose(position: Vector3D, orientation: QuatType)
Update the pose of an existing frame viz in pybullet.
- Parameters:
position (Vector3D) – Position of coordinate frame in world.
orientation (QuatType) – Orientation quaternion of the frame in the world.
- remove()
Remove the frame viz from gui.
- class pyrcf.components.callback_handlers.pb_gui_utils.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.
- cid
- _pos
- _color
- _size
- _t
- _id
- update_text(text: str)
Update the text string for this debug object.
- Parameters:
text (str) – The new text to replace with.
- remove()
Remove text from pybullet.
- class pyrcf.components.callback_handlers.pb_gui_utils.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:
PybulletTextAdd 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.
- _trigger
- update_text(text: str)
Update the text string for this debug object. Will only be triggered if the specified rate is satisified (lower bound).
- Parameters:
text (str) – The new text to replace with.
- class pyrcf.components.callback_handlers.pb_gui_utils.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.
- _lifetime
- _size
- _rgb
- _cid
- _points_id
- _draw_points(point_positions: List[Vector3D])
- update_point_positions(point_positions: List[Vector3D])
Update the positions of the debug points in pybullet.
- Parameters:
point_positions (List[Vector3D]) – List of positions for the points in world.
- remove()
Remove the debug points object from pybullet.