pybullet_fleet.devices package

Submodules

pybullet_fleet.devices.door module

Door device — Agent subclass with URDF joint control.

class pybullet_fleet.devices.door.DoorParams(visual_shape=None, collision_shape=None, initial_pose=<factory>, mass=0.0, pickable=True, name=None, visual_frame_pose=None, collision_frame_pose=None, collision_mode=CollisionMode.NORMAL_3D, user_data=<factory>, urdf_path=None, motion_mode=MotionMode.DIFFERENTIAL, use_fixed_base=False, ik_params=None, controller=None, plugins=None, open_positions=None, close_positions=<factory>)

Bases: AgentSpawnParams

Spawn parameters for a Door device.

Extends AgentSpawnParams with door-specific joint targets.

open_positions

Joint name → target angle/position for the “open” state. Required — None raises TypeError in __post_init__.

close_positions

Joint name → target angle/position for the “closed” state.

open_positions: Dict[str, float] | None = None
close_positions: Dict[str, float]
classmethod from_dict(config)

Create DoorParams from a config dict.

Delegates base-field parsing to AgentSpawnParams.from_dict and adds door-specific fields (open_positions, close_positions).

Return type:

DoorParams

class pybullet_fleet.devices.door.Door(body_id, urdf_path=None, motion_mode=MotionMode.DIFFERENTIAL, use_fixed_base=False, collision_mode=CollisionMode.NORMAL_3D, sim_core=None, name=None, user_data=None, mass=None, ik_params=None, joint_tolerance=None, controller=None, notify_spawn=True)

Bases: Agent

Door controlled via URDF revolute or prismatic joint.

Uses JointAction for open/close transitions. Door state is derived from the current JointAction status and joint positions.

Config (YAML):

type: door
urdf_path: robots/door_hinge.urdf
open_positions: {hinge: 1.57}
close_positions: {hinge: 0.0}
classmethod from_params(spawn_params, sim_core=None)

Create a Door from DoorParams.

Raises:

TypeError – If spawn_params is not a DoorParams instance or open_positions is missing.

Return type:

Door

property door_state: DoorState

Derived door state.

request_open()

Open the door (enqueue JointAction to open positions).

Return type:

None

request_close()

Close the door (enqueue JointAction to close positions).

Return type:

None

pybullet_fleet.devices.elevator module

Elevator device — Agent subclass with prismatic Z joint and auto-attach.

Objects (agents, sim_objects) on the platform are automatically attached before movement and detached on arrival, so they physically ride the elevator without any external teleport logic.

class pybullet_fleet.devices.elevator.ElevatorParams(visual_shape=None, collision_shape=None, initial_pose=<factory>, mass=0.0, pickable=True, name=None, visual_frame_pose=None, collision_frame_pose=None, collision_mode=CollisionMode.NORMAL_3D, user_data=<factory>, urdf_path=None, motion_mode=MotionMode.DIFFERENTIAL, use_fixed_base=False, ik_params=None, controller=None, plugins=None, floors=None, initial_floor='', joint_name='lift', platform_link='platform')

Bases: AgentSpawnParams

Spawn parameters for an Elevator device.

Extends AgentSpawnParams with elevator-specific floor/joint config.

floors

Floor name → joint position mapping. Required — None raises TypeError in __post_init__.

initial_floor

Name of the floor the elevator starts at.

joint_name

Name of the prismatic joint that moves the platform.

platform_link

Name of the link with the platform collision box.

floors: Dict[str, float] | None = None
initial_floor: str = ''
joint_name: str = 'lift'
platform_link: str = 'platform'
classmethod from_dict(config)

Create ElevatorParams from a config dict.

Delegates base-field parsing to AgentSpawnParams.from_dict and adds elevator-specific fields (floors, initial_floor, joint_name, platform_link).

Return type:

ElevatorParams

class pybullet_fleet.devices.elevator.Elevator(body_id, urdf_path=None, motion_mode=MotionMode.DIFFERENTIAL, use_fixed_base=False, collision_mode=CollisionMode.NORMAL_3D, sim_core=None, name=None, user_data=None, mass=None, ik_params=None, joint_tolerance=None, controller=None, notify_spawn=True)

Bases: Agent

Elevator with named floors and automatic passenger attachment.

Uses JointAction for floor transitions. Before movement starts, all sim_objects whose AABB overlaps the platform collision box are attached to the platform link. On arrival they are detached.

Config (YAML):

type: elevator
urdf_path: robots/elevator.urdf
use_fixed_base: true
floors: {L1: 0.0, L2: 8.0, L3: 16.0}
initial_floor: L1
joint_name: lift
platform_link: platform
classmethod from_params(spawn_params, sim_core=None)

Create an Elevator from ElevatorParams.

Raises:

TypeError – If spawn_params is not an ElevatorParams instance or floors is missing.

Return type:

Elevator

property current_floor: str

Floor where the elevator currently is (or departed from while moving).

While the elevator is in transit this returns the departure floor, not the destination. Use target_floor for the destination.

property target_floor: str

Destination floor (equals current_floor when idle).

property available_floors: List[str]

List of available floor names.

property is_moving: bool

True while elevator is transitioning between floors.

property passengers: List[SimObject]

Currently attached passengers (read-only copy).

request_floor(floor_name)

Request the elevator to move to the given floor.

Attaches all objects on the platform, then starts the joint action.

Parameters:

floor_name (str) – Name of the target floor (must exist in floors).

Return type:

None

update(dt)

Per-step update. Detaches passengers when movement completes.

Return type:

None

Module contents

Infrastructure devices: doors, elevators.

class pybullet_fleet.devices.Door(body_id, urdf_path=None, motion_mode=MotionMode.DIFFERENTIAL, use_fixed_base=False, collision_mode=CollisionMode.NORMAL_3D, sim_core=None, name=None, user_data=None, mass=None, ik_params=None, joint_tolerance=None, controller=None, notify_spawn=True)

Bases: Agent

Door controlled via URDF revolute or prismatic joint.

Uses JointAction for open/close transitions. Door state is derived from the current JointAction status and joint positions.

Config (YAML):

type: door
urdf_path: robots/door_hinge.urdf
open_positions: {hinge: 1.57}
close_positions: {hinge: 0.0}
classmethod from_params(spawn_params, sim_core=None)

Create a Door from DoorParams.

Raises:

TypeError – If spawn_params is not a DoorParams instance or open_positions is missing.

Return type:

Door

property door_state: DoorState

Derived door state.

request_open()

Open the door (enqueue JointAction to open positions).

Return type:

None

request_close()

Close the door (enqueue JointAction to close positions).

Return type:

None

class pybullet_fleet.devices.DoorParams(visual_shape=None, collision_shape=None, initial_pose=<factory>, mass=0.0, pickable=True, name=None, visual_frame_pose=None, collision_frame_pose=None, collision_mode=CollisionMode.NORMAL_3D, user_data=<factory>, urdf_path=None, motion_mode=MotionMode.DIFFERENTIAL, use_fixed_base=False, ik_params=None, controller=None, plugins=None, open_positions=None, close_positions=<factory>)

Bases: AgentSpawnParams

Spawn parameters for a Door device.

Extends AgentSpawnParams with door-specific joint targets.

open_positions

Joint name → target angle/position for the “open” state. Required — None raises TypeError in __post_init__.

close_positions

Joint name → target angle/position for the “closed” state.

open_positions: Dict[str, float] | None = None
close_positions: Dict[str, float]
classmethod from_dict(config)

Create DoorParams from a config dict.

Delegates base-field parsing to AgentSpawnParams.from_dict and adds door-specific fields (open_positions, close_positions).

Return type:

DoorParams

class pybullet_fleet.devices.Elevator(body_id, urdf_path=None, motion_mode=MotionMode.DIFFERENTIAL, use_fixed_base=False, collision_mode=CollisionMode.NORMAL_3D, sim_core=None, name=None, user_data=None, mass=None, ik_params=None, joint_tolerance=None, controller=None, notify_spawn=True)

Bases: Agent

Elevator with named floors and automatic passenger attachment.

Uses JointAction for floor transitions. Before movement starts, all sim_objects whose AABB overlaps the platform collision box are attached to the platform link. On arrival they are detached.

Config (YAML):

type: elevator
urdf_path: robots/elevator.urdf
use_fixed_base: true
floors: {L1: 0.0, L2: 8.0, L3: 16.0}
initial_floor: L1
joint_name: lift
platform_link: platform
classmethod from_params(spawn_params, sim_core=None)

Create an Elevator from ElevatorParams.

Raises:

TypeError – If spawn_params is not an ElevatorParams instance or floors is missing.

Return type:

Elevator

property current_floor: str

Floor where the elevator currently is (or departed from while moving).

While the elevator is in transit this returns the departure floor, not the destination. Use target_floor for the destination.

property target_floor: str

Destination floor (equals current_floor when idle).

property available_floors: List[str]

List of available floor names.

property is_moving: bool

True while elevator is transitioning between floors.

property passengers: List[SimObject]

Currently attached passengers (read-only copy).

request_floor(floor_name)

Request the elevator to move to the given floor.

Attaches all objects on the platform, then starts the joint action.

Parameters:

floor_name (str) – Name of the target floor (must exist in floors).

Return type:

None

update(dt)

Per-step update. Detaches passengers when movement completes.

Return type:

None

class pybullet_fleet.devices.ElevatorParams(visual_shape=None, collision_shape=None, initial_pose=<factory>, mass=0.0, pickable=True, name=None, visual_frame_pose=None, collision_frame_pose=None, collision_mode=CollisionMode.NORMAL_3D, user_data=<factory>, urdf_path=None, motion_mode=MotionMode.DIFFERENTIAL, use_fixed_base=False, ik_params=None, controller=None, plugins=None, floors=None, initial_floor='', joint_name='lift', platform_link='platform')

Bases: AgentSpawnParams

Spawn parameters for an Elevator device.

Extends AgentSpawnParams with elevator-specific floor/joint config.

floors

Floor name → joint position mapping. Required — None raises TypeError in __post_init__.

initial_floor

Name of the floor the elevator starts at.

joint_name

Name of the prismatic joint that moves the platform.

platform_link

Name of the link with the platform collision box.

floors: Dict[str, float] | None = None
initial_floor: str = ''
joint_name: str = 'lift'
platform_link: str = 'platform'
classmethod from_dict(config)

Create ElevatorParams from a config dict.

Delegates base-field parsing to AgentSpawnParams.from_dict and adds elevator-specific fields (floors, initial_floor, joint_name, platform_link).

Return type:

ElevatorParams