Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
ndcurves
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
loco-3d
ndcurves
Commits
4ced853a
Commit
4ced853a
authored
5 years ago
by
Pierre Fernbach
Browse files
Options
Downloads
Patches
Plain Diff
[Python] fix piecewise_polynomial.addFinalC... methods
parent
b46a5f0c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/curves_python.cpp
+12
-6
12 additions, 6 deletions
python/curves_python.cpp
with
12 additions
and
6 deletions
python/curves_python.cpp
+
12
−
6
View file @
4ced853a
...
...
@@ -194,16 +194,20 @@ static piecewise_polynomial_curve_t discretPointToPolynomialC2(const pointX_list
return
piecewise_polynomial_curve_t
::
convert_discrete_points_to_polynomial
<
polynomial_t
>
(
points_list
,
points_derivative_list
,
points_second_derivative_list
,
time_points_list
);
}
void
addFinalPointC0
(
piecewise_polynomial_curve_t
self
,
const
pointX_t
&
end
,
const
real
time
)
{
if
(
self
.
is_continuous
(
1
))
void
addFinalPointC0
(
piecewise_polynomial_curve_t
&
self
,
const
pointX_t
&
end
,
const
real
time
)
{
if
(
self
.
num_curves
()
==
0
)
throw
std
::
runtime_error
(
"Piecewise append : you need to add at least one curve before using append(finalPoint) method."
);
if
(
self
.
is_continuous
(
1
)
&&
self
.
num_curves
()
>
1
)
std
::
cout
<<
"Warning: by adding this final point to the piecewise curve, you loose C1 continuity and only "
"guarantee C0 continuity."
<<
std
::
endl
;
polynomial_t
pol
(
self
(
self
.
max
()),
end
,
self
.
max
(),
time
);
self
.
add_curve
(
pol
);
}
void
addFinalPointC1
(
piecewise_polynomial_curve_t
self
,
const
pointX_t
&
end
,
const
pointX_t
&
d_end
,
const
real
time
)
{
if
(
self
.
is_continuous
(
2
))
void
addFinalPointC1
(
piecewise_polynomial_curve_t
&
self
,
const
pointX_t
&
end
,
const
pointX_t
&
d_end
,
const
real
time
)
{
if
(
self
.
num_curves
()
==
0
)
throw
std
::
runtime_error
(
"Piecewise append : you need to add at least one curve before using append(finalPoint) method."
);
if
(
self
.
is_continuous
(
2
)
&&
self
.
num_curves
()
>
1
)
std
::
cout
<<
"Warning: by adding this final point to the piecewise curve, you loose C2 continuity and only "
"guarantee C1 continuity."
<<
std
::
endl
;
...
...
@@ -211,9 +215,11 @@ void addFinalPointC1(piecewise_polynomial_curve_t self, const pointX_t& end, con
polynomial_t
pol
(
self
(
self
.
max
()),
self
.
derivate
(
self
.
max
(),
1
),
end
,
d_end
,
self
.
max
(),
time
);
self
.
add_curve
(
pol
);
}
void
addFinalPointC2
(
piecewise_polynomial_curve_t
self
,
const
pointX_t
&
end
,
const
pointX_t
&
d_end
,
void
addFinalPointC2
(
piecewise_polynomial_curve_t
&
self
,
const
pointX_t
&
end
,
const
pointX_t
&
d_end
,
const
pointX_t
&
dd_end
,
const
real
time
)
{
if
(
self
.
is_continuous
(
3
))
if
(
self
.
num_curves
()
==
0
)
throw
std
::
runtime_error
(
"Piecewise append : you need to add at least one curve before using append(finalPoint) method."
);
if
(
self
.
is_continuous
(
3
)
&&
self
.
num_curves
()
>
1
)
std
::
cout
<<
"Warning: by adding this final point to the piecewise curve, you loose C3 continuity and only "
"guarantee C2 continuity."
<<
std
::
endl
;
...
...
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