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
2b340be9
Commit
2b340be9
authored
8 years ago
by
Steve Tonneau
Browse files
Options
Downloads
Patches
Plain Diff
accessor to waypoints
parent
58dd2dc4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/spline/bezier_curve.h
+5
-0
5 additions, 0 deletions
include/spline/bezier_curve.h
python/spline_python.cpp
+15
-0
15 additions, 0 deletions
python/spline_python.cpp
with
20 additions
and
0 deletions
include/spline/bezier_curve.h
+
5
−
0
View file @
2b340be9
...
...
@@ -179,6 +179,11 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point>
return
res
;
}
const
t_point_t
&
waypoints
()
const
{
return
pts_
;
}
/*Operations*/
/*Helpers*/
...
...
This diff is collapsed.
Click to expand it.
python/spline_python.cpp
+
15
−
0
View file @
2b340be9
...
...
@@ -98,6 +98,19 @@ t_waypoint_t getWayPoints(const coeff_t& array, const time_waypoints_t& time_wp)
return
res
;
}
template
<
typename
BezierType
,
int
dim
>
Eigen
::
Matrix
<
real
,
Eigen
::
Dynamic
,
Eigen
::
Dynamic
>
wayPointsToList
(
const
BezierType
&
self
)
{
typedef
typename
BezierType
::
t_point_t
t_point
;
typedef
typename
BezierType
::
t_point_t
::
const_iterator
cit_point
;
const
t_point
&
wps
=
self
.
waypoints
();
Eigen
::
Matrix
<
real
,
Eigen
::
Dynamic
,
Eigen
::
Dynamic
>
res
(
dim
,
wps
.
size
());
int
col
=
0
;
for
(
cit_point
cit
=
wps
.
begin
();
cit
!=
wps
.
end
();
++
cit
,
++
col
)
res
.
block
<
dim
,
1
>
(
0
,
col
)
=
*
cit
;
return
res
;
}
exact_cubic_t
*
wrapExactCubicConstructor
(
const
coeff_t
&
array
,
const
time_waypoints_t
&
time_wp
)
{
t_waypoint_t
wps
=
getWayPoints
(
array
,
time_wp
);
...
...
@@ -186,6 +199,7 @@ BOOST_PYTHON_MODULE(spline)
.
def
(
"derivate"
,
&
bezier6_t
::
derivate
)
.
def
(
"compute_derivate"
,
&
bezier6_t
::
compute_derivate
)
.
def
(
"compute_primitive"
,
&
bezier6_t
::
compute_primitive
)
.
def
(
"waypoints"
,
&
wayPointsToList
<
bezier6_t
,
6
>
)
;
/** END bezier curve**/
...
...
@@ -200,6 +214,7 @@ BOOST_PYTHON_MODULE(spline)
.
def
(
"derivate"
,
&
bezier_t
::
derivate
)
.
def
(
"compute_derivate"
,
&
bezier_t
::
compute_derivate
)
.
def
(
"compute_primitive"
,
&
bezier_t
::
compute_primitive
)
.
def
(
"waypoints"
,
&
wayPointsToList
<
bezier_t
,
3
>
)
;
/** END bezier curve**/
...
...
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