concepts.simulator.pybullet.world.BulletWorld#
- class BulletWorld[source]#
Bases:
object
Methods
change_dynamics
(body_id, mass, lateral_friction)change_visual_color
(body_id, rgba[, link_id])check_collision
(a, b[, update])check_collision_single
(a, ignored_objects[, ...])Check if the object is in collision with any object other than the ignored objects.
get_all_mesh_info
(body_id)Get the mesh filenames and transforms of all links of a body.
get_batched_qpos
(names[, numpy])get_batched_qpos_by_id
(body_id, joint_ids[, ...])get_batched_qvel
(names[, numpy])get_batched_qvel_by_id
(body_id, joint_ids[, ...])get_body_index
(body_name)get_body_name
(body_id)get_body_state
(body_name)get_body_state_by_id
(body_id)get_collision_shape_data
(body_name)get_collision_shape_data_by_id
(body_id)get_constraint
(constraint_id)get_contact
([a, b, update])get_free_joints
(body_id)Get a list of indices corresponding to all non-fixed joints in the body.
get_joint_info
(joint_name)get_joint_info_by_body
(body_id)get_joint_info_by_id
(body_id, joint_id)get_joint_state
(joint_name)get_joint_state_by_id
(body_id, joint_id)get_link_index
(link_name)get_link_index_with_body
(body_id, link_name)get_link_name
(body_id, link_id)get_link_state
(link_name[, fk])get_link_state_by_id
(body_id, link_id[, fk])get_mesh
(body_id[, zero_center, verbose, ...])Get the point cloud of a body.
get_mesh_box
(*args, **kwargs)get_mesh_info
(body_id[, link_id])Get the mesh filename and transform of a body or link.
get_mesh_mesh
(*args, **kwargs)get_pointcloud
(body_id[, points_per_geom, ...])Get the point cloud of a body.
get_pointcloud_box
(*args, **kwargs)get_pointcloud_mesh
(*args, **kwargs)get_qpos
(name)get_qpos_by_id
(body_id, joint_id)get_qvel
(name)get_qvel_by_id
(body_id, joint_id)get_single_contact_normal
(object_id, ...[, ...])get_state
(name[, type])get_supporting_objects_by_id
(body_id[, ...])Get the bodies that are supporting the given body.
get_trimesh
(body_id[, zero_center, verbose, ...])Get the Trimesh triangle mesh of a body.
get_trimesh_mesh
(*args, **kwargs)get_visual_shape_data
(body_name)get_visual_shape_data_by_id
(body_id)get_xmat
(name[, type])get_xpos
(name[, type])get_xquat
(name[, type])is_collision_free
(a, b)notify_update
(body_id[, body_name, group])register_additional_state_saver
(name, ...)register_managed_interface
(name, interface)render_image
(config[, image_size, ...])save_bodies
(body_identifiers)save_body
(body_identifier)set_batched_qpos
(names, qpos)set_batched_qpos_by_id
(body_id, joint_ids, qpos)set_body_state
(body_name, state)set_body_state2
(body_name, position, orientation)set_body_state2_by_id
(body_id, position, ...)set_body_state_by_id
(body_id, state)set_client_id
(client_id)set_debug_camera
(distance, yaw, pitch, target)set_joint_state
(joint_name, state)set_joint_state2
(joint_name, position[, ...])set_joint_state2_by_id
(body_id, joint_id, ...)set_joint_state_by_id
(body_id, joint_id, state)set_qpos
(name, qpos)set_qpos_by_id
(body_id, joint_id, qpos)transform_mesh
(mesh, pos, quat_xyzw)transform_mesh2
(mesh, pos, quat_xyzw, ...)transform_pcd
(raw_pcd, pos, quat_xyzw)transform_trimesh
(mesh, pos, quat_xyzw)Attributes
The mapping from body name to body index.
The mapping from link name to link index.
The mapping from joint name to joint index.
The mapping from global name to global identifier.
The mapping from body name to base link name.
The mapping from group name to body indices.
The mapping from identifiers to interface objects.
The mapping from identifiers to additional state savers.
- __new__(**kwargs)#
- check_collision(a, b, update=False)[source]#
- Parameters:
a (int | LinkIdentifier | str)
b (int | LinkIdentifier | str)
update (bool)
- Return type:
- check_collision_single(a, ignored_objects, ignore_self_collision=True, update=False)[source]#
Check if the object is in collision with any object other than the ignored objects.
- get_contact(a=None, b=None, update=False)[source]#
- Parameters:
a (int | LinkIdentifier | str | None)
b (int | LinkIdentifier | str | None)
update (bool)
- Return type:
- get_free_joints(body_id)[source]#
Get a list of indices corresponding to all non-fixed joints in the body.
- get_link_index(link_name)[source]#
- Parameters:
link_name (str | LinkIdentifier | Tuple[int, int])
- Return type:
- get_mesh(body_id, zero_center=True, verbose=False, mesh_filename=None, mesh_scale=1.0, use_visual_shape=False)[source]#
Get the point cloud of a body.
- Parameters:
body_id (int) – the ID of the body.
zero_center (bool) – whether to zero-center the mesh (i.e., move the center of the mesh to the origin).
verbose (bool) – whether to print debug information.
mesh_filename (str | None) – the filename of the mesh. This should be provided if the body has a mesh shape but we can’t get it from the collision shape data.
mesh_scale (float) – the scale of the mesh. This should be provided if the body has a mesh shape but we can’t get it from the collision shape data.
use_visual_shape (bool)
- Return type:
open3d.geometry.TriangleMesh
- get_mesh_box(*args, **kwargs)[source]#
- Parameters:
self (BulletWorld)
- get_mesh_mesh(*args, **kwargs)[source]#
- Parameters:
self (BulletWorld)
- get_pointcloud(body_id, points_per_geom=1000, zero_center=True, use_visual_shape=False)[source]#
Get the point cloud of a body.
- get_pointcloud_box(*args, **kwargs)[source]#
- Parameters:
self (BulletWorld)
- get_pointcloud_mesh(*args, **kwargs)[source]#
- Parameters:
self (BulletWorld)
- get_single_contact_normal(object_id, support_object_id, deviation_tol=0.05, return_center=False)[source]#
- get_supporting_objects_by_id(body_id, return_name=True)[source]#
Get the bodies that are supporting the given body.
- get_trimesh(body_id, zero_center=False, verbose=False, mesh_filename=None, mesh_scale=1.0, use_visual_shape=False)[source]#
Get the Trimesh triangle mesh of a body.
- Parameters:
body_id (int) – the ID of the body.
zero_center (bool) – whether to zero-center the mesh (i.e., move the center of the mesh to the origin).
verbose (bool) – whether to print debug information.
mesh_filename (str | None) – the filename of the mesh. This should be provided if the body has a mesh shape but we can’t get it from the collision shape data.
mesh_scale (float) – the scale of the mesh. This should be provided if the body has a mesh shape but we can’t get it from the collision shape data.
use_visual_shape (bool)
- Return type:
List[trimesh.Trimesh]
- get_trimesh_mesh(*args, **kwargs)[source]#
- Parameters:
self (BulletWorld)
- is_collision_free(a, b)[source]#
- Parameters:
a (int | LinkIdentifier | str)
b (int | LinkIdentifier | str)
- Return type:
- register_additional_state_saver(name, saver_factory)[source]#
- Parameters:
name (str)
saver_factory (Callable[[], BulletSaver])
- set_joint_state(joint_name, state)[source]#
- Parameters:
joint_name (str)
state (JointState)
- set_joint_state_by_id(body_id, joint_id, state)[source]#
- Parameters:
body_id (int)
joint_id (int)
state (JointState)
- additional_state_savers: Dict[str, Callable[[], BulletSaver]]#
The mapping from identifiers to additional state savers.
- body_names: _NameToIdentifier#
The mapping from body name to body index.
- global_names: _NameToIdentifier#
The mapping from global name to global identifier.
- joint_names: _NameToIdentifier#
The mapping from joint name to joint index.
- link_names: _NameToIdentifier#
The mapping from link name to link index.
- property nr_bodies#
- property nr_joints#
- property nr_links#