Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpp-bezier-com-traj
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
Guilhem Saurel
hpp-bezier-com-traj
Commits
5cc17c34
Commit
5cc17c34
authored
7 years ago
by
Pierre Fernbach
Browse files
Options
Downloads
Patches
Plain Diff
[test] test both flatground with varying constraints
parent
0f7db7bb
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
tests/test-transition.cc
+159
-1
159 additions, 1 deletion
tests/test-transition.cc
with
159 additions
and
1 deletion
tests/test-transition.cc
+
159
−
1
View file @
5cc17c34
...
...
@@ -55,7 +55,7 @@ bool check_constraints(const bezier_com_traj::ContactData& contactPhase, Vector3
}
void
check_transition
(
bezier_com_traj
::
ProblemData
&
pData
,
VectorX
Ts
){
void
check_transition
(
bezier_com_traj
::
ProblemData
&
pData
,
VectorX
Ts
,
bool
shouldFail
=
false
){
BOOST_CHECK_EQUAL
(
pData
.
contacts_
.
size
(),
Ts
.
size
());
double
t_total
=
0
;
...
...
@@ -67,6 +67,11 @@ void check_transition(bezier_com_traj::ProblemData& pData, VectorX Ts){
// check if transition is feasible (should be)
bezier_com_traj
::
ResultDataCOMTraj
res
=
bezier_com_traj
::
solveOnestep
(
pData
,
Ts
,
init
,
pointsPerPhase
);
if
(
shouldFail
){
BOOST_CHECK
(
!
res
.
success_
);
return
;
}
BOOST_CHECK
(
res
.
success_
);
if
(
res
.
success_
){
...
...
@@ -225,6 +230,159 @@ BOOST_AUTO_TEST_CASE(transition){
}
BOOST_AUTO_TEST_CASE
(
transition_noDc1
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
dc1_
=
false
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
);
}
BOOST_AUTO_TEST_CASE
(
transition_ddc0
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
ddc0_
=
true
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
);
}
BOOST_AUTO_TEST_CASE
(
transition_ddc0_ddc1
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
ddc0_
=
true
;
pData
.
constraints_
.
ddc1_
=
true
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
);
}
BOOST_AUTO_TEST_CASE
(
transition_noAcc
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
constraintAcceleration_
=
false
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
);
}
BOOST_AUTO_TEST_CASE
(
transition_noDc1_noAcc
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
dc1_
=
false
;
pData
.
constraints_
.
constraintAcceleration_
=
false
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
);
}
BOOST_AUTO_TEST_CASE
(
transition_ddc0_noAcc
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
ddc0_
=
true
;
pData
.
constraints_
.
constraintAcceleration_
=
false
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
);
}
BOOST_AUTO_TEST_CASE
(
transition_ddc0_ddc1_noAcc
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
ddc0_
=
true
;
pData
.
constraints_
.
ddc1_
=
true
;
pData
.
constraints_
.
constraintAcceleration_
=
false
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
);
}
BOOST_AUTO_TEST_CASE
(
transition_Acc1
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
maxAcceleration_
=
1.
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
);
}
BOOST_AUTO_TEST_CASE
(
transition_noDc1_Acc1
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
dc1_
=
false
;
pData
.
constraints_
.
maxAcceleration_
=
1.
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
);
}
BOOST_AUTO_TEST_CASE
(
transition_ddc0_Acc2
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
ddc0_
=
true
;
pData
.
constraints_
.
maxAcceleration_
=
2.
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
);
}
BOOST_AUTO_TEST_CASE
(
transition_ddc0_ddc1_Acc2
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
ddc0_
=
true
;
pData
.
constraints_
.
ddc1_
=
true
;
pData
.
constraints_
.
maxAcceleration_
=
2.
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
);
}
BOOST_AUTO_TEST_CASE
(
transition_ddc0_ddc1_Acc05
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
ddc0_
=
true
;
pData
.
constraints_
.
ddc1_
=
true
;
pData
.
constraints_
.
maxAcceleration_
=
0.5
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
);
}
BOOST_AUTO_TEST_CASE
(
transition_Acc05
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
maxAcceleration_
=
0.5
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
);
}
// constraints that should fails :
BOOST_AUTO_TEST_CASE
(
transition_Acc02
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
maxAcceleration_
=
0.2
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
,
true
);
}
BOOST_AUTO_TEST_CASE
(
transition_noDc1_Acc05
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
dc1_
=
false
;
pData
.
constraints_
.
maxAcceleration_
=
0.5
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
,
true
);
}
BOOST_AUTO_TEST_CASE
(
transition_ddc0_Acc1
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
ddc0_
=
true
;
pData
.
constraints_
.
maxAcceleration_
=
1.
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
,
true
);
}
BOOST_AUTO_TEST_CASE
(
transition_ddc0_ddc1_Acc02
){
bezier_com_traj
::
ProblemData
pData
=
gen_problem_data_flat
();
pData
.
constraints_
.
ddc0_
=
true
;
pData
.
constraints_
.
ddc1_
=
true
;
pData
.
constraints_
.
maxAcceleration_
=
0.2
;
VectorX
Ts
(
3
);
Ts
<<
0.6
,
0.6
,
0.6
;
check_transition
(
pData
,
Ts
,
true
);
}
BOOST_AUTO_TEST_SUITE_END
()
...
...
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