OpenCog Framework
Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
|
This module contains several tools for creating and managing a simplified representation of a given environment. It has a map structure that stores the physical elements perceived by the agent. It is useful for reasoning and decision making proccess that takes into account the current state of the agent's body and the body of all objects that are located inside the perceived "world".
The directory (opencog/spatial) contains the sources for several libraries and programs: SpaceMap, HPASearch, TangentBug, AStar, MapTools.
This page is a high level overview of the library; to dig into the details read the comprehensive overview.
Dependencies:
Mathematical part of the library provides intuitive classes: math::Dimension2 and math::Dimension3, math::Vector2, math::Vector3 and math::Vector4, math::Line, math::LineSegment, math::Rectangle, math::Triangle, math::Quaternion, math::Plane, math::BoundingBox, math::Face (3D triangle), math::SquareFace
Some linear algebra support via math::Matrix3 and math::Matrix4 is also provided.
All entities inside a virtual world are derived from Entity class. It provides methods to query basic properties like: id, bounding box, dimension, orientation, position, name, expansion radius, height, length, width, direction. They also store properties in one of four formats: string, integer, double and boolean that are managed using setProperty() and get<Type>Property(). Also notice the distanceTo() and computeObjectsLimits() methods. When two or more entities come close to each other they are grouped in a SuperEntity.
Block and StaticEntity are types of non-movable entities, while MovableEntity extends Entity so it can be rotated, moved and oriented. Velocity may also be changed. An Agent in this library is represented by a MovableEntity that has an eye position. PetAgent and HumanoidAgent further extend movable entities.
The library has a class for working with a set of 2D object occuring within a given rectangle of space - LocalSpaceMap2D. It answers queries related to points, regions and trajectories within this rectangle, based on a discretization (i.e. finite grid) of the region. To visualise it, MapExplorerServer is provided. VisibilityMap is a class to keep track of the already visible areas. When the agent is exploring new areas, the tiles corresponding to these areas are been marked as visible.
In 3D space the base class is Entity3D. BlockEntity is made of blocks. Block3D associates a BlockVector, a BlockMaterial and a AxisAlignedBox to a BlockEntity. Octree uses Octree3DMapManager to manage a 3D scene tree and Pathfinder3D provides (static) methods like: AStar3DPathFinder(), calculateCostByDistance() and checkNeighbourAccessable().
AStarController and AStar3DController implements the A* search algorithm based on AStarSearch that may use either FixedSizeAllocator or std new and delete for its memory needs. LSMap2DSearchNode and LSMap3DSearchNode are used as user state classes.
HPASearch is an implementation of the HPA* algorithm. HPA* builds an abstract graph by doing a grid partitioning that results on a set of clusters of original grid cells. Each two sibbling clusters may or may not has entrances. An entrance is the way to cross from on cluster to another. The pathfinding is the execution of the A* on the abstract graph. QuadTree subdivides the grid on a quad tree and builds a graph that represents the free nodes of the tree.
Previous | Next |