igibson.objects package

Submodules

igibson.objects.articulated_object module

class igibson.objects.articulated_object.ArticulatedObject(filename, scale=1, merge_fixed_links=True)

Bases: igibson.objects.stateful_object.StatefulObject

Articulated objects are defined in URDF files. They are passive (no motors).

force_wakeup()

Force wakeup sleeping objects

get_body_id()
class igibson.objects.articulated_object.RBOObject(name, scale=1)

Bases: igibson.objects.articulated_object.ArticulatedObject

RBO object from assets/models/rbo Reference: https://tu-rbo.github.io/articulated-objects/

class igibson.objects.articulated_object.URDFObject(filename, name='object_0', category='object', abilities=None, model_path=None, bounding_box=None, scale=None, fit_avg_dim_volume=False, connecting_joint=None, initial_pos=None, initial_orn=None, avg_obj_dims=None, joint_friction=None, in_rooms=None, texture_randomization=False, overwrite_inertial=True, scene_instance_folder=None, bddl_object_scope=None, visualize_primitives=False, joint_positions=None, merge_fixed_links=True, ignore_visual_shape=False)

Bases: igibson.objects.stateful_object.StatefulObject

URDFObjects are instantiated from a URDF file. They can be composed of one or more links and joints. They should be passive. We use this class to parse our modified link tag for URDFs that embed objects into scenes

Adds the meta links (e.g. heating element position, water source position) from the metadata file into the URDF tree for this object prior to loading.

Parameters

meta_links – Dictionary of meta links in the form of {link_name: [linkX, linkY, linkZ]}

Returns

None.

compute_object_pose()
force_wakeup()

Force wakeup sleeping objects

Get object base link position and orientation

Returns

position in xyz

Returns

quaternion in xyzw

get_body_id()
get_orientation()

Get object orientation

Returns

quaternion in xyzw

get_position()

Get object position

Returns

position in xyz

get_position_orientation()

Get object position and orientation

Returns

position in xyz

Returns

quaternion in xyzw

get_prefixed_joint_name(name)
load_supporting_surfaces()
prepare_procedural_texture()

Set up mapping from visual meshes to procedural materials Assign all visual meshes to the same ProceduralMaterial

prepare_randomized_texture()

Set up mapping from visual meshes to randomizable materials

prepare_visual_mesh_to_material()
randomize_texture()

Randomize texture and material for each link / visual shape

remove_floating_joints(folder=None)

Split a single urdf to multiple urdfs if there exist floating joints

rename_urdf()

Helper function that renames the file paths in the object urdf from relative paths to absolute paths

reset()

Reset the object to its original pose and joint configuration

sample_orientation()
scale_object()

Scale the object according to the given bounding box

set_ignore_visual_shape(value)
set_orientation(orn)

Set object orientation

Parameters

orn – quaternion in xyzw

set_position(pos)

Set object position

Parameters

pos – position in xyz

set_position_orientation(pos, orn)

Set object position and orientation :param pos: position in xyz :param orn: quaternion in xyzw

set_room_floor(room_floor)
update_friction()

Update the surface lateral friction for each link based on its material

igibson.objects.cube module

class igibson.objects.cube.Cube(pos=[1, 2, 3], dim=[1, 2, 3], visual_only=False, mass=1000, color=[1, 1, 1, 1])

Bases: igibson.objects.stateful_object.StatefulObject

Cube shape primitive

igibson.objects.multi_object_wrappers module

class igibson.objects.multi_object_wrappers.ObjectGrouper(objects_with_pose_offsets)

Bases: igibson.objects.stateful_object.StatefulObject

A multi-object wrapper that groups multiple objects and applies operations to all of them in parallel.

class AbsoluteStateAggregator(state_type, object_grouper)

Bases: igibson.objects.multi_object_wrappers.ObjectGrouper.BaseStateAggregator

class GroupedStateDump

Bases: list

dump()
get_value()
load(data)
set_value(new_value)
class BaseStateAggregator(state_type, object_grouper)

Bases: object

A fake state that aggregates state between ObjectGrouper objects and propagates updates.

