1 #ifndef HRICS_PLANNER_H
2 #define HRICS_PLANNER_H
13 #include "API/planningAPI.hpp"
14 #include "planner/planner.hpp"
15 #include "planner/Diffusion/RRT.hpp"
17 #include "HRICS_Distance.hpp"
18 #include "HRICS_Visibility.hpp"
19 #include "HRICS_Natural.hpp"
20 #include "Grid/HRICS_Grid.hpp"
21 #include "Grid/HRICS_GridState.hpp"
22 #include "Grid/HRICS_AgentGrid.hpp"
44 m_VisibilitySpace(NULL),
45 m_ReachableSpace(NULL),
46 m_NaturalSpace(NULL) { }
51 m_VisibilitySpace(NULL),
52 m_ReachableSpace(NULL),
53 m_NaturalSpace(NULL) { }
58 delete m_VisibilitySpace;
62 Visibility* getVisibility() {
return m_VisibilitySpace; }
63 Natural* getNaturality() {
return m_NaturalSpace; }
64 Natural* getReachability() {
return m_ReachableSpace; }
78 if( m_VisibilitySpace )
80 delete m_VisibilitySpace;
82 m_VisibilitySpace = visib;
89 delete m_NaturalSpace;
94 void setReachability(
Natural* nat)
96 if( m_ReachableSpace )
98 delete m_ReachableSpace;
100 m_ReachableSpace = nat;
103 unsigned int run() {
return 0; }
138 void initAgentGrids(
double cellsize);
139 void deleteAgentGrids();
140 std::vector<AgentGrid*> getAgentGrids() {
return m_HumanGrids; }
143 void initVisibility();
144 void initReachable();
146 void initOtpPlanner();
148 void setAgents( HRI_AGENTS* agents ) { m_Agents = agents; }
155 std::vector<Robot*> getHumans(){
return mHumans; }
157 Eigen::Vector3d getVisball();
176 std::vector<Eigen::Vector3d> get3DPath() {
return m3DPath; }
177 std::vector<API::ThreeDCell*> getCellPath() {
return m3DCellPath; }
178 int getIndexObjectDof()
180 if(mIndexObjectDof==0)
182 std::cout <<
"Workspace::Warning::mIndexObjectDof == 0" << std::endl;
184 return mIndexObjectDof;
197 void activateOnlyBaseCollision();
202 bool sampleRobotBase(std::tr1::shared_ptr<Configuration> q_base,
const Eigen::Vector3d& WSPoint);
207 bool transPFromBaseConf(std::tr1::shared_ptr<Configuration> q_base, std::vector< Eigen::Vector3d > points );
208 bool baseInSight(std::tr1::shared_ptr<Configuration> q_base);
223 bool testCol(std::tr1::shared_ptr<Configuration> q_base);
299 std::vector<Robot*> mHumans;
306 Eigen::Vector3d m_OTP;
310 std::vector<AgentGrid*> m_HumanGrids;
313 HRI_AGENTS* m_Agents;
318 std::vector<Eigen::Vector3d> m3DPath;
319 std::vector<API::ThreeDCell*> m3DCellPath;
void initPR2GiveConf()
set PR2 to Give configuration
Definition: HRICS_Workspace.cpp:1605
Robot * _Robot
Le Robot pour lequel la recherche va se faire.
Definition: planner.hpp:174
bool chooseBestTransferPoint(Eigen::Vector3d &transfPoint, bool move, unsigned int threshold)
Choses a good transfer point.
Definition: HRICS_Workspace.cpp:1085
void deactivateOnlyBaseCollision()
Choose best transfer point from the natural costspace associated to the human.
Definition: HRICS_Workspace.cpp:609
bool initHriRRT()
Run RRT.
Definition: HRICS_Workspace.cpp:562
Planner()
Plain Constructor of the class.
Definition: planner.cpp:27
bool sampleRobotBase(std::tr1::shared_ptr< Configuration > q_base, const Eigen::Vector3d &WSPoint)
Test if Jido (Base?) is in collision in this configuration.
Definition: HRICS_Workspace.cpp:711
void initPR2AndHumanTest()
set PR2 and Human to testing position
Definition: HRICS_Workspace.cpp:1654
Definition: HRICS_Grid.hpp:16
void initPR2RepoConf()
set Repo Pose of PR2
Definition: HRICS_Workspace.cpp:1543
bool transPFromBaseConf(std::tr1::shared_ptr< Configuration > q_base, std::vector< Eigen::Vector3d > points)
Test if Jido is in collision in this configuration (?)
Definition: HRICS_Workspace.cpp:620
double distanceToEntirePath()
Distance to 3D path.
Definition: HRICS_Workspace.cpp:481
void drawCurrentOTP()
Draws the current OTP.
Definition: HRICS_Workspace.cpp:842
Distance * m_DistanceSpace
Distance and Visibility cost spaces.
Definition: HRICS_Workspace.hpp:110
void setCurrentOTP(const Eigen::Vector3d &p)
Set the OTP from given point.
Definition: HRICS_Workspace.hpp:213
Workspace()
Constructors & Destructors.
Definition: HRICS_Workspace.cpp:54
Definition: HRICS_GridState.hpp:14
bool computeBestFeasableTransferPoint(Eigen::Vector3d &transfPoint)
Compute a transfert point from a loaded grid, taking into acount a possible colision.
Definition: HRICS_Workspace.cpp:1392
Natural Motion and Arm Confort.
Definition: HRICS_Natural.hpp:33
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
bool testCol(std::tr1::shared_ptr< Configuration > q_base)
testColision for the given configuration
Definition: HRICS_Workspace.cpp:662
double * testTransferPointToTrajectory(const Eigen::Vector3d &WSPoint, API::Trajectory &traj, unsigned int &id)
Test straight lines between target point and the point of the trajectory.
Definition: HRICS_Workspace.cpp:872
unsigned int run()
Run function.
Definition: HRICS_Workspace.hpp:103
double distanceToCellPath()
Computes a distance to the Cells in the 3D Path Coarse grain compared to the above distance...
Definition: HRICS_Workspace.cpp:534
void ChangeRobotPos(double value)
change Robot position to test PR2
Definition: HRICS_Workspace.cpp:1803
Definition: trajectory.hpp:40
Definition: HRICS_Visibility.hpp:18
Workspace Motion Planners.
Definition: HRICS_Workspace.hpp:120
Definition: HRICS_Distance.hpp:20
Base class for planning algorithms.
Definition: planner.hpp:28
void computePR2GIK(bool move)
Compute the position of the Robot Arm considering the current configuration.
Definition: HRICS_Workspace.cpp:1709
Grid * getGrid()
Getters.
Definition: HRICS_Workspace.hpp:175
bool computeBestTransferPoint(Eigen::Vector3d &transfPoint)
Compute a transfert point from a loaded grid, without taking into acount a possible colision...
Definition: HRICS_Workspace.cpp:1334
void draw3dPath()
Draws the 3D path as a yellow line.
Definition: HRICS_Workspace.cpp:462
bool computeAStarIn3DGrid()
Computes A* in Grid.
Definition: HRICS_Workspace.cpp:281
Eigen::Vector3d computeOTPFromHandPose(bool rightHand)
compute an object transfert point.
Definition: HRICS_Workspace.cpp:1521
Eigen::Vector3d getCurrentOTP()
Return the OTP.
Definition: HRICS_Workspace.hpp:218
Robot * getHuman()
Get Robot and Human.
Definition: HRICS_Workspace.hpp:154
Base class for the HRICS motion planners.
Definition: HRICS_Workspace.hpp:37
void initGrid()
Init Associated Objects.
Definition: HRICS_Workspace.cpp:156
bool ComputeTheObjectTransfertPoint(bool Move, int type, Eigen::Vector3d &transfPoint, int threshold)
compute an object transfert point.
Definition: HRICS_Workspace.cpp:1456