This class is made to allow entities to explore a given area. An entity will follow a "boustrophedon path" for each trapezoidal cell in an area, it will start from a corner of a cell, following the boundary in a straight line, it will reach another corner, there it will rotate 180° and follow a straight line parallel to the first, and it will repeat these actions as soons as it reach a boundary. More...
#include <CommandAreaAnalysis.h>
Public Member Functions | |
| CommandAreaAnalysis (ptr< CscEntityReflexion > entityReflexion, vector< const CscPoint3d * > areaVertices, vector< vector< const CscPoint3d * >> holes, double areaOfPerceptionWidth, const CscPoint3d *entityPosition, optional< bool > doNotPlay) | |
| ~CommandAreaAnalysis () override | |
Public Member Functions inherited from conscience_core::bridging::commands::CscCommand | |
| const CscCommandExecutionResult * | _execute (CscEnvironmentSimulator &environmentSimulator) |
| template<class TResult = CscCommandExecutionResult> | |
| const TResult * | execute (CscEnvironmentSimulator &environmentSimulator) |
| const CommandTypeId & | getTypeId () const |
| virtual | ~CscCommand () |
| void | setOriginalCommandString (string command) |
Static Public Attributes | |
| static const CommandTypeId | COMMAND_ID = "AREA_ANALYSIS" |
Protected Member Functions | |
| ptr< CscEntityReflexion > | getEntityReflexion () const override |
| const CscCommandExecutionResultSequence * | doExecute (CscEnvironmentSimulator &environmentSimulator) override |
Protected Member Functions inherited from conscience_core::bridging::commands::CscCommand | |
| CscCommand (const CommandTypeId &typeId) | |
| const CscCommandExecutionResultNone * | resultNone () |
| const CscCommandExecutionResultSequence * | resultSequence (CscSequence *sequence, const string &entitySerialNumber, bool doNotPlay=false) |
| const CscCommandExecutionResultFile * | resultFile (const fs::path &resultingFilePath) |
| template<class TResult > | |
| const CscCommandExecutionResultObject< TResult > * | resultObject (TResult *result) |
| const CscWorldElementId | getEntityId () const |
Protected Attributes | |
| ptr< CscEntityReflexion > | entityReflexion |
Protected Attributes inherited from conscience_core::bridging::commands::CscCommand | |
| const CommandTypeId | typeId |
| optional< string > | originalCommandString = {} |
Additional Inherited Members | |
Public Types inherited from conscience_core::bridging::commands::CscCommand | |
| typedef function< void(CscCommand *command)> | CommandExecutedListener |
Static Public Member Functions inherited from conscience_core::bridging::commands::CscCommand | |
| static void | addCommandExecutedListener (CommandExecutedListener listener) |
This class is made to allow entities to explore a given area. An entity will follow a "boustrophedon path" for each trapezoidal cell in an area, it will start from a corner of a cell, following the boundary in a straight line, it will reach another corner, there it will rotate 180° and follow a straight line parallel to the first, and it will repeat these actions as soons as it reach a boundary.
Work In Progress : implementing algorithm for concave areas and areas with obstacles
| conscience_core::bridging::commands::CommandAreaAnalysis::CommandAreaAnalysis | ( | ptr< CscEntityReflexion > | entityReflexion, |
| vector< const CscPoint3d * > | areaVertices, | ||
| vector< vector< const CscPoint3d * >> | holes, | ||
| double | areaOfPerceptionWidth, | ||
| const CscPoint3d * | entityPosition, | ||
| optional< bool > | doNotPlay | ||
| ) |
| areaVertices | Vertices of the polygon, needs to contains more than 2 vertices (else it won't be a polygon), and they need to be in order, the last element of the vector forms an edge with the first, the first with the second... |
| areaOfPerceptionWidth | width of area an entity can "scan" at a position, the class is really sensible with this parameter as it is used to discretize a polygon (too low and there will be many points , too high will lead to just a few points) |
| doNotPlay | pass true if you want to avoid that sequence is played right after command is executed |
|
override |
|
overrideprotectedvirtual |
Implements conscience_core::bridging::commands::CscCommand.
|
inlineoverrideprotectedvirtual |
return entity reflexion if this command applies on an entityReflexion, otherwise return nullptr
Implements conscience_core::bridging::commands::CscCommand.
|
inlinestatic |
|
protected |