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
814137ce
Commit
814137ce
authored
Jan 19, 2021
by
Joseph Mirabel
Browse files
[CarLike] Add accessors to turning radius
parent
d75996f4
Changes
4
Hide whitespace changes
Inline
Side-by-side
include/hpp/core/distance/reeds-shepp.hh
View file @
814137ce
...
...
@@ -43,6 +43,11 @@ namespace hpp {
std
::
vector
<
JointPtr_t
>
wheels
);
static
ReedsSheppPtr_t
createCopy
(
const
ReedsSheppPtr_t
&
distance
);
void
turningRadius
(
const
value_type
&
rho
);
inline
value_type
turningRadius
()
const
{
return
rho_
;
}
protected:
ReedsShepp
(
const
ProblemConstPtr_t
&
problem
);
ReedsShepp
(
const
ProblemConstPtr_t
&
problem
,
...
...
@@ -58,6 +63,7 @@ namespace hpp {
private:
WeighedDistancePtr_t
weighedDistance_
;
DeviceWkPtr_t
device_
;
/// Turning radius
value_type
rho_
;
JointPtr_t
xy_
,
rz_
;
size_type
xyId_
,
rzId_
;
...
...
include/hpp/core/steering-method/car-like.hh
View file @
814137ce
...
...
@@ -48,6 +48,10 @@ namespace hpp {
wheels_
=
wheels
;
}
void
turningRadius
(
const
value_type
&
rho
);
inline
value_type
turningRadius
()
const
{
return
rho_
;
}
protected:
/// Constructor
CarLike
(
const
ProblemConstPtr_t
&
problem
);
...
...
@@ -69,6 +73,7 @@ namespace hpp {
}
DeviceWkPtr_t
device_
;
/// Turning radius
value_type
rho_
;
JointPtr_t
xy_
,
rz_
;
size_type
xyId_
,
rzId_
;
...
...
src/distance/reeds-shepp.cc
View file @
814137ce
...
...
@@ -72,8 +72,8 @@ namespace hpp {
xy_
=
d
->
getJointAtConfigRank
(
xyId_
);
rz_
=
d
->
getJointAtConfigRank
(
rzId_
);
wheels_
=
steeringMethod
::
getWheelsFromeParameter
(
problem
,
rz_
);
rho_
=
problem
->
getParameter
(
"SteeringMethod/Carlike/turningRadius"
).
floatValue
();
turningRadius
(
problem
->
getParameter
(
"SteeringMethod/Carlike/turningRadius"
).
floatValue
()
)
;
}
ReedsShepp
::
ReedsShepp
(
const
ProblemConstPtr_t
&
problem
,
...
...
@@ -102,6 +102,13 @@ namespace hpp {
{
}
void
ReedsShepp
::
turningRadius
(
const
value_type
&
rho
)
{
if
(
rho
<=
0
)
throw
std
::
invalid_argument
(
"Turning radius must be strictly positive."
);
rho_
=
rho
;
}
value_type
ReedsShepp
::
impl_distance
(
ConfigurationIn_t
q1
,
ConfigurationIn_t
q2
)
const
{
...
...
src/steering-method/car-like.cc
View file @
814137ce
...
...
@@ -38,8 +38,8 @@ namespace hpp {
xy_
=
d
->
getJointAtConfigRank
(
0
);
rz_
=
d
->
getJointAtConfigRank
(
2
);
wheels_
=
getWheelsFromeParameter
(
problem
,
rz_
);
rho_
=
problem
->
getParameter
(
"SteeringMethod/Carlike/turningRadius"
).
floatValue
();
turningRadius
(
problem
->
getParameter
(
"SteeringMethod/Carlike/turningRadius"
).
floatValue
()
)
;
}
CarLike
::
CarLike
(
const
ProblemConstPtr_t
&
problem
,
...
...
@@ -65,6 +65,13 @@ namespace hpp {
{
}
void
CarLike
::
turningRadius
(
const
value_type
&
rho
)
{
if
(
rho
<=
0
)
throw
std
::
invalid_argument
(
"Turning radius must be strictly positive."
);
rho_
=
rho
;
}
std
::
vector
<
JointPtr_t
>
getWheelsFromeParameter
(
const
ProblemConstPtr_t
&
problem
,
const
JointPtr_t
&
rz
)
{
...
...
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