Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Humanoid Path Planner
hpp-core
Commits
4489b432
Commit
4489b432
authored
Jan 07, 2021
by
Florent Lamiraux
Browse files
[Problem] Add copy constructor.
parent
3dbd8b46
Pipeline
#12798
failed with stage
in 2 minutes and 12 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/hpp/core/problem.hh
View file @
4489b432
...
...
@@ -52,6 +52,10 @@ namespace hpp {
/// \param robot robot associated to the path planning problem.
static
ProblemPtr_t
create
(
DevicePtr_t
robot
);
/// Copy a path planning problem and return a shared pointer.
/// \param other problem to copy
static
ProblemPtr_t
createCopy
(
const
ProblemConstPtr_t
&
other
);
/// Constructor without argument
/// \warning do not use this constructor. It is necessary to define
/// std::pairs <Problem, OtherType>.
...
...
@@ -296,6 +300,8 @@ namespace hpp {
protected:
/// \copydoc Problem::create(DevicePtr_t);
Problem
(
DevicePtr_t
robot
);
/// \copydoc Problem::create(DevicePtr_t);
Problem
(
const
Problem
&
other
);
void
init
(
ProblemWkPtr_t
wkPtr
);
...
...
src/problem.cc
View file @
4489b432
...
...
@@ -78,12 +78,34 @@ namespace hpp {
return
p
;
}
ProblemPtr_t
Problem
::
createCopy
(
const
ProblemConstPtr_t
&
other
)
{
ProblemPtr_t
p
(
new
Problem
(
*
other
));
p
->
init
(
p
);
return
p
;
}
// ======================================================================
Problem
::
Problem
(
DevicePtr_t
robot
)
:
robot_
(
robot
),
configValidations_
(
ConfigValidations
::
create
())
{
}
// ======================================================================
Problem
::
Problem
(
const
Problem
&
other
)
:
robot_
(
other
.
robot_
),
distance_
(
other
.
distance_
),
initConf_
(
other
.
initConf_
),
goalConfigurations_
(
other
.
goalConfigurations_
),
target_
(
other
.
target_
),
steeringMethod_
(
other
.
steeringMethod_
),
configValidations_
(
other
.
configValidations
()),
pathValidation_
(
other
.
pathValidation_
),
pathProjector_
(
other
.
pathProjector_
),
collisionObstacles_
(
other
.
collisionObstacles_
),
constraints_
(
other
.
constraints_
),
configurationShooter_
(
other
.
configurationShooter_
)
{
}
// ======================================================================
void
Problem
::
init
(
ProblemWkPtr_t
wkPtr
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment