pyrobosim.core.world.World.add_object

World.add_object(show: bool = True, **object_config: Any) Object | None

Adds an object to a specific location.

If the object does not have a specified name, it will be given an automatic name using its category, e.g., "apple0".

If the location contains multiple object spawns, one will be selected at random.

Parameters:
  • show – If True (default), causes the GUI to be updated. This is mostly for internal usage to speed up reloading.

  • **object_config

    Keyword arguments describing the object.

    You can use object=Object(...) to directly pass in a pyrobosim.core.objects.Object object, or alternatively use the same keyword arguments you would use to create an Object instance.

    You can also pass in the parent entity name as the parent argument, and it will be resolved to an actual entity, if it exists in the world.

Returns:

Object instance if successfully created, else None.