update()
class ProceduralMaterialAggregator(object_grouper)

Bases: object

A fake procedural material that updates the procedural material of all ObjectGrouper objects.

update()
class RelativeStateAggregator(state_type, object_grouper)

Bases: igibson.objects.multi_object_wrappers.ObjectGrouper.BaseStateAggregator

get_value(other)
set_value(other, new_value)
get_orientation()

Get object orientation

Returns

quaternion in xyzw

get_position()

Get object position

Returns

position in xyz

get_position_orientation()

Get object position and orientation

Returns

position in xyz

Returns

quaternion in xyzw

rotate_by(x=0, y=0, z=0)

Rotates an object by given euler angles

set_orientation(orn)

Set object orientation

Parameters

orn – quaternion in xyzw

set_position(pos)

Set object position

Parameters

pos – position in xyz

set_position_orientation(pos, orn)

Set object position and orientation :param pos: position in xyz :param orn: quaternion in xyzw

class igibson.objects.multi_object_wrappers.ObjectMultiplexer(name, multiplexed_objects, current_index)

Bases: igibson.objects.stateful_object.StatefulObject

A multi-object wrapper that acts as a proxy for the selected one between the set of objects it contains.

current_selection()
dump_state()

Dumps the state of the object other than what’s not included in pybullet state.

get_orientation()

Get object orientation

Returns

quaternion in xyzw

get_position()

Get object position

Returns

position in xyz

get_position_orientation()

Get object position and orientation

Returns

position in xyz

Returns

quaternion in xyzw

load_state(dump)

Loads the state of the object other than what’s not included in pybullet state.

rotate_by(x=0, y=0, z=0)

Rotates an object by given euler angles

set_orientation(orn)

Set object orientation

Parameters

orn – quaternion in xyzw

set_position(pos)

Set object position

Parameters

pos – position in xyz

set_position_orientation(pos, orn)

Set object position and orientation :param pos: position in xyz :param orn: quaternion in xyzw

set_selection(idx)

igibson.objects.object_base module

class igibson.objects.object_base.Object

Bases: object

Base Object class

dump_state()

Dumps the state of the object other than what’s not included in pybullet state.

get_orientation()

Get object orientation

Returns

quaternion in xyzw

get_position()

Get object position

Returns

position in xyz

get_position_orientation()

Get object position and orientation

Returns

position in xyz

Returns

quaternion in xyzw

highlight()
load()

Load the object into pybullet. _load() will be implemented in the subclasses

load_state(dump)

Loads the state of the object other than what’s not included in pybullet state.

rotate_by(x=0, y=0, z=0)

Rotates an object by given euler angles

set_orientation(orn)

Set object orientation

Parameters

orn – quaternion in xyzw

set_position(pos)

Set object position

Parameters

pos – position in xyz

set_position_orientation(pos, orn)

Set object position and orientation :param pos: position in xyz :param orn: quaternion in xyzw

unhighlight()

igibson.objects.particles module

class igibson.objects.particles.AttachedParticleSystem(parent_obj, initial_dump=None, **kwargs)

Bases: igibson.objects.particles.ParticleSystem

dump()
initialize(simulator)
reset_to_dump(dump)
stash_particle(particle)
unstash_particle(position, orientation, link_id=- 1, **kwargs)
update(simulator)
class igibson.objects.particles.Dust(parent_obj, **kwargs)

Bases: igibson.objects.particles._Dirt

class igibson.objects.particles.Particle(size, pos, visual_only=False, mass=0.0, color=(1, 1, 1, 1), base_shape='sphere', mesh_filename=None, mesh_bounding_box=None)

Bases: igibson.objects.object_base.Object

A particle object, used to simulate water stream and dust/stain

force_sleep(body_id=None)
force_wakeup()
class igibson.objects.particles.ParticleSystem(num, size, color=(1, 1, 1, 1), class_id=SemanticClass.USER_ADDED_OBJS, use_pbr=False, use_pbr_mapping=False, shadow_caster=True, **kwargs)

Bases: object

dump()
get_active_particles()
get_num()
get_num_active()
get_num_particles_activated_at_any_time()

