Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpp-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Humanoid Path Planner
hpp-core
Commits
610bb904
Commit
610bb904
authored
1 week ago
by
Florent Lamiraux
Browse files
Options
Downloads
Patches
Plain Diff
[Spline] Make assertions more accurate.
parent
bd3561f0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/steering-method/spline.cc
+12
-4
12 additions, 4 deletions
src/steering-method/spline.cc
with
12 additions
and
4 deletions
src/steering-method/spline.cc
+
12
−
4
View file @
610bb904
...
...
@@ -64,8 +64,12 @@ PathPtr_t Spline<_PB, _SO>::steer(ConfigurationIn_t q1, std::vector<int> order1,
// Check the size of the derivatives.
assert
(
q1
.
size
()
==
device_
.
lock
()
->
configSize
());
assert
(
q1
.
size
()
==
q2
.
size
());
assert
(
derivatives1
.
rows
()
==
device_
.
lock
()
->
numberDof
());
assert
(
derivatives2
.
rows
()
==
device_
.
lock
()
->
numberDof
());
// For spline of degree 1 (linear interpolation), derivatives has zero columns. In this case,
// checking the number of lines is not necessary.
assert
(
derivatives1
.
rows
()
==
device_
.
lock
()
->
numberDof
()
||
derivatives1
.
cols
()
==
0
);
assert
(
derivatives2
.
rows
()
==
device_
.
lock
()
->
numberDof
()
||
derivatives1
.
cols
()
==
0
);
return
impl_compute
(
q1
,
order1
,
derivatives1
,
q2
,
order2
,
derivatives2
,
length
);
}
...
...
@@ -112,7 +116,9 @@ PathPtr_t Spline<_PB, _SO>::impl_compute(
p
->
base
(),
rhs
.
row
(
0
));
for
(
std
::
size_t
i
=
0
;
i
<
order1
.
size
();
++
i
)
p
->
basisFunctionDerivative
(
order1
[
i
],
0
,
coeffs
.
row
(
i
+
1
).
transpose
());
rhs
.
middleRows
(
1
,
order1
.
size
()).
transpose
()
=
derivatives1
;
// In case of linear interpolation order1 is of size 0 and the assignment below is wrong
if
(
order1
.
size
()
>
0
)
rhs
.
middleRows
(
1
,
order1
.
size
()).
transpose
()
=
derivatives1
;
size_type
row
=
1
+
order1
.
size
();
p
->
basisFunctionDerivative
(
0
,
1
,
coeffs
.
row
(
row
).
transpose
());
...
...
@@ -121,7 +127,9 @@ PathPtr_t Spline<_PB, _SO>::impl_compute(
++
row
;
for
(
std
::
size_t
i
=
0
;
i
<
order2
.
size
();
++
i
)
p
->
basisFunctionDerivative
(
order2
[
i
],
1
,
coeffs
.
row
(
i
+
row
).
transpose
());
rhs
.
middleRows
(
row
,
order2
.
size
()).
transpose
()
=
derivatives2
;
// In case of linear interpolation order2 is of size 0 and the assignment below is wrong
if
(
order2
.
size
()
>
0
)
rhs
.
middleRows
(
row
,
order2
.
size
()).
transpose
()
=
derivatives2
;
// Solve the problem
// coeffs * P = rhs
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment