Line |
Branch |
Exec |
Source |
1 |
|
|
// Copyright (c) 2014 CNRS |
2 |
|
|
// Author: Florent Lamiraux |
3 |
|
|
// |
4 |
|
|
|
5 |
|
|
// Redistribution and use in source and binary forms, with or without |
6 |
|
|
// modification, are permitted provided that the following conditions are |
7 |
|
|
// met: |
8 |
|
|
// |
9 |
|
|
// 1. Redistributions of source code must retain the above copyright |
10 |
|
|
// notice, this list of conditions and the following disclaimer. |
11 |
|
|
// |
12 |
|
|
// 2. Redistributions in binary form must reproduce the above copyright |
13 |
|
|
// notice, this list of conditions and the following disclaimer in the |
14 |
|
|
// documentation and/or other materials provided with the distribution. |
15 |
|
|
// |
16 |
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
17 |
|
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
18 |
|
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
19 |
|
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
20 |
|
|
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
21 |
|
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
22 |
|
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 |
|
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 |
|
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 |
|
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 |
|
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
27 |
|
|
// DAMAGE. |
28 |
|
|
|
29 |
|
|
#ifndef HPP_MANIPULATION_CORBA_PROBLEM_IMPL_HH |
30 |
|
|
#define HPP_MANIPULATION_CORBA_PROBLEM_IMPL_HH |
31 |
|
|
|
32 |
|
|
#include <hpp/corbaserver/manipulation/fwd.hh> |
33 |
|
|
#include <hpp/manipulation/problem-solver.hh> |
34 |
|
|
|
35 |
|
|
#include "hpp/corbaserver/manipulation/problem-idl.hh" |
36 |
|
|
#include "hpp/manipulation_idl/_graph-idl.hh" |
37 |
|
|
#include "hpp/manipulation_idl/_path_planners-idl.hh" |
38 |
|
|
|
39 |
|
|
namespace hpp { |
40 |
|
|
namespace manipulation { |
41 |
|
|
namespace impl { |
42 |
|
|
using CORBA::Double; |
43 |
|
|
using CORBA::Short; |
44 |
|
|
using CORBA::String_out; |
45 |
|
|
using CORBA::ULong; |
46 |
|
|
using CORBA::UShort; |
47 |
|
|
|
48 |
|
|
class Problem : public virtual POA_hpp::corbaserver::manipulation::Problem { |
49 |
|
|
public: |
50 |
|
|
Problem(); |
51 |
|
✗ |
void setServer(Server* server) { server_ = server; } |
52 |
|
|
|
53 |
|
|
virtual bool selectProblem(const char* name); |
54 |
|
|
|
55 |
|
|
virtual void resetProblem(); |
56 |
|
|
|
57 |
|
|
virtual Names_t* getAvailable(const char* what); |
58 |
|
|
|
59 |
|
|
virtual Names_t* getSelected(const char* what); |
60 |
|
|
|
61 |
|
|
virtual void loadRoadmap(const char* filename); |
62 |
|
|
|
63 |
|
|
virtual void createGrasp(const char* graspName, const char* gripperName, |
64 |
|
|
const char* handleName); |
65 |
|
|
|
66 |
|
|
virtual void createPreGrasp(const char* graspName, const char* gripperName, |
67 |
|
|
const char* handleName); |
68 |
|
|
|
69 |
|
|
virtual Names_t* getEnvironmentContactNames(); |
70 |
|
|
|
71 |
|
|
virtual Names_t* getRobotContactNames(); |
72 |
|
|
|
73 |
|
|
virtual Names_t* getEnvironmentContact(const char* name, intSeq_out indexes, |
74 |
|
|
floatSeqSeq_out points); |
75 |
|
|
|
76 |
|
|
virtual Names_t* getRobotContact(const char* name, intSeq_out indexes, |
77 |
|
|
floatSeqSeq_out points); |
78 |
|
|
|
79 |
|
|
virtual void createPlacementConstraint(const char* placName, |
80 |
|
|
const Names_t& shapeName, |
81 |
|
|
const Names_t& envContactName); |
82 |
|
|
|
83 |
|
|
virtual void createPrePlacementConstraint(const char* placName, |
84 |
|
|
const Names_t& shapeName, |
85 |
|
|
const Names_t& envContactName, |
86 |
|
|
CORBA::Double width); |
87 |
|
|
|
88 |
|
|
virtual void createQPStabilityConstraint(const char* constraintName, |
89 |
|
|
const char* comRootJointName, |
90 |
|
|
const Names_t& shapesName); |
91 |
|
|
|
92 |
|
|
virtual bool setConstraints(hpp::ID id, bool target); |
93 |
|
|
|
94 |
|
|
virtual void registerConstraints(const char* constraint, |
95 |
|
|
const char* complement, const char* both); |
96 |
|
|
|
97 |
|
|
virtual bool applyConstraints(hpp::ID id, const hpp::floatSeq& input, |
98 |
|
|
hpp::floatSeq_out output, |
99 |
|
|
double& residualError); |
100 |
|
|
|
101 |
|
|
virtual bool applyConstraintsWithOffset(hpp::ID IDedge, |
102 |
|
|
const hpp::floatSeq& qnear, |
103 |
|
|
const hpp::floatSeq& input, |
104 |
|
|
hpp::floatSeq_out output, |
105 |
|
|
double& residualError); |
106 |
|
|
|
107 |
|
|
virtual bool buildAndProjectPath(hpp::ID IDedge, const hpp::floatSeq& qb, |
108 |
|
|
const hpp::floatSeq& qe, |
109 |
|
|
CORBA::Long& indexNotProj, |
110 |
|
|
CORBA::Long& indexProj); |
111 |
|
|
|
112 |
|
|
virtual void setTargetState(hpp::ID IDstate); |
113 |
|
|
|
114 |
|
|
virtual ID edgeAtParam(ULong pathId, Double param, String_out name); |
115 |
|
|
|
116 |
|
|
hpp::manipulation_idl::graph_idl::Validation_ptr createGraphValidation(); |
117 |
|
|
|
118 |
|
|
core_idl::Roadmap_ptr readRoadmap( |
119 |
|
|
const char* filename, pinocchio_idl::Device_ptr robot, |
120 |
|
|
manipulation_idl::graph_idl::Graph_ptr graph); |
121 |
|
|
void writeRoadmap(const char* filename, core_idl::Roadmap_ptr roadmap, |
122 |
|
|
pinocchio_idl::Device_ptr robot, |
123 |
|
|
manipulation_idl::graph_idl::Graph_ptr graph); |
124 |
|
|
|
125 |
|
|
core_idl::Roadmap_ptr createRoadmap(core_idl::Distance_ptr distance, |
126 |
|
|
pinocchio_idl::Device_ptr robot); |
127 |
|
|
virtual hpp::core_idl::PathPlanner_ptr createTransitionPlanner(); |
128 |
|
|
|
129 |
|
|
private: |
130 |
|
|
ProblemSolverPtr_t problemSolver(); |
131 |
|
|
graph::GraphPtr_t graph(bool throwIfNull = true); |
132 |
|
|
Server* server_; |
133 |
|
|
}; // class Problem |
134 |
|
|
} // namespace impl |
135 |
|
|
} // namespace manipulation |
136 |
|
|
} // namespace hpp |
137 |
|
|
|
138 |
|
|
#endif // HPP_MANIPULATION_CORBA_PROBLEM_IMPL_HH |
139 |
|
|
|