Get the number of unique particles that were active at some point in history.

get_num_stashed()
get_particles()
get_stashed_particles()
initialize(simulator)
reset_particles_activated_at_any_time()
reset_stash()

Stash all particles and re-order the stash in the all_particles order for determinism.

reset_to_dump(dump)
stash_particle(particle)
unstash_particle(position, orientation, particle=None)
update(simulator)
class igibson.objects.particles.Stain(parent_obj, initial_dump=None, **kwargs)

Bases: igibson.objects.particles._Dirt

dump()
reset_to_dump(dump)
class igibson.objects.particles.WaterStream(water_source_pos, num, initial_dump=None, **kwargs)

Bases: igibson.objects.particles.ParticleSystem

dump()
initialize(simulator)
reset_to_dump(dump)
set_running(on)
update(simulator)

igibson.objects.pedestrian module

class igibson.objects.pedestrian.Pedestrian(style='standing', pos=[0, 0, 0])

Bases: igibson.objects.stateful_object.StatefulObject

Pedestiran object

reset_position_orientation(pos, orn)

Reset pedestrian position and orientation by changing constraint

igibson.objects.shapenet_object module

class igibson.objects.shapenet_object.ShapeNetObject(path, scale=1.0, position=[0, 0, 0], orientation=[0, 0, 0])

Bases: igibson.objects.stateful_object.StatefulObject

ShapeNet object Reference: https://www.shapenet.org/

igibson.objects.soft_object module

class igibson.objects.soft_object.SoftObject(filename, basePosition=[0, 0, 0], baseOrientation=[0, 0, 0, 1], scale=- 1, mass=- 1, collisionMargin=- 1, useMassSpring=0, useBendingSprings=0, useNeoHookean=0, springElasticStiffness=1, springDampingStiffness=0.1, springBendingStiffness=0.1, NeoHookeanMu=1, NeoHookeanLambda=1, NeoHookeanDamping=0.1, frictionCoeff=0, useFaceContact=0, useSelfCollision=0)

Bases: igibson.objects.stateful_object.StatefulObject

Soft object (WIP)

add_anchor(nodeIndex=- 1, bodyUniqueId=- 1, linkIndex=- 1, bodyFramePosition=[0, 0, 0], physicsClientId=0)

Create soft body anchor

igibson.objects.stateful_object module

class igibson.objects.stateful_object.StatefulObject

Bases: igibson.objects.object_base.Object

Stateful Base Object class

dump_state()

Dumps the state of the object other than what’s not included in pybullet state.

load_state(dump)

Loads the state of the object other than what’s not included in pybullet state.

set_orientation(orn)

Set object orientation

Parameters

orn – quaternion in xyzw

set_position(pos)

Set object position

Parameters

pos – position in xyz

set_position_orientation(pos, orn)

Set object position and orientation :param pos: position in xyz :param orn: quaternion in xyzw

igibson.objects.visual_marker module

class igibson.objects.visual_marker.VisualMarker(visual_shape=2, rgba_color=[1, 0, 0, 0.5], radius=1.0, half_extents=[1, 1, 1], length=1, initial_offset=[0, 0, 0])

Bases: igibson.objects.object_base.Object

Visual shape created with shape primitives

force_sleep(body_id=None)
force_wakeup()
set_color(color)

Set the color of the marker

Parameters

color – normalized rgba color

set_orientation(orn)

Set object orientation

Parameters

orn – quaternion in xyzw

set_position(pos)

Set object position

Parameters

pos – position in xyz

set_position_orientation(pos, orn)

Set object position and orientation :param pos: position in xyz :param orn: quaternion in xyzw

igibson.objects.visual_shape module

class igibson.objects.visual_shape.VisualShape(filename, scale=1.0)

Bases: igibson.objects.object_base.Object

Visual shape created with mesh file

igibson.objects.ycb_object module

class igibson.objects.ycb_object.YCBObject(name, scale=1)

Bases: igibson.objects.stateful_object.StatefulObject

YCB Object from assets/models/ycb Reference: https://www.ycbbenchmarks.com/

get_body_id()

Module contents