Conscience Core
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
conscience_core::bridging::commands::CommandPathCutEntityDeplacements Class Reference

#include <CommandPathCutEntityDeplacements.h>

Inheritance diagram for conscience_core::bridging::commands::CommandPathCutEntityDeplacements:
conscience_core::bridging::commands::CscCommand

Public Member Functions

 CommandPathCutEntityDeplacements (vector< PathSegmentCommandDataType * > *paths)
 Constructs a CommandPathCutEntityDeplacements instance with a list of path segments. More...
 
 ~CommandPathCutEntityDeplacements ()
 
- 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 CommandTypeIdgetTypeId () const
 
virtual ~CscCommand ()
 
void setOriginalCommandString (string command)
 

Static Public Attributes

static const CommandTypeId COMMAND_ID = "PATH_CUT_ENTITY_DEPLACEMENTS"
 

Protected Member Functions

CscCommandExecutionResultList< PathSegmentCommandDataType > * doExecute (CscEnvironmentSimulator &environmentSimulator) override
 
ptr< CscEntityReflexiongetEntityReflexion () const override
 
CscPoint3dfindIntersection (PathSegmentCommandDataType *pathA, PathSegmentCommandDataType *pathB)
 
SegmentMargins getOffsetPath (PathSegmentCommandDataType &path, double width, double extensionStart=0, double extensionEnd=0)
 
vector< PathSegmentCommandDataType * > cutPathsWithOffset (const vector< PathSegmentCommandDataType * > &pathsToCut, PathSegmentCommandDataType *offsetLeft, PathSegmentCommandDataType *offsetRight)
 
bool isBetweenPath (PathSegmentCommandDataType *segment, PathSegmentCommandDataType *leftBound, PathSegmentCommandDataType *rightBound, double maxDistance)
 
double signedAngleBetweenPaths (const PathSegmentCommandDataType *path1, const PathSegmentCommandDataType *path2)
 
double calculateAngleBetweenTwoPosition (CscPoint3d *firstPosition, CscPoint3d *secondPosition)
 
- Protected Member Functions inherited from conscience_core::bridging::commands::CscCommand
 CscCommand (const CommandTypeId &typeId)
 
const CscCommandExecutionResultNoneresultNone ()
 
const CscCommandExecutionResultSequenceresultSequence (CscSequence *sequence, const string &entitySerialNumber, bool doNotPlay=false)
 
const CscCommandExecutionResultFileresultFile (const fs::path &resultingFilePath)
 
template<class TResult >
const CscCommandExecutionResultObject< TResult > * resultObject (TResult *result)
 
const CscWorldElementId getEntityId () const
 

Protected Attributes

const double WIDTH_OFFSET_IN_CENTIMETER = 25
 
const double LENGTH_END_OFFSET_FOR_PATH_IN_CENTIMETER = 40
 
const double LENGTH_START_OFFSET_FOR_IN_CENTIMETER = 10
 
const double LENGTH_OFFSET_FOR_TRANSITION_IN_CENTIMETER = 100
 
const double MIN_DISTANCE_FOR_SAME_POINT_IN_CM = 2
 
const double MAX_ANGLE_FOR_TRANSITION_IN_DEGREES = 20
 
vector< PathSegmentCommandDataType * > * paths
 
std::unique_ptr< CscLoggerlogger = CscLogger::getForCategory("CommandPathCutEntityDeplacements")
 
- 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)
 

Detailed Description

Trims the input paths to remove segments where the robot passes over the same area again.

Constructor & Destructor Documentation

◆ CommandPathCutEntityDeplacements()

conscience_core::bridging::commands::CommandPathCutEntityDeplacements::CommandPathCutEntityDeplacements ( vector< PathSegmentCommandDataType * > *  paths)

Constructs a CommandPathCutEntityDeplacements instance with a list of path segments.

Parameters
pathsA pointer to a vector of pointers to PathSegmentCommandDataType objects. Each element represents a segment of the path along which the entity will be processed.

◆ ~CommandPathCutEntityDeplacements()

conscience_core::bridging::commands::CommandPathCutEntityDeplacements::~CommandPathCutEntityDeplacements ( )

Member Function Documentation

◆ calculateAngleBetweenTwoPosition()

double conscience_core::bridging::commands::CommandPathCutEntityDeplacements::calculateAngleBetweenTwoPosition ( CscPoint3d secondPosition,
CscPoint3d firstPosition 
)
protected

