Public Member Functions | Private Attributes
rail::spatial_temporal_learning::worldlib::world::World Class Reference

World configuration information. More...

#include <World.h>

List of all members.

Public Member Functions

void addItem (const Item &item)
 Item adder.
void addRoom (const Room &room)
 Room adder.
void findClosestSurface (const geometry::Position &position, size_t &room_index, size_t &surface_index) const
 Closest Surface finder.
const ItemfindItem (const std::string &name) const
 Item finder (immutable).
ItemfindItem (const std::string &name)
 Item finder.
bool findPlacementSurface (const geometry::Position &position, size_t &room_index, size_t &surface_index, size_t &placement_surface_index) const
 PlacementSurface finder.
const RoomfindRoom (const std::string &name) const
 Room finder (immutable).
RoomfindRoom (const std::string &name)
 Room finder.
const std::string & getFixedFrameID () const
 Fixed frame ID accessor.
const ItemgetItem (const size_t index) const
 Item value accessor (immutable).
ItemgetItem (const size_t index)
 Item value accessor.
const std::vector< Item > & getItems () const
 Items value accessor (immutable).
std::vector< Item > & getItems ()
 Items value accessor (immutable).
size_t getNumItems () const
 Items size accessor.
size_t getNumRooms () const
 Rooms size accessor.
const RoomgetRoom (const size_t index) const
 Room value accessor (immutable).
RoomgetRoom (const size_t index)
 Room value accessor.
const std::vector< Room > & getRooms () const
 Rooms value accessor (immutable).
std::vector< Room > & getRooms ()
 Rooms value accessor.
bool itemExists (const std::string &name) const
 Check for the existence of an Item.
bool loadFromYaml (const std::string &file)
 Load configuration data from a YAML file.
void removeItem (const size_t index)
 Item remover.
void removeRoom (const size_t index)
 Room remover.
bool roomExists (const std::string &name) const
 Check for the existence of a Room.
void setFixedFrameID (const std::string &fixed_frame_id)
 Fixed frame ID mutator.
 World (const std::string &fixed_frame_id="")
 Create a new World.

Private Attributes

std::string fixed_frame_id_
std::vector< Itemitems_
std::vector< Roomrooms_

Detailed Description

World configuration information.

A world consists of a series of rooms, surfaces, and items. Surfaces can have points of interest as well.

Definition at line 43 of file World.h.


Constructor & Destructor Documentation

World::World ( const std::string &  fixed_frame_id = "")

Create a new World.

Creates a new empty World with an optional fixed frame ID.

Parameters:
fixed_frame_idThe fixed frame ID of the World (defaults to the empty string).

Definition at line 23 of file World.cpp.


Member Function Documentation

void World::addItem ( const Item item)

Item adder.

Add the Item to this World.

Parameters:
itemThe new Item to add.

Definition at line 308 of file World.cpp.

void World::addRoom ( const Room room)

Room adder.

Add the Room to this World.

Parameters:
roomThe new Room to add.

Definition at line 208 of file World.cpp.

void World::findClosestSurface ( const geometry::Position position,
size_t &  room_index,
size_t &  surface_index 
) const

Closest Surface finder.

Find the closest surface to the given Position in the world fixed frame.

