Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jrl-walkgen
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Stack Of Tasks
jrl-walkgen
Commits
7383eaa3
Commit
7383eaa3
authored
9 years ago
by
mnaveau
Browse files
Options
Downloads
Patches
Plain Diff
generalize the SQP period of recalculation
parent
ddd1b8a4
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
src/ZMPRefTrajectoryGeneration/ZMPVelocityReferencedSQP.cpp
+43
-35
43 additions, 35 deletions
src/ZMPRefTrajectoryGeneration/ZMPVelocityReferencedSQP.cpp
src/ZMPRefTrajectoryGeneration/ZMPVelocityReferencedSQP.hh
+11
-10
11 additions, 10 deletions
src/ZMPRefTrajectoryGeneration/ZMPVelocityReferencedSQP.hh
with
54 additions
and
45 deletions
src/ZMPRefTrajectoryGeneration/ZMPVelocityReferencedSQP.cpp
+
43
−
35
View file @
7383eaa3
...
...
@@ -65,9 +65,11 @@ ZMPRefTrajectoryGeneration(SPM),OFTG_(NULL),dynamicFilter_(NULL),CurrentIndexUpp
m_SamplingPeriod
=
0.005
;
// Generator Management
InterpolationPeriod_
=
m_SamplingPeriod
*
10
;
previewSize_
=
9
;
InterpolationPeriod_
=
m_SamplingPeriod
*
7
;
previewSize_
=
8
;
previewDuration_
=
(
previewSize_
-
1
)
*
SQP_T_
;
outputPreviewDuration_
=
m_SamplingPeriod
;
NbSampleOutput_
=
(
int
)
round
(
outputPreviewDuration_
/
m_SamplingPeriod
)
+
1
;
NbSampleControl_
=
(
int
)
round
(
SQP_T_
/
m_SamplingPeriod
)
;
NbSampleInterpolation_
=
(
int
)
round
(
SQP_T_
/
InterpolationPeriod_
)
;
StepPeriod_
=
0.8
;
...
...
@@ -144,6 +146,8 @@ ZMPRefTrajectoryGeneration(SPM),OFTG_(NULL),dynamicFilter_(NULL),CurrentIndexUpp
LeftFootTraj_deq_ctrl_
.
resize
(
previewSize_
*
NbSampleControl_
+
CurrentIndexUpperBound_
);
RightFootTraj_deq_ctrl_
.
resize
(
previewSize_
*
NbSampleControl_
+
CurrentIndexUpperBound_
);
deltaCOMTraj_deq_
.
resize
((
int
)
round
(
outputPreviewDuration_
/
m_SamplingPeriod
));
JerkX_
.
clear
();
JerkY_
.
clear
();
FootStepX_
.
clear
();
...
...
@@ -351,7 +355,7 @@ int ZMPVelocityReferencedSQP::InitOnLine(deque<ZMPPosition> & FinalZMPTraj_deq,
dynamicFilter_
->
getComAndFootRealization
()
->
ShiftFoot
(
true
);
dynamicFilter_
->
init
(
m_SamplingPeriod
,
InterpolationPeriod_
,
m_SamplingPeriod
,
outputPreviewDuration_
,
previewDuration_
,
previewDuration_
-
SQP_T_
,
lStartingCOMState
);
...
...
@@ -384,14 +388,13 @@ void ZMPVelocityReferencedSQP::OnLine(double time,
}
// Test if the end of the online mode has been reached.
if
((
EndingPhase_
)
&&
(
time
>=
TimeToStopOnLineMode_
))
if
((
EndingPhase_
)
&&
(
time
>=
TimeToStopOnLineMode_
))
{
m_OnLineMode
=
false
;
}
// UPDATE WALKING TRAJECTORIES:
// ----------------------------
//
if(time + 0.00001 > UpperTimeLimitToUpdate_)
//
{
if
(
time
+
0.00001
>
UpperTimeLimitToUpdate_
)
{
// UPDATE INTERNAL DATA:
// ---------------------
if
(
PerturbationOccured_
&&
...
...
@@ -427,24 +430,24 @@ void ZMPVelocityReferencedSQP::OnLine(double time,
double
ltime
=
end
.
tv_sec
-
begin
.
tv_sec
+
0.000001
*
(
end
.
tv_usec
-
begin
.
tv_usec
);
//
bool endline = false ;
//
if(ltime >= 0.0005)
//
{
//
cout << ltime * 1000 << " "
//
<< NMPCgenerator_->cput()*1000 << " "
//
<< ltime * 1000 - NMPCgenerator_->cput()*1000 ;
//
endline = true;
//
}
//
if((ltime * 1000 - NMPCgenerator_->cput()*1000)>= 0.5)
//
{
//
++warning;
//
cout << " : warning on cpu time ; " << warning ;
//
endline = true;
//
}
//
if(endline)
//
{
//
cout << endl;
//
}
bool
endline
=
false
;
if
(
ltime
>=
0.0005
)
{
cout
<<
ltime
*
1000
<<
" "
<<
NMPCgenerator_
->
cput
()
*
1000
<<
" "
<<
ltime
*
1000
-
NMPCgenerator_
->
cput
()
*
1000
;
endline
=
true
;
}
if
((
ltime
*
1000
-
NMPCgenerator_
->
cput
()
*
1000
)
>=
0.5
)
{
++
warning
;
cout
<<
" : warning on cpu time ; "
<<
warning
;
endline
=
true
;
}
if
(
endline
)
{
cout
<<
endl
;
}
// INITIALIZE INTERPOLATION:
// ------------------------
...
...
@@ -462,9 +465,9 @@ void ZMPVelocityReferencedSQP::OnLine(double time,
FullTrajectoryInterpolation
(
time
);
// Take only the data that are actually used by the robot
FinalZMPTraj_deq
.
resize
(
2
);
FinalLeftFootTraj_deq
.
resize
(
2
);;
FinalCOMTraj_deq
.
resize
(
2
);
FinalRightFootTraj_deq
.
resize
(
2
);;
for
(
unsigned
i
=
0
;
i
<
2
;
++
i
)
FinalZMPTraj_deq
.
resize
(
NbSampleOutput_
);
FinalLeftFootTraj_deq
.
resize
(
NbSampleOutput_
);;
FinalCOMTraj_deq
.
resize
(
NbSampleOutput_
);
FinalRightFootTraj_deq
.
resize
(
NbSampleOutput_
);;
for
(
unsigned
i
=
0
;
i
<
NbSampleOutput_
;
++
i
)
{
FinalZMPTraj_deq
[
i
]
=
ZMPTraj_deq_ctrl_
[
i
]
;
FinalCOMTraj_deq
[
i
]
=
COMTraj_deq_ctrl_
[
i
]
;
...
...
@@ -506,17 +509,22 @@ void ZMPVelocityReferencedSQP::OnLine(double time,
{
if
(
EndingPhase_
==
false
)
{
TimeToStopOnLineMode_
=
UpperTimeLimitToUpdate_
+
SQP_T_
*
SQP_N_
+
m_SamplingPeriod
;
TimeToStopOnLineMode_
=
UpperTimeLimitToUpdate_
+
outputPreviewDuration_
*
SQP_N_
+
m_SamplingPeriod
;
}
UpperTimeLimitToUpdate_
=
UpperTimeLimitToUpdate_
+
SQP_T_
+
m_SamplingPeriod
;
UpperTimeLimitToUpdate_
=
UpperTimeLimitToUpdate_
+
outputPreviewDuration_
+
m_SamplingPeriod
;
}
else
{
if
(
EndingPhase_
==
false
)
{
TimeToStopOnLineMode_
=
UpperTimeLimitToUpdate_
+
SQP_T_
*
SQP_N_
;
TimeToStopOnLineMode_
=
UpperTimeLimitToUpdate_
+
outputPreviewDuration_
*
SQP_N_
;
}
UpperTimeLimitToUpdate_
=
UpperTimeLimitToUpdate_
+
SQP_T_
;
UpperTimeLimitToUpdate_
=
UpperTimeLimitToUpdate_
+
outputPreviewDuration_
;
}
//
}
}
//-----------------------------------
//
//
...
...
@@ -542,7 +550,7 @@ void ZMPVelocityReferencedSQP::FullTrajectoryInterpolation(double time)
LIPM_
.
setState
(
itCOM_
);
CoMZMPInterpolation
(
JerkX_
,
JerkY_
,
&
LIPM_
,
NbSampleControl_
,
0
,
CurrentIndex_
,
SupportStates_deq
);
itCOM_
=
COMTraj_deq_ctrl_
[
1
];
itCOM_
=
COMTraj_deq_ctrl_
[
NbSampleOutput_
-
1
];
support_state_t
currentSupport
=
SupportStates_deq
[
0
]
;
currentSupport
.
StepNumber
=
0
;
...
...
@@ -627,7 +635,7 @@ void ZMPVelocityReferencedSQP::CoMZMPInterpolation(
const
double
tf
=
0.75
;
jx
=
6
/
(
tf
*
tf
*
tf
)
*
(
jx
-
tf
*
COMTraj_deq_ctrl_
[
i
-
1
].
x
[
1
]
-
(
tf
*
tf
/
2
)
*
COMTraj_deq_ctrl_
[
i
-
1
].
x
[
2
]);
jy
=
6
/
(
tf
*
tf
*
tf
)
*
(
jy
-
tf
*
COMTraj_deq_ctrl_
[
i
-
1
].
y
[
1
]
-
(
tf
*
tf
/
2
)
*
COMTraj_deq_ctrl_
[
i
-
1
].
y
[
2
]);
LIPM
->
Interpolation
(
COMTraj_deq_ctrl_
,
ZMPTraj_deq_ctrl_
,
currentIndex
+
IterationNumber
*
numberOfSample
,
jx
,
jy
);
LIPM
->
Interpolation
(
COMTraj_deq_ctrl_
,
ZMPTraj_deq_ctrl_
,
currentIndex
,
jx
,
jy
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
src/ZMPRefTrajectoryGeneration/ZMPVelocityReferencedSQP.hh
+
11
−
10
View file @
7383eaa3
...
...
@@ -259,32 +259,31 @@ namespace PatternGeneratorJRL
FootAbsolutePosition
initRightFoot_
;
COMState
itCOM_
;
/// \brief Duration of the preview for filtering
double
previewDuration_
;
/// \brief Size of the preview for filtering
int
previewSize_
;
/// \brief Size of the output preview
unsigned
NbSampleOutput_
;
/// \brief Number of interpolated point needed for control computed during QP_T_
unsigned
NbSampleControl_
;
/// \brief Number of interpolated point needed for the dynamic filter computed during QP_T_
unsigned
NbSampleInterpolation_
;
/// \brief Size of the preview for filtering
unsigned
previewSize_
;
/// \brief Duration of the preview for filtering
double
previewDuration_
;
/// \brief Duration of the output preview
double
outputPreviewDuration_
;
/// \brief Interpolation Period for the dynamic filter
double
InterpolationPeriod_
;
/// \brief Step Period of the robot
double
StepPeriod_
;
/// \brief Period where the robot is on ONE feet
double
SSPeriod_
;
/// \brief Period where the robot is on TWO feet
double
DSPeriod_
;
/// \brief Maximum distance between the feet
double
FeetDistance_
;
/// \brief Maximum height of the feet
double
StepHeight_
;
/// \brief Height of the CoM
double
CoMHeight_
;
...
...
@@ -335,6 +334,8 @@ namespace PatternGeneratorJRL
const
int
IterationNumber
,
// INPUT
const
unsigned
int
currentIndex
,
// INPUT
const
std
::
deque
<
support_state_t
>
&
SupportStates_deq
);
// INPUT
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
}
...
...
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