PyBulletClient

class compas_fab.backends.PyBulletClient[source]

Bases: PyBulletBase, ClientInterface

Interface to use pybullet as backend.

compas_fab.backends.PyBulletClient is a context manager type, so it’s best used in combination with the with statement to ensure resource deallocation.

Thanks to Yijiang Huang and his work in pybullet_planning for much inspiration.

Parameters:
connection_typestr

Sets the connection type. Defaults to 'gui'.

verbosebool

Use verbose logging. Defaults to False.

Examples

>>> from compas_fab.backends import PyBulletClient
>>> with PyBulletClient(connection_type='direct') as client:
...     print('Connected: %s' % client.is_connected)
Connected: True

Methods

body_from_obj

Create a PyBullet body from an OBJ file.

cache_robot_model

Saves an editable copy of the robot's model and its meshes for shadowing the state of the robot on the PyBullet server.

check_collision_objects_for_collision

Checks whether any of the collision objects are colliding.

check_collision_with_objects

Checks whether the robot and its attached collision objects with its current configuration is is colliding with any collision objects.

check_collisions

Checks whether the current or given configuration is in collision.

check_robot_self_collision

Checks whether the robot and its attached collision objects with its current configuration is colliding with itself.

convert_mesh_to_body

Convert compas mesh and its frame to a pybullet body.

ensure_cached_robot_model

Checks if a compas_fab.robots.Robot has been cached for use with PyBullet.

ensure_cached_robot_model_geometry

Checks if the geometry of a compas_fab.robots.Robot has been cached for use with PyBullet.

filter_configurations_in_collision

Filters from a list of configurations those which are in collision.

get_cached_robot_filepath

Returns the filepath of the editable copy of the robot's model for shadowing the state of the robot on the PyBullet server.

get_cached_robot_model

Returns the editable copy of the robot's model for shadowing the state of the robot on the PyBullet server.

get_robot_configuration

Gets the robot's current pose.

get_uid

Returns the internal PyBullet id of the robot's model for shadowing the state of the robot on the PyBullet server.

load_robot

Create a pybullet robot using the input urdf file.

load_semantics

Loads the semantic information of a robot.

load_ur5

"Load a UR5 robot to PyBullet.

reload_from_cache

Reloads the PyBullet server with the robot's cached model.

set_robot_configuration

Sets the robot's pose to the given configuration.

step_simulation

By default, the physics server will not step the simulation, unless you explicitly send a step_simulation command.

Inherited Methods

add_attached_collision_mesh

Forwards call to appropriate method in the planner.

add_collision_mesh

Forwards call to appropriate method in the planner.

append_collision_mesh

Forwards call to appropriate method in the planner.

connect

Connect from the PyBullet server.

disconnect

Disconnect from the PyBullet server.

forward_kinematics

Forwards call to appropriate method in the planner.

get_planning_scene

Forwards call to appropriate method in the planner.

inverse_kinematics

Forwards call to appropriate method in the planner.

plan_cartesian_motion

Forwards call to appropriate method in the planner.

plan_motion

Forwards call to appropriate method in the planner.

remove_attached_collision_mesh

Forwards call to appropriate method in the planner.

remove_collision_mesh

Forwards call to appropriate method in the planner.

reset_planning_scene

Forwards call to appropriate method in the planner.