concepts.simulator.pybullet.client.BulletClient#
- class BulletClient[source]#
- Bases: - object- A wrapper for the pybullet client. - Methods - absolute_timeout(duration)- add_debug_coordinate_system(pos, principle_axes)- add_debug_coordinate_system_quat(pos, quat)- add_debug_cube(center, extent, color[, ...])- add_debug_line(start_pos, end_pos, color[, ...])- add_debug_ray(start_pos, delta, color[, ...])- add_debug_text(text, pos, color[, name, ...])- canonicalize_asset_path(path)- connect([suppress_warnings])- disable_rendering([disable_rendering, ...])- disable_stdout([activate])- Temporarily disable the world update. - has_gui()- is_stable([velocity_threshold, ...])- load_mjcf(xml_path[, pos, quat, body_name, ...])- load_sdf(xml_path[, scale, notify_world_update])- load_urdf(xml_path[, pos, quat, body_name, ...])- load_urdf_string(string[, pos, quat])- load_urdf_template(xml_path, replaces[, ...])- loads_mjcf(xml_content[, pos, quat, save_to])- register_debug_item(name, item_id)- remove_body(body_id)- remove_debug_item(item_id)- set_rendering(enable)- set_rendering_fps([render_fps])- step([steps, realtime_rendering])- step_until_stable([max_steps, ...])- timeout(duration)- wait_for_duration(duration)- wait_for_user([message])- with_fps([fps, render_fps, realtime_rendering])- Attributes - Alias for self.w. - The debug items that are added to the world. - __init__(assets_root=None, is_gui=False, *, fps=None, render_fps=None, gravity=None, connect=True, client_id=-1, width=960, height=960, additional_title=None, save_video=None, enable_realtime_rendering=None, enable_debug_gui=False, engine_parameters=None)[source]#
- Initialize the BulletClient. - Parameters:
- assets_root (str | None) – the root directory of the assets (by default it is the assets directory in the concepts package). 
- is_gui (bool) – whether to enable the GUI. 
- fps (int | None) – the physics simulation FPS (default: 120). 
- render_fps (int | None) – the rendering FPS (default: 120). 
- gravity (Tuple[float] | float | None) – the gravity vector (default: (0, 0, -9.8)). 
- connect (bool) – whether to connect to the server immediately. 
- client_id (int) – the client id to connect to. If this is set to -1, a new client id will be created. 
- save_video (str | None) – the path to save the video. 
- width (int | None) – the width of the window. 
- height (int | None) – the height of the window. 
- additional_title (str | None) – the additional title of the window. 
- enable_debug_gui (bool) – whether to enable the debug GUI. 
- enable_realtime_rendering (bool | None) – whether to enable realtime rendering (default: True if render_fps is set, otherwise False). 
- engine_parameters (Dict[str, Any] | None) – additional engine parameters. 
 
 
 - __new__(**kwargs)#
 - disable_world_update()[source]#
- Temporarily disable the world update. Specifically, when loading a new model, the world object self.w will not be updated. This function also disables rendering of the pybullet debug renderer. Thus, this functionality is useful when loading a large number of models. 
 - is_stable(velocity_threshold=1e-3, angular_velocity_threshold=1e-3, joint_velocity_threshold=1e-3)[source]#
 - load_mjcf(xml_path, pos=(0, 0, 0), quat=(0, 0, 0, 1), body_name=None, group='__UNSET__', static=False, notify_world_update=True)[source]#
- Return type:
 
 - load_urdf(xml_path, pos=(0, 0, 0), quat=(0, 0, 0, 1), body_name=None, group='__UNSET__', static=False, scale=1.0, rgba=None, notify_world_update=True)[source]#
 - set_enable_realtime_rendering(enable_realtime_rendering=None)[source]#
- Parameters:
- enable_realtime_rendering (bool | None) 
 
 - step_until_stable(max_steps=int(1e6), velocity_threshold=1e-3, angular_velocity_threshold=1e-3, joint_velocity_threshold=1e-3)[source]#
 - DEFAULT_ASSETS_ROOT = '/Users/jiayuanm/Projects/Concepts/concepts/assets'#
 - DEFAULT_ENGINE_PARAMETERS = {'numSolverIterations': 10}#
 - DEFAULT_FPS = 240#
 - DEFAULT_GRAVITY = (0, 0, -9.8)#
 - debug_items: Dict[str, int | Tuple[int, ...]]#
- The debug items that are added to the world. The key is the name of the item, and the value is the item id. 
 - property world#
- Alias for self.w.