This method tests whether both endpoints of the given path segment lie within the quadrilateral formed by the start and end points of the left and right boundary segments, with a tolerance (epsilon) to account for numerical imprecision.

◆ cutPathsWithOffset()

vector< PathSegmentCommandDataType * > conscience_core::bridging::commands::CommandPathCutEntityDeplacements::cutPathsWithOffset ( const vector< PathSegmentCommandDataType * > &  pathsToCut,
PathSegmentCommandDataType offsetLeft,
PathSegmentCommandDataType offsetRight 
)
protected

◆ doExecute()

CscCommandExecutionResultList< PathSegmentCommandDataType > * conscience_core::bridging::commands::CommandPathCutEntityDeplacements::doExecute ( CscEnvironmentSimulator environmentSimulator)
overrideprotectedvirtual

◆ findIntersection()

CscPoint3d * conscience_core::bridging::commands::CommandPathCutEntityDeplacements::findIntersection ( PathSegmentCommandDataType pathA,
PathSegmentCommandDataType pathB 
)
protected

◆ getEntityReflexion()

ptr< CscEntityReflexion > conscience_core::bridging::commands::CommandPathCutEntityDeplacements::getEntityReflexion ( ) const
overrideprotectedvirtual

return entity reflexion if this command applies on an entityReflexion, otherwise return nullptr

Implements conscience_core::bridging::commands::CscCommand.

◆ getOffsetPath()

SegmentMargins conscience_core::bridging::commands::CommandPathCutEntityDeplacements::getOffsetPath ( PathSegmentCommandDataType path,
double  width,
double  extensionStart = 0,
double  extensionEnd = 0 
)
protected

◆ isBetweenPath()

bool conscience_core::bridging::commands::CommandPathCutEntityDeplacements::isBetweenPath ( PathSegmentCommandDataType segment,
PathSegmentCommandDataType leftBound,
PathSegmentCommandDataType rightBound,
double  maxDistance 
)
protected

◆ signedAngleBetweenPaths()

double conscience_core::bridging::commands::CommandPathCutEntityDeplacements::signedAngleBetweenPaths ( const PathSegmentCommandDataType path1,
const PathSegmentCommandDataType path2 
)
protected

Member Data Documentation

◆ COMMAND_ID

const CommandTypeId conscience_core::bridging::commands::CommandPathCutEntityDeplacements::COMMAND_ID = "PATH_CUT_ENTITY_DEPLACEMENTS"
inlinestatic

◆ LENGTH_END_OFFSET_FOR_PATH_IN_CENTIMETER

const double conscience_core::bridging::commands::CommandPathCutEntityDeplacements::LENGTH_END_OFFSET_FOR_PATH_IN_CENTIMETER = 40
protected

◆ LENGTH_OFFSET_FOR_TRANSITION_IN_CENTIMETER

const double conscience_core::bridging::commands::CommandPathCutEntityDeplacements::LENGTH_OFFSET_FOR_TRANSITION_IN_CENTIMETER = 100
protected

◆ LENGTH_START_OFFSET_FOR_IN_CENTIMETER

const double conscience_core::bridging::commands::CommandPathCutEntityDeplacements::LENGTH_START_OFFSET_FOR_IN_CENTIMETER = 10
protected

◆ logger

std::unique_ptr<CscLogger> conscience_core::bridging::commands::CommandPathCutEntityDeplacements::logger = CscLogger::getForCategory("CommandPathCutEntityDeplacements")
protected

◆ MAX_ANGLE_FOR_TRANSITION_IN_DEGREES

const double conscience_core::bridging::commands::CommandPathCutEntityDeplacements::MAX_ANGLE_FOR_TRANSITION_IN_DEGREES = 20
protected

◆ MIN_DISTANCE_FOR_SAME_POINT_IN_CM

const double conscience_core::bridging::commands::CommandPathCutEntityDeplacements::MIN_DISTANCE_FOR_SAME_POINT_IN_CM = 2
protected

◆ paths

vector<PathSegmentCommandDataType *>* conscience_core::bridging::commands::CommandPathCutEntityDeplacements::paths
protected

◆ WIDTH_OFFSET_IN_CENTIMETER

const double conscience_core::bridging::commands::CommandPathCutEntityDeplacements::WIDTH_OFFSET_IN_CENTIMETER = 25
protected

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