pyrcf.utils.sim_utils.pybullet_robot_visualizer =============================================== .. py:module:: pyrcf.utils.sim_utils.pybullet_robot_visualizer Classes ------- .. autoapisummary:: pyrcf.utils.sim_utils.pybullet_robot_visualizer.PybulletRobotVisualizer Module Contents --------------- .. py:class:: PybulletRobotVisualizer(pb_sim_interface: pybullet_robot.BulletRobot, joint_lower_lims: Mapping[str, float], joint_upper_lims: Mapping[str, float], starting_joint_positions: Mapping[str, float] = None, ignore_joints_with_str: List[str] = None) Visualizer for a PybulletRobot instance to test joint positioning etc. See `examples/utils_demo/demo_bullet_robot_visualizer.py`. .. warning:: DO NOT use other GUI utils for pybullet (other sliders, buttons etc), when using this. This class uses the `removeAllUserParameters` parameters exposed in pybullet, which means it can remove every debug item created externally. TODO: fix this to only remove self-created items. .. py:attribute:: sim_robot .. py:attribute:: _init_j .. py:attribute:: _ignore_joints_with_str .. py:attribute:: _default_base_pose .. py:attribute:: _base_pose_target .. py:attribute:: _enable_stepping :value: False .. py:attribute:: _j_names :value: [] .. py:attribute:: _j_lower_lims :value: [] .. py:attribute:: _j_upper_lims :value: [] .. py:attribute:: _ok_to_run :value: True .. py:attribute:: _read_button_thread :value: None .. py:method:: run(sim_step_rate: float = 240, slider_update_rate: float = 10, additional_callbacks: List[Callable[[], None]] = None) Run the visualizer thread (non-blocking). :param sim_step_rate: The desired rate (Hz) for calling step simulation (This is not the timestep used in the physics of the simulation). Defaults to 240 (technically this should make it realtime). :type sim_step_rate: float, optional :param slider_update_rate: Update rate (Hz) for reading the joint sliders in pybullet GUI to update robot states. Defaults to 10. :type slider_update_rate: float, optional .. py:method:: close() Close the visualizer. .. py:method:: fromBulletRobot(pb_robot: pyrcf.components.robot_interfaces.simulation.pybullet_robot.PybulletRobot, starting_joint_positions: Mapping[str, float] = None, ignore_joints_with_str: List[str] = None) -> PybulletRobotVisualizer :classmethod: Visualizer for a PybulletRobot instance to test joint positioning etc. See `examples/utils_demo/demo_bullet_robot_visualizer.py` :param pb_robot: The PybulletRobot instance to load. :type pb_robot: PybulletRobot :param starting_joint_positions: Mapping from joint names to starting positions to be used during the visualisation. Defaults to zeros. :type starting_joint_positions: Mapping[str, float], optional :param ignore_joints_with_str: List of substrings to look for in joint names, matching joints will be ignored from the joint sliders GUI (useful for joints such as wheels). Defaults to ["_wheel"] if None provided. :type ignore_joints_with_str: List[str], optional