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
c1f50e00
Unverified
Commit
c1f50e00
authored
Jun 27, 2019
by
Joseph Mirabel
Committed by
GitHub
Jun 27, 2019
Browse files
Merge pull request #175 from florent-lamiraux/devel
[ReedsSheppPath] Fix bug when curvature is different from 1.
parents
f367db05
bb3bab03
Changes
3
Hide whitespace changes
Inline
Side-by-side
NEWS
View file @
c1f50e00
-*- outline -*-
* Fix bug in Reeds and Shepp paths when curvature is not equal to 1.
New in 4.6.0
* Keep frames of obstacles.
* Add Gaussian configuration shooter
...
...
include/hpp/core/reeds-shepp-path.hh
View file @
c1f50e00
...
...
@@ -188,8 +188,12 @@ namespace hpp {
size_type
dxyId_
,
drzId_
;
std
::
size_t
typeId_
;
Lengths_t
lengths_
;
value_type
currentLength_
;
// Distance traveled by the center of the rear wheel axis
value_type
rsLength_
;
// Extra length to take into account the motion of other joints:
// Length of path = rsLength_ + extraLength_
value_type
extraLength_
;
// Minimal radius of curvature
value_type
rho_
;
ReedsSheppPathWkPtr_t
weak_
;
};
// class ReedsSheppPath
...
...
src/reeds-shepp-path.cc
View file @
c1f50e00
...
...
@@ -148,12 +148,12 @@ namespace hpp {
typeId_
=
typeId
;
lengths_
(
0
)
=
t
;
lengths_
(
1
)
=
u
;
lengths_
(
2
)
=
v
;
lengths_
(
3
)
=
w
;
lengths_
(
4
)
=
x
;
current
Length_
=
rho_
*
lengths_
.
lpNorm
<
1
>
();
rs
Length_
=
rho_
*
lengths_
.
lpNorm
<
1
>
();
}
void
ReedsSheppPath
::
CSC
(
const
vector2_t
&
xy
,
const
vector2_t
&
csPhi
,
const
value_type
&
phi
)
{
value_type
t
,
u
,
v
,
Lmin
=
current
Length_
,
L
;
value_type
t
,
u
,
v
,
Lmin
=
rs
Length_
,
L
;
if
(
LpSpLp
(
xy
,
csPhi
,
phi
,
t
,
u
,
v
)
&&
Lmin
>
(
L
=
fabs
(
t
)
+
fabs
(
u
)
+
fabs
(
v
)))
{
setupPath
(
14
,
t
,
u
,
v
);
...
...
@@ -211,7 +211,7 @@ namespace hpp {
}
void
ReedsSheppPath
::
CCC
(
const
vector2_t
&
xy
,
const
vector2_t
&
csPhi
,
const
value_type
&
phi
)
{
value_type
t
,
u
,
v
,
Lmin
=
current
Length_
,
L
;
value_type
t
,
u
,
v
,
Lmin
=
rs
Length_
,
L
;
if
(
LpRmL
(
xy
,
csPhi
,
phi
,
t
,
u
,
v
)
&&
Lmin
>
(
L
=
fabs
(
t
)
+
fabs
(
u
)
+
fabs
(
v
)))
{
setupPath
(
0
,
t
,
u
,
v
);
...
...
@@ -290,7 +290,7 @@ namespace hpp {
}
void
ReedsSheppPath
::
CCCC
(
const
vector2_t
&
xy
,
const
vector2_t
&
csPhi
,
const
value_type
&
phi
)
{
value_type
t
,
u
,
v
,
Lmin
=
current
Length_
,
L
;
value_type
t
,
u
,
v
,
Lmin
=
rs
Length_
,
L
;
if
(
LpRupLumRm
(
xy
,
csPhi
,
phi
,
t
,
u
,
v
)
&&
Lmin
>
(
L
=
fabs
(
t
)
+
2.
*
fabs
(
u
)
+
fabs
(
v
)))
{
setupPath
(
2
,
t
,
u
,
-
u
,
v
);
...
...
@@ -367,7 +367,7 @@ namespace hpp {
}
void
ReedsSheppPath
::
CCSC
(
const
vector2_t
&
xy
,
const
vector2_t
&
csPhi
,
const
value_type
&
phi
)
{
value_type
t
,
u
,
v
,
Lmin
=
current
Length_
-
.5
*
pi
,
L
;
value_type
t
,
u
,
v
,
Lmin
=
rs
Length_
-
.5
*
pi
,
L
;
if
(
LpRmSmLm
(
xy
,
csPhi
,
phi
,
t
,
u
,
v
)
&&
Lmin
>
(
L
=
fabs
(
t
)
+
fabs
(
u
)
+
fabs
(
v
)))
{
setupPath
(
4
,
t
,
-
.5
*
pi
,
u
,
v
);
...
...
@@ -477,7 +477,7 @@ namespace hpp {
}
void
ReedsSheppPath
::
CCSCC
(
const
vector2_t
&
xy
,
const
vector2_t
&
csPhi
,
const
value_type
&
phi
)
{
value_type
t
,
u
,
v
,
Lmin
=
current
Length_
-
pi
,
L
;
value_type
t
,
u
,
v
,
Lmin
=
rs
Length_
-
pi
,
L
;
if
(
LpRmSLmRp
(
xy
,
csPhi
,
phi
,
t
,
u
,
v
)
&&
Lmin
>
(
L
=
fabs
(
t
)
+
fabs
(
u
)
+
fabs
(
v
)))
{
setupPath
(
16
,
t
,
-
.5
*
pi
,
u
,
-
.5
*
pi
,
v
);
...
...
@@ -560,7 +560,7 @@ namespace hpp {
parent_t
(
device
->
configSize
(),
device
->
numberDof
()),
device_
(
device
),
initial_
(
init
),
end_
(
end
),
xyId_
(
xyId
),
rzId_
(
rzId
),
typeId_
(
0
),
lengths_
(),
current
Length_
(
std
::
numeric_limits
<
value_type
>::
infinity
()),
rs
Length_
(
std
::
numeric_limits
<
value_type
>::
infinity
()),
extraLength_
(
extraLength
),
rho_
(
rho
)
{
assert
(
device
);
...
...
@@ -580,7 +580,7 @@ namespace hpp {
parent_t
(
device
->
configSize
(),
device
->
numberDof
()),
device_
(
device
),
initial_
(
init
),
end_
(
end
),
xyId_
(
xyId
),
rzId_
(
rzId
),
typeId_
(
0
),
current
Length_
(
std
::
numeric_limits
<
value_type
>::
infinity
()),
rs
Length_
(
std
::
numeric_limits
<
value_type
>::
infinity
()),
extraLength_
(
extraLength
),
rho_
(
rho
)
{
assert
(
device
);
...
...
@@ -588,7 +588,7 @@ namespace hpp {
lengths_
.
setZero
();
buildReedsShepp
(
device
->
getJointAtConfigRank
(
rzId
),
wheels
);
this
->
constraints
(
constraints
);
assert
(
fabs
(
extraLength_
+
current
Length_
-
paramRange
().
second
)
<
1e-8
);
assert
(
fabs
(
extraLength_
+
rs
Length_
-
paramRange
().
second
)
<
1e-8
);
}
ReedsSheppPath
::
ReedsSheppPath
(
const
ReedsSheppPath
&
path
)
:
...
...
@@ -596,7 +596,7 @@ namespace hpp {
end_
(
path
.
end_
),
xyId_
(
path
.
xyId_
),
rzId_
(
path
.
rzId_
),
dxyId_
(
path
.
dxyId_
),
drzId_
(
path
.
drzId_
),
typeId_
(
path
.
typeId_
),
lengths_
(
path
.
lengths_
),
current
Length_
(
path
.
current
Length_
),
rs
Length_
(
path
.
rs
Length_
),
extraLength_
(
path
.
extraLength_
),
rho_
(
path
.
rho_
)
{
}
...
...
@@ -654,7 +654,7 @@ namespace hpp {
xyId_
,
rzId_
,
rz
,
wheels
,
ConstraintSetPtr_t
()));
appendPath
(
segment
);
current
Length_
=
0
;
rs
Length_
=
0
;
return
;
}
CSC
(
xy
,
csPhi
,
phi
);
...
...
@@ -663,11 +663,11 @@ namespace hpp {
CCSC
(
xy
,
csPhi
,
phi
);
CCSCC
(
xy
,
csPhi
,
phi
);
// build path vector
value_type
L
(
current
Length_
),
l
(
0.
);
value_type
L
(
rs
Length_
),
s
(
0.
);
for
(
unsigned
int
i
=
0
;
i
<
5
;
++
i
)
{
if
(
fabs
(
lengths_
[
i
])
>
precision
)
{
value_type
extra_l
=
fabs
(
lengths_
[
i
]);
l
+=
extra_
l
;
value_type
l
=
rho_
*
fabs
(
lengths_
[
i
]);
s
+=
l
;
if
(
types
[
typeId_
][
i
]
==
RS_NOP
)
break
;
value_type
curvature
;
switch
(
types
[
typeId_
][
i
])
{
...
...
@@ -684,12 +684,11 @@ namespace hpp {
default:
abort
();
}
pinocchio
::
interpolate
(
device_
,
initial_
,
end_
,
l
/
L
,
qEnd
);
pinocchio
::
interpolate
(
device_
,
initial_
,
end_
,
s
/
L
,
qEnd
);
ConstantCurvaturePtr_t
segment
(
ConstantCurvature
::
create
(
device_
,
qInit
,
qEnd
,
rho_
*
lengths_
[
i
],
rho_
*
lengths_
[
i
]
+
lengths_
[
i
]
*
extraLength_
/
L
,
l
*
(
1
+
extraLength_
/
L
),
curvature
,
xyId_
,
rzId_
,
rz
,
wheels
,
ConstraintSetPtr_t
()));
appendPath
(
segment
);
...
...
Write
Preview
Supports
Markdown
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