pyrcf.utils.sim_utils.pybullet_robot_visualizer

Classes

PybulletRobotVisualizer

Visualizer for a PybulletRobot instance to test joint positioning etc.

Module Contents

class pyrcf.utils.sim_utils.pybullet_robot_visualizer.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.

sim_robot
_init_j = None
_ignore_joints_with_str = ['_wheel']
_default_base_pose
_base_pose_target
_enable_stepping = False
_j_names = []
_j_lower_lims = []
_j_upper_lims = []
_ok_to_run = True
_read_button_thread = None
run(sim_step_rate: float = 240, slider_update_rate: float = 10, additional_callbacks: List[Callable[[], None]] = None)

Run the visualizer thread (non-blocking).

Parameters:
  • sim_step_rate (float, optional) – 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).

  • slider_update_rate (float, optional) – Update rate (Hz) for reading the joint sliders in pybullet GUI to update robot states. Defaults to 10.

close()

Close the visualizer.

classmethod 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

Visualizer for a PybulletRobot instance to test joint positioning etc.

See examples/utils_demo/demo_bullet_robot_visualizer.py

Parameters:
  • pb_robot (PybulletRobot) – The PybulletRobot instance to load.

  • starting_joint_positions (Mapping[str, float], optional) – Mapping from joint names to starting positions to be used during the visualisation. Defaults to zeros.

  • ignore_joints_with_str (List[str], optional) – 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.