Parameters:
positionThe Position to find the closest Surface to (in the world's fixed frame).
room_indexWill be set to the Room index in the World.
surface_indexWill be set to the Surface index in the Room.
Exceptions:
std::out_of_rangeThrown if no Rooms or Surfaces exist in the World.

Definition at line 368 of file World.cpp.

const Item& rail::spatial_temporal_learning::worldlib::world::World::findItem ( const std::string &  name) const

Item finder (immutable).

Find an Item with the given name. This will also check the aliases. Case is not important. If multiple items exist with the given name, the first Item is returned.

Parameters:
nameThe name or alias of the Item to find.
Returns:
The Item with the given name.
Exceptions:
std::out_of_rangeThrown if no Item with the given name exists.

Item finder.

Find an Item with the given name. This will also check the aliases. Case is not important. If multiple items exist with the given name, the first Item is returned.

Parameters:
nameThe name or alias of the Item to find.
Returns:
The Item with the given name.
Exceptions:
std::out_of_rangeThrown if no Item with the given name exists.
bool World::findPlacementSurface ( const geometry::Position position,
size_t &  room_index,
size_t &  surface_index,
size_t &  placement_surface_index 
) const

PlacementSurface finder.

Find the PlacementSurface (if any) that the Position is on. This will checking the bounding range of each Surface and find the closest PlacementSurface the Position is on. Since it is likely a Position will not be on a Placement surface (e.g., from noise or floating objects), this method returns false instead of throwing an exception.

Parameters:
positionThe Position to find the PlacemetSurface to (in the world's fixed frame).
room_indexWill be set to the Room index in the World.
surface_indexWill be set to the Surface index in the Room.
placement_surface_indexWill be set to the PlacemetSurface index in the Surface.
Returns:
If a valid PlacementSurface was found.

Definition at line 405 of file World.cpp.

const Room& rail::spatial_temporal_learning::worldlib::world::World::findRoom ( const std::string &  name) const

Room finder (immutable).

Find a Room with the given name. This will also check the aliases. Case is not important. If multiple rooms exist with the given name, the first Room is returned.

Parameters:
nameThe name or alias of the Room to find.
Exceptions:
std::out_of_rangeThrown if no PointOfInterest with the given name exists.

Room finder.

Find a Room with the given name. This will also check the aliases. Case is not important. If multiple rooms exist with the given name, the first Room is returned.

Parameters:
nameThe name or alias of the Room to find.
Exceptions:
std::out_of_rangeThrown if no Room with the given name exists.
const string & World::getFixedFrameID ( ) const

Fixed frame ID accessor.

Get the fixed frame ID this World.

Returns:
The fixed frame ID of this World.

Definition at line 159 of file World.cpp.

const Item & World::getItem ( const size_t  index) const

Item value accessor (immutable).

Get the Item of this World at the given index.

Parameters:
iThe index of the Item to get.
Returns:
The Item at the given index.
Exceptions:
std::out_of_rangeThrown if the Item at the given index does not exist.

Definition at line 284 of file World.cpp.

Item & World::getItem ( const size_t  index)

Item value accessor.

Get the Item of this World at the given index.

Parameters:
iThe index of the Item to get.
Returns:
The Item at the given index.
Exceptions:
std::out_of_rangeThrown if the Item at the given index does not exist.

Definition at line 296 of file World.cpp.

const vector< Item > & World::getItems ( ) const

Items value accessor (immutable).

Get the items of this World.

Returns:
The items.

Definition at line 269 of file World.cpp.

vector< Item > & World::getItems ( )

Items value accessor (immutable).

Get the items of this World.

Returns:
The items.

Definition at line 274 of file World.cpp.

size_t World::getNumItems ( ) const

Items size accessor.

Get the number of items of this World.

Returns:
The number of items of this World.

Definition at line 279 of file World.cpp.

size_t World::getNumRooms ( ) const

Rooms size accessor.

Get the number of rooms of this World.

Returns:
The number of rooms of this World.

Definition at line 179 of file World.cpp.

const Room & World::getRoom ( const size_t  index) const

Room value accessor (immutable).

Get the Room of this World at the given index.

Parameters:
iThe index of the Room to get.
Returns:
The Room at the given index.
Exceptions:
std::out_of_rangeThrown if the Room at the given index does not exist.

Definition at line 184 of file World.cpp.

Room & World::getRoom ( const size_t  index)

Room value accessor.

Get the Room of this World at the given index.

Parameters:
iThe index of the Room to get.
Returns:
The Room at the given index.
Exceptions:
std::out_of_rangeThrown if the Room at the given index does not exist.

Definition at line 196 of file World.cpp.

const vector< Room > & World::getRooms ( ) const

Rooms value accessor (immutable).

Get the rooms of this World.

Returns:
The rooms.

Definition at line 169 of file World.cpp.

vector< Room > & World::getRooms ( )

Rooms value accessor.

Get the rooms of this World.

Returns:
The rooms.

Definition at line 174 of file World.cpp.

bool World::itemExists ( const std::string &  name) const

Check for the existence of an Item.

Check for the existence of an Item in the World. This will also check the aliases. Case is not important.

Parameters:
nameThe name or alias of the Item to find.
Returns:
If the Item exists.
Exceptions:
std::out_of_rangeThrown if no Room with the given name exists.

Definition at line 325 of file World.cpp.

bool World::loadFromYaml ( const std::string &  file)

Load configuration data from a YAML file.

Load world configuration information from the given YAML file. This will attempt to load Pose data from a TF client and thus should only be run on a live system.

Parameters:
fileThe name of the YAML file to load.
Returns:
True if configuration data was successfully loaded.

Definition at line 27 of file World.cpp.

void World::removeItem ( const size_t  index)

Item remover.

Remove the Item at the given index. An invalid index results in no effect.

Parameters:
iThe index of the Item pose to remove.
Exceptions:
std::out_of_rangeThrown if the Item at the given index does not exist.

Definition at line 313 of file World.cpp.

void World::removeRoom ( const size_t  index)

Room remover.

Remove the Room at the given index. An invalid index results in no effect.

Parameters:
iThe index of the Room pose to remove.
Exceptions:
std::out_of_rangeThrown if the Room at the given index does not exist.

Definition at line 213 of file World.cpp.

bool World::roomExists ( const std::string &  name) const

Check for the existence of a Room.

Check for the existence of a Room in the World. This will also check the aliases. Case is not important.

Parameters:
nameThe name or alias of the Room to find.
Exceptions:
std::out_of_rangeThrown if no Room with the given name exists.

Definition at line 225 of file World.cpp.

void World::setFixedFrameID ( const std::string &  fixed_frame_id)

Fixed frame ID mutator.

Set the fixed frame ID this World to the given value.

Parameters:
Thenew fixed frame ID value of this World.

Definition at line 164 of file World.cpp.


Member Data Documentation

The fixed frame of the world.

Definition at line 330 of file World.h.

Item information for the world.

Definition at line 334 of file World.h.

Room information for the world.

Definition at line 332 of file World.h.


The documentation for this class was generated from the following files:


worldlib
Author(s): Russell Toris
autogenerated on Fri Feb 12 2016 00:24:19