pyrobosim.core.world.World

class pyrobosim.core.world.World(name: str = 'world', inflation_radius: float = 0.0, object_radius: float = 0.0375, wall_height: float = 2.0)

Core world modeling class.

Methods

__init__([name, inflation_radius, ...])

Creates a new world model instance.

add_hallway(**hallway_config)

Adds a hallway from with specified parameters related to the pyrobosim.core.hallway.Hallway class.

add_location([show])

Adds a location at the specified parent entity, usually a room.

add_metadata([locations, objects])

Add location and object metadata from the specified files, allowing additional metadata to be incrementally merged with the existing data.

add_object([show])

Adds an object to a specific location.

add_robot(robot[, loc, pose, show])

Adds a robot to the world given either a world entity and/or pose.

add_room(**room_config)

Adds a room to the world.

close_location(location[, ignore_robots])

Close a storage location or hallway.

collides_with_robots(pose[, robot])

Checks if a pose collides with robots in the world.

get_entity_by_name(name)

Gets any world entity by its name.

get_hallway_by_name(name)

Gets a hallway object by its name.

get_hallway_names()

Gets all hallway names.

get_hallways_attached_to_room(room)

Returns a list of hallways attached to a specific room.

get_hallways_from_rooms(room1, room2)

Returns a list of hallways between two rooms.

get_location_by_name(name)

Gets a location object by its name.

get_location_from_pose(pose[, prev_location])

Gets the name of a location given a pose.

get_location_in_hallway(pose, hallway)

Gets a location in a hallway given an input pose.

get_location_in_room(pose, room)

Gets a location in a room given an input pose.

get_location_metadata()

Returns the location metadata associated with this world.

get_location_names([category_list])

Gets all location names, optionally filtered by category.

get_locations([category_list])

Gets all locations, optionally filtered by category.

get_object_by_name(name)

Gets an object by its name.

get_object_metadata()

Returns the object metadata associated with this world.

get_object_names([category_list])

Gets all object names in the world, optionally filtered by category.

get_object_spawn_names([category_list])

Gets all object spawn location names, optionally filtered by category.

get_object_spawns([category_list])

Gets all object spawn locations, optionally filtered by category.

get_objects([category_list])

Gets all objects in the world, optionally filtered by category.

get_pose_relative_to(pose, entity)

Given a relative pose to an entity, and the entity itself, gets the absolute pose.

get_robot_by_name(name)

Gets a robot by its name.

get_robot_names()

Gets all robot names in the world.

get_room_by_name(name)

Gets a room object by its name.

get_room_names()

Gets all room names in the world.

lock_location(location)

Locks a storage location or hallway.

open_location(location)

Opens a storage location or hallway between two rooms..

remove_all_hallways([restart_numbering])

Cleanly removes all hallways from the world.

remove_all_locations([restart_numbering])

Cleanly removes all locations from the world.

remove_all_objects([restart_numbering])

Cleanly removes all objects from the world.

remove_all_robots([remove_ros_interfaces])

Cleanly removes all robots from the world.

remove_all_rooms()

Cleanly removes all rooms from the world.

remove_hallway(hallway)

Removes a hallway between two rooms.

remove_location(location)

Cleanly removes a location from the world.

remove_object(obj[, show])

Cleanly removes an object from the world.

remove_robot(robot[, show, ...])

Removes a robot from the world.

remove_room(room)

Removes a room from the world.

reset([deterministic, seed])

Resets the world to its initial state.

sample_free_robot_pose_uniform([robot, ...])

Sample an unoccupied robot pose in the world.

sample_object_spawn_pose(obj, obj_spawn, ...)

Samples an object pose in a specific object spawn.

set_inflation_radius([inflation_radius])

Sets world inflation radius.

set_metadata([locations, objects])

Sets location and object metadata from the specified files.

shutdown()

Cleanly shuts down the world.

unlock_location(location)

Unlocks a storage location or hallway.

update_bounds(entity[, remove])

Updates the X and Y bounds of the world.

update_location(location, pose[, room, ...])

Updates an existing location in the world.

update_object(obj[, loc, pose])

Updates an existing object in the world.

update_polygons()

Updates the world's collision polygons when an entity is added or removed.