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
8d9f088c
Commit
8d9f088c
authored
May 18, 2019
by
Joseph Mirabel
Browse files
[Refactoring] Remove usage of ConfigurationPtr_t in ConfigurationShooter
parent
c85d6fe9
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/hpp/core/configuration-shooter.hh
View file @
8d9f088c
...
...
@@ -35,7 +35,16 @@ namespace hpp {
{
public:
/// Shoot a random configuration
virtual
ConfigurationPtr_t
shoot
()
const
=
0
;
virtual
ConfigurationPtr_t
shoot
()
const
{
ConfigurationPtr_t
q
(
new
Configuration_t
);
shoot
(
*
q
);
return
q
;
}
/// Shoot a random configuration
/// \param q the configuration (resized if necessary).
virtual
void
shoot
(
Configuration_t
&
q
)
const
=
0
;
virtual
~
ConfigurationShooter
()
{};
protected:
...
...
include/hpp/core/configuration-shooter/gaussian.hh
View file @
8d9f088c
...
...
@@ -44,7 +44,7 @@ namespace hpp {
ptr
->
init
(
shPtr
);
return
shPtr
;
}
virtual
Configuration
Ptr_t
shoot
(
)
const
;
virtual
void
shoot
(
Configuration
_t
&
q
)
const
;
void
center
(
ConfigurationIn_t
c
)
{
...
...
include/hpp/core/configuration-shooter/uniform.hh
View file @
8d9f088c
...
...
@@ -42,7 +42,7 @@ namespace hpp {
ptr
->
init
(
shPtr
);
return
shPtr
;
}
virtual
Configuration
Ptr_t
shoot
(
)
const
;
virtual
void
shoot
(
Configuration
_t
&
q
)
const
;
void
sampleExtraDOF
(
bool
sampleExtraDOF
){
sampleExtraDOF_
=
sampleExtraDOF
;
...
...
src/configuration-shooter/gaussian.cc
View file @
8d9f088c
...
...
@@ -106,7 +106,7 @@ namespace hpp {
::
pinocchio
::
details
::
Dispatch
<
ComputeSigmasStep
>::
run
(
jmodel
.
derived
(),
ComputeSigmasStep
::
ArgsType
(
model
,
sigmas
));
}
ConfigurationPtr_t
Gaussian
::
shoot
(
)
const
void
Gaussian
::
shoot
(
Configuration_t
&
config
)
const
{
static
boost
::
random
::
mt19937
eng
;
vector_t
velocity
(
robot_
->
numberDof
());
...
...
@@ -116,11 +116,9 @@ namespace hpp {
velocity
[
i
]
=
distrib
(
eng
);
}
ConfigurationPtr_t
config
(
new
Configuration_t
(
robot_
->
configSize
()));
::
hpp
::
pinocchio
::
integrate
(
robot_
,
center_
,
velocity
,
*
config
);
::
hpp
::
pinocchio
::
saturate
(
robot_
,
*
config
);
return
config
;
config
.
resize
(
robot_
->
configSize
());
::
hpp
::
pinocchio
::
integrate
(
robot_
,
center_
,
velocity
,
config
);
::
hpp
::
pinocchio
::
saturate
(
robot_
,
config
);
}
void
Gaussian
::
sigma
(
const
value_type
&
factor
)
...
...
src/configuration-shooter/uniform.cc
View file @
8d9f088c
...
...
@@ -26,12 +26,12 @@ namespace hpp {
namespace
core
{
namespace
configurationShooter
{
ConfigurationPtr_t
Uniform
::
shoot
(
)
const
void
Uniform
::
shoot
(
Configuration_t
&
config
)
const
{
size_type
extraDim
=
robot_
->
extraConfigSpace
().
dimension
();
size_type
offset
=
robot_
->
configSize
()
-
extraDim
;
C
onfig
uration_t
config
(
robot_
->
configSize
());
c
onfig
.
resize
(
robot_
->
configSize
());
config
.
head
(
offset
)
=
::
pinocchio
::
randomConfiguration
(
robot_
->
model
());
if
(
sampleExtraDOF_
){
...
...
@@ -52,7 +52,6 @@ namespace hpp {
}
else
{
config
.
tail
(
extraDim
).
setZero
();
}
return
boost
::
make_shared
<
Configuration_t
>
(
config
);
}
}
// namespace configurationShooter
...
...
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