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
e6c495d0
Commit
e6c495d0
authored
8 years ago
by
Steve Tonneau
Browse files
Options
Downloads
Patches
Plain Diff
fixed property accessing for derivative constraints
parent
d6b06346
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
python/spline_python.cpp
+46
-4
46 additions, 4 deletions
python/spline_python.cpp
python/test/test.py
+9
-3
9 additions, 3 deletions
python/test/test.py
with
55 additions
and
7 deletions
python/spline_python.cpp
+
46
−
4
View file @
e6c495d0
...
...
@@ -96,6 +96,48 @@ spline_deriv_constraint_t* wrapSplineDerivConstraintNoConstraints(const coeff_t&
return
new
spline_deriv_constraint_t
(
wps
.
begin
(),
wps
.
end
());
}
point_t
get_init_vel
(
const
spline_constraints_t
&
c
)
{
return
c
.
init_vel
;
}
point_t
get_init_acc
(
const
spline_constraints_t
&
c
)
{
return
c
.
init_acc
;
}
point_t
get_end_vel
(
const
spline_constraints_t
&
c
)
{
return
c
.
end_vel
;
}
point_t
get_end_acc
(
const
spline_constraints_t
&
c
)
{
return
c
.
end_acc
;
}
void
set_init_vel
(
spline_constraints_t
&
c
,
const
point_t
&
val
)
{
c
.
init_vel
=
val
;
}
void
set_init_acc
(
spline_constraints_t
&
c
,
const
point_t
&
val
)
{
c
.
init_acc
=
val
;
}
void
set_end_vel
(
spline_constraints_t
&
c
,
const
point_t
&
val
)
{
c
.
end_vel
=
val
;
}
void
set_end_acc
(
spline_constraints_t
&
c
,
const
point_t
&
val
)
{
c
.
end_acc
=
val
;
}
BOOST_PYTHON_MODULE
(
spline
)
{
/** BEGIN eigenpy init**/
...
...
@@ -147,10 +189,10 @@ BOOST_PYTHON_MODULE(spline)
/** BEGIN spline constraints**/
class_
<
spline_constraints_t
>
(
"spline_constraints"
,
init
<>
())
.
def_readwrite
(
"init_vel"
,
&
spline_constraints_t
::
init_vel
)
.
def_readwrite
(
"init_acc"
,
&
spline_constraints_t
::
init_acc
)
.
def_readwrite
(
"end_vel"
,
&
spline_constraints_t
::
end_vel
)
.
def_readwrite
(
"end_acc"
,
&
spline_constraints_t
::
end_acc
)
.
add_property
(
"init_vel"
,
&
get_init_vel
,
&
set_
init_vel
)
.
add_property
(
"init_acc"
,
&
get_init_acc
,
&
set_
init_acc
)
.
add_property
(
"end_vel"
,
&
get_end_vel
,
&
set_
end_vel
)
.
add_property
(
"end_acc"
,
&
get_end_acc
,
&
set_
end_acc
)
;
/** END spline constraints**/
...
...
This diff is collapsed.
Click to expand it.
python/test/test.py
+
9
−
3
View file @
e6c495d0
...
...
@@ -32,10 +32,16 @@ a.derivate(0.4,2)
#testing spline_deriv_constraints
c
=
spline_constraints
();
#~ c.init_vel; // TODO: error in reading DATA at the time ...
#~ c.end_vel;
c
.
init_vel
;
# TODO: error in reading DATA at the time ...
c
.
end_vel
;
c
.
init_acc
;
c
.
end_acc
;
c
.
init_vel
=
matrix
([
0.
,
1.
,
1.
]);
c
.
end_vel
=
matrix
([
0.
,
1.
,
1.
]);
c
.
init_acc
=
matrix
([
0.
,
1.
,
1.
]);
#~
c.end_acc;
c
.
end_acc
=
matrix
([
0.
,
1.
,
1.
])
;
a
=
spline_deriv_constraint
(
waypoints
,
time_waypoints
)
a
=
spline_deriv_constraint
(
waypoints
,
time_waypoints
,
c
)
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