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
4595ad1f
Commit
4595ad1f
authored
Apr 24, 2019
by
Pierre Fernbach
Browse files
[kinodynamic] replace test (float==0) with an epsilon
parent
5c58d1f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/kinodynamic-distance.cc
View file @
4595ad1f
...
...
@@ -126,7 +126,7 @@ double KinodynamicDistance::computeMinTime(double p1, double p2, double v1, doub
double
a2
=
-
a1
;
double
vLim
=
(
sigma
)
*
vMax_
;
//hppDout(info,"Vlim = "<<vLim<<" ; aMax = "<<aMax_);
if
((
p2
-
p1
)
==
0.
&&
(
v2
-
v1
)
==
0.
){
if
(
fabs
(
p2
-
p1
)
<
(
std
::
numeric_limits
<
double
>::
epsilon
()
*
10
0.
)
&&
fabs
(
v2
-
v1
)
<
(
std
::
numeric_limits
<
double
>::
epsilon
()
*
10
0.
)
){
//hppDout(notice,"No movement in this joints, abort.");
return
0.
;
}
...
...
src/steering-method/steering-kinodynamic.cc
View file @
4595ad1f
...
...
@@ -219,7 +219,7 @@ namespace hpp {
double
a2
=
-
a1
;
double
vLim
=
(
sigma
)
*
vMax
;
hppDout
(
info
,
"Vlim = "
<<
vLim
<<
" ; aMax = "
<<
aMax
);
if
((
p2
-
p1
)
==
0.
&&
(
v2
-
v1
)
==
0.
){
if
(
fabs
(
p2
-
p1
)
<
(
std
::
numeric_limits
<
double
>::
epsilon
()
*
10
0.
)
&&
fabs
(
v2
-
v1
)
<
(
std
::
numeric_limits
<
double
>::
epsilon
()
*
10
0.
)
){
hppDout
(
notice
,
"No movement in this joints, abort."
);
return
0.
;
}
...
...
@@ -361,7 +361,7 @@ namespace hpp {
hppDout
(
info
,
"sigma Bis= "
<<
sigma
);
}
if
(
v2_1
==
0
&&
p2_1
==
0
){
if
(
fabs
(
v2_1
)
<
(
std
::
numeric_limits
<
double
>::
epsilon
()
*
100.
)
&&
fabs
(
p2_1
)
<
(
std
::
numeric_limits
<
double
>::
epsilon
()
*
100.
)
){
*
a1
=
0
;
*
t0
=
0
;
*
t1
=
0
;
...
...
@@ -468,7 +468,7 @@ namespace hpp {
x2
=
c
/
q
;
else
{
x2
=
sigma
*
aMax_
[
index
];
hppDout
(
notice
,
"q == 0, take x
1
= aMax"
);
hppDout
(
notice
,
"q == 0, take x
2
= aMax"
);
}
hppDout
(
notice
,
"epsilon = "
<<
std
::
numeric_limits
<
double
>::
epsilon
()
*
100.
);
...
...
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