Go to the documentation of this file.
30 #include <VirtualRobot/CollisionDetection/CDManager.h>
31 #include <VirtualRobot/SceneObjectSet.h>
32 #include <VirtualRobot/Robot.h>
36 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
38 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
39 #include <RobotComponents/interface/components/MotionPlanning/CSpace/SimoxCSpace.h>
41 #include <VirtualRobot/XML/RobotIO.h>
68 virtual public SimoxCSpaceBase,
86 void addStationaryObject(
const StationaryObject& obj,
const Ice::Current& = Ice::emptyCurrent)
override;
92 void setAgent(
const AgentPlanningInformation& agentInfo,
const Ice::Current& = Ice::emptyCurrent)
override;
99 virtual void addObjectsFromWorkingMemory(memoryx::WorkingMemoryInterfacePrx workingMemoryPrx,
const std::vector<std::string>& excludedInstancesIds = std::vector<std::string>());
118 CSpaceBasePtr
clone(
const Ice::Current& = Ice::emptyCurrent)
override
135 bool isCollisionFree(const::std::pair<const Ice::Float*, const Ice::Float*>& cfg,
const Ice::Current& = Ice::emptyCurrent)
override;
158 virtual void setConfig(
const float*& it);
170 return stationaryObjects;
202 VectorXf
jointMapToVector(
const std::map<std::string, float>& jointMap,
bool checkForNonexistenJointsInCspace =
false)
const;
214 std::vector<armarx::DebugDrawerLineSet>
getTraceVisu(
const Path& p,
const std::vector<std::string>& nodeNames,
float traceStepSize = std::numeric_limits<float>::infinity())
218 std::vector<armarx::DebugDrawerLineSet>
getTraceVisu(
const PathWithCost& p,
const std::vector<std::string>& nodeNames,
float traceStepSize = std::numeric_limits<float>::infinity())
222 std::vector<armarx::DebugDrawerLineSet>
getTraceVisu(
const VectorXfSeq& vecs,
const std::vector<std::string>& nodeNames,
float traceStepSize = std::numeric_limits<float>::infinity());
226 return stationaryObjectMargin;
233 this->stationaryObjectMargin = stationaryObjectMargin;
237 ARMARX_ERROR <<
"Could not set stationary object margin, because the cSpace is already initialized.";
280 VirtualRobot::CDManager
cd;
285 VirtualRobot::SceneObjectSetPtr
stationaryObjectSet {
new VirtualRobot::SceneObjectSet{
"StationaryObjectSet"}};
314 std::vector<VirtualRobot::RobotNodePtr>
joints;
361 class SimoxCSpaceWith2DPose;
368 virtual public SimoxCSpaceWith2DPoseBase
375 poseBounds = newBounds;
398 void setConfig(
const float*& it)
override;
414 virtual public SimoxCSpaceWith3DPoseBase
421 poseBounds = newBounds;
442 void setConfig(
const float*& it)
override;
std::vector< armarx::DebugDrawerLineSet > getTraceVisu(const PathWithCost &p, const std::vector< std::string > &nodeNames, float traceStepSize=std::numeric_limits< float >::infinity())
void setConfig(const float *&it) override
void setConfig(const float *&it) override
virtual TrajectoryPtr pathToTrajectory(const PathWithCost &p) const
FloatRangeSeq getDimensionsBounds(const Ice::Current &=Ice::emptyCurrent) const override
AgentData getAgentDataAndLoadRobot() const
SimoxCSpaceWith3DPose()=default
bool isCollisionFree(const ::std::pair< const Ice::Float *, const Ice::Float * > &config, const Ice::Current &=Ice::emptyCurrent) override=0
AgentData getAgentDataFromRobot(VirtualRobot::RobotPtr robotPtr) const
std::vector< VirtualRobot::RobotNodePtr > joints
The agent's joints.
const VirtualRobot::RobotPtr & getAgentSceneObj() const
VirtualRobot::RobotPtr agent
The agent's collision model.
virtual TrajectoryPtr pathToTrajectory(const Path &p) const
bool isInitialized
Whether the collision check is initialized.
void setStationaryObjectMargin(float stationaryObjectMargin)
Similar to armarx::SimoxCSpace, but prepends dimensions for translation in x and y and a rotation aro...
Implementation of the slice class CSpaceBase.
Eigen::Matrix4f globalPoseBuffer
std::vector< armarx::DebugDrawerLineSet > getTraceVisu(const Path &p, const std::vector< std::string > &nodeNames, float traceStepSize=std::numeric_limits< float >::infinity())
ConvexHull< Point >::type convexHull(const std::vector< Point > &points)
Eigen::Matrix4f globalPoseBuffer
std::vector< VirtualRobot::SceneObjectSetPtr > collisionSets
The collision stes.
void setPoseBounds(const Vector3fRange &newBounds)
VirtualRobot::CDManager & getCD()
void initStationaryObjects()
Initializes stationary objects for collision checking.
virtual void addObjectsFromWorkingMemory(memoryx::WorkingMemoryInterfacePrx workingMemoryPrx, const std::vector< std::string > &excludedInstancesIds=std::vector< std::string >())
Adds all objects except the ones with ids specified in the parameter excludedInstancesIds from the wo...
virtual Saba::CSpaceSampledPtr createSimoxCSpace() const
float getStationaryObjectMargin() const
FloatRangeSeq getDimensionsBounds(const Ice::Current &=Ice::emptyCurrent) const override
memoryx::GridFileManagerPtr fileManager
The file manager used to load objects.
FloatRangeSeq getDimensionsBounds(const Ice::Current &=Ice::emptyCurrent) const override
std::vector< std::vector< Eigen::Vector3f > > stationaryPlanes
void Identity(MatrixXX< N, N, T > *a)
GlobalCache< RobotPoolPtr, std::pair< VirtualRobot::RobotIO::RobotDescription, std::string > > robotCache
CSpaceBasePtr clone(const Ice::Current &=Ice::emptyCurrent) override
Ice::Long getDimensionality(const Ice::Current &=Ice::emptyCurrent) const override
const VirtualRobot::SceneObjectSetPtr & getStationaryObjectSet() const
virtual Ice::StringSeq getAgentJointNames() const
void ice_postUnmarshal() override
Initializes basic structures after transmission through ice.
const AgentPlanningInformation & getAgent() const
virtual void addPlanarObject(const std::vector< Eigen::Vector3f > &convexHull)
const std::vector< VirtualRobot::RobotNodePtr > & getAgentJoints() const
void setAgent(const AgentPlanningInformation &agentInfo, const Ice::Current &=Ice::emptyCurrent) override
Adds a stationary agent to the cspace.
static SimoxCSpacePtr PrefetchWorkingMemoryObjects(memoryx::WorkingMemoryInterfacePrx workingMemoryPrx, memoryx::CommonStorageInterfacePrx commonStoragePrx, RobotStateComponentInterfacePrx rsc)
Load objects from WorkingMemory and puts them into the mesh cache.
void addStationaryObject(const StationaryObject &obj, const Ice::Current &=Ice::emptyCurrent) override
Adds a stationary object to the cspace.
VirtualRobot::ManipulationObjectPtr getMovedSimoxManipulatorObject(const memoryx::ObjectClassBasePtr &object, const armarx::PoseBasePtr &pose, memoryx::GridFileManagerPtr &fileManager) const
void initCollisionTest(const Ice::Current &=Ice::emptyCurrent) override
Initializes the collision test.
Ice::StringSeq getAgentJointNames() const override
SimoxCSpaceWith2DPose()=default
Ice::StringSeq getAgentJointNames() const override
void setPoseBounds(const Vector6fRange &newBounds)
Contains information about an agent.
GlobalCache< VirtualRobot::ManipulationObjectPtr, std::pair< int, std::string > > meshCache
virtual void setConfig(const float *&&it)
MatrixXX< 4, 4, float > Matrix4f
CSpaceBasePtr clone(bool loadVisualizationModel) override
VectorXf jointMapToVector(const std::map< std::string, float > &jointMap, bool checkForNonexistenJointsInCspace=false) const
std::shared_ptr< GridFileManager > GridFileManagerPtr
VirtualRobot::SceneObjectSetPtr stationaryObjectSet
The scene objects for stationary objects.
CSpaceBasePtr clone(bool loadVisualizationModel) override
Similar to armarx::SimoxCSpace, but prepends dimensions for translation in x, y and z and rotations a...
virtual void setStationaryObjects(const StationaryObjectList &objList)
bool loadVisualizationModel
Whether the visualization model of objects/agents sould be loaded.
VirtualRobot::CDManager cd
The collision checker.
VirtualRobot::RobotPtr agentSceneObj
std::filesystem::path Path
void initAgent(VirtualRobot::RobotPtr robotPtr)
virtual void setConfig(const std::vector< float > cfg)
Sets a configuration to check for.
The SimoxCSpace contains a set of stationary obstacles and an agent.
bool isCollisionFree(const ::std::pair< const Ice::Float *, const Ice::Float * > &cfg, const Ice::Current &=Ice::emptyCurrent) override
SimoxCSpace()=default
Default ctor.
VirtualRobot::ManipulationObjectPtr getSimoxManipulatorObject(const memoryx::ObjectClassBasePtr &object, const memoryx::GridFileManagerPtr &fileManager, bool inflate=true, VirtualRobot::CollisionCheckerPtr const &colChecker=VirtualRobot::CollisionCheckerPtr {}) const
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::vector< VirtualRobot::RobotNodePtr > agentJoints
Ice::Long getDimensionality(const Ice::Current &=Ice::emptyCurrent) const override
const StationaryObjectList & getStationaryObjects() const
std::shared_ptr< class Robot > RobotPtr
Ice::Long getDimensionality(const Ice::Current &=Ice::emptyCurrent) const override