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
Guilhem Saurel
jrl-walkgen
Commits
96c3a57d
Commit
96c3a57d
authored
13 years ago
by
Andrei
Browse files
Options
Downloads
Patches
Plain Diff
Smaller refactoring
parent
00101c40
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/ZMPVelocityReferencedQP.cpp
+8
-8
8 additions, 8 deletions
src/ZMPRefTrajectoryGeneration/ZMPVelocityReferencedQP.cpp
src/ZMPRefTrajectoryGeneration/generator-vel-ref.cpp
+9
-8
9 additions, 8 deletions
src/ZMPRefTrajectoryGeneration/generator-vel-ref.cpp
with
17 additions
and
16 deletions
src/ZMPRefTrajectoryGeneration/ZMPVelocityReferencedQP.cpp
+
8
−
8
View file @
96c3a57d
...
...
@@ -293,7 +293,7 @@ ZMPVelocityReferencedQP::InitOnLine(deque<ZMPPosition> & FinalZMPTraj_deq,
void
ZMPVelocityReferencedQP
::
OnLine
(
double
t
ime
,
ZMPVelocityReferencedQP
::
OnLine
(
double
T
ime
,
deque
<
ZMPPosition
>
&
FinalZMPTraj_deq
,
deque
<
COMState
>
&
FinalCOMTraj_deq
,
deque
<
FootAbsolutePosition
>
&
FinalLeftFootTraj_deq
,
...
...
@@ -306,7 +306,7 @@ ZMPVelocityReferencedQP::OnLine(double time,
// Testing if we are reaching the end of the online mode.
if
((
EndingPhase_
)
&&
(
t
ime
>=
TimeToStopOnLineMode_
))
(
T
ime
>=
TimeToStopOnLineMode_
))
{
m_OnLineMode
=
false
;
}
...
...
@@ -322,7 +322,7 @@ ZMPVelocityReferencedQP::OnLine(double time,
// UPDATE WALKING TRAJECTORIES:
// ----------------------------
if
(
t
ime
+
0.00001
>
UpperTimeLimitToUpdate_
)
if
(
T
ime
+
0.00001
>
UpperTimeLimitToUpdate_
)
{
double
TotalAmountOfCPUTime
=
0.0
,
CurrentCPUTime
=
0.0
;
struct
timeval
start
,
end
;
...
...
@@ -332,7 +332,7 @@ ZMPVelocityReferencedQP::OnLine(double time,
// UPDATE INTERNAL DATA:
// ---------------------
VRQPGenerator_
->
Reference
(
VelRef_
);
VRQPGenerator_
->
CurrentTime
(
t
ime
+
TimeBuffer_
);
VRQPGenerator_
->
CurrentTime
(
T
ime
+
TimeBuffer_
);
VRQPGenerator_
->
CoM
(
CoM_
());
...
...
@@ -364,7 +364,7 @@ ZMPVelocityReferencedQP::OnLine(double time,
// COMPUTE ORIENTATIONS OF FEET FOR WHOLE PREVIEW PERIOD:
// ------------------------------------------------------
deque
<
double
>
PreviewedSupportAngles_deq
;
OrientPrw_
->
preview_orientations
(
t
ime
+
TimeBuffer_
,
OrientPrw_
->
preview_orientations
(
T
ime
+
TimeBuffer_
,
VelRef_
,
SupportFSM_
->
StepPeriod
(),
CurrentSupport
,
FinalLeftFootTraj_deq
,
FinalRightFootTraj_deq
,
...
...
@@ -418,7 +418,7 @@ ZMPVelocityReferencedQP::OnLine(double time,
// COMPUTE ORIENTATION OF TRUNK:
// -----------------------------
OrientPrw_
->
interpolate_trunk_orientation
(
t
ime
+
TimeBuffer_
,
CurrentIndex
,
OrientPrw_
->
interpolate_trunk_orientation
(
T
ime
+
TimeBuffer_
,
CurrentIndex
,
m_SamplingPeriod
,
CurrentSupport
,
FinalCOMTraj_deq
);
...
...
@@ -426,8 +426,8 @@ ZMPVelocityReferencedQP::OnLine(double time,
// INTERPOLATE THE COMPUTED FEET POSITIONS:
// ----------------------------------------
unsigned
NumberStepsPrwd
=
PrwSupportStates_deq
.
back
().
StepNumber
;
OFTG_
->
interpolate_feet_positions
(
t
ime
+
TimeBuffer_
,
unsigned
int
NumberStepsPrwd
=
PrwSupportStates_deq
.
back
().
StepNumber
;
OFTG_
->
interpolate_feet_positions
(
T
ime
+
TimeBuffer_
,
CurrentIndex
,
CurrentSupport
,
Result
.
Solution_vec
[
2
*
QP_N_
],
Result
.
Solution_vec
[
2
*
QP_N_
+
NumberStepsPrwd
],
PreviewedSupportAngles_deq
,
...
...
This diff is collapsed.
Click to expand it.
src/ZMPRefTrajectoryGeneration/generator-vel-ref.cpp
+
9
−
8
View file @
96c3a57d
...
...
@@ -192,6 +192,7 @@ GeneratorVelRef::initialize_matrices()
void
GeneratorVelRef
::
initialize_matrices
(
linear_inequality_t
&
Inequalities
)
{
switch
(
Inequalities
.
type
)
{
case
IntermedQPMat
::
INEQ_COP
:
...
...
@@ -285,10 +286,10 @@ GeneratorVelRef::build_inequalities_cop(linear_inequality_t & Inequalities,
//set constraints for the whole preview window
double
SupportAngle
=
CurrentSupportAngle
;
const
int
n
Edges
=
4
;
double
D_x
[
n
Edges
]
=
{
0.0
,
0.0
,
0.0
,
0.0
};
double
D_y
[
n
Edges
]
=
{
0.0
,
0.0
,
0.0
,
0.0
};
double
dc
[
n
Edges
]
=
{
0.0
,
0.0
,
0.0
,
0.0
};
const
int
Nb
Edges
=
4
;
double
D_x
[
Nb
Edges
]
=
{
0.0
,
0.0
,
0.0
,
0.0
};
double
D_y
[
Nb
Edges
]
=
{
0.0
,
0.0
,
0.0
,
0.0
};
double
dc
[
Nb
Edges
]
=
{
0.0
,
0.0
,
0.0
,
0.0
};
for
(
int
i
=
1
;
i
<=
N_
;
i
++
)
{
const
support_state_t
&
PrwSupport
=
SupportStates_deq
[
i
];
...
...
@@ -304,11 +305,11 @@ GeneratorVelRef::build_inequalities_cop(linear_inequality_t & Inequalities,
RFI
->
compute_linear_system
(
ZMPFeasibilityEdges
,
D_x
,
D_y
,
dc
,
PrwSupport
);
for
(
int
j
=
0
;
j
<
n
Edges
;
j
++
)
for
(
int
j
=
0
;
j
<
Nb
Edges
;
j
++
)
{
Inequalities
.
D
.
x
.
push_back
((
i
-
1
)
*
n
Edges
+
j
,
i
-
1
,
D_x
[
j
]);
Inequalities
.
D
.
y
.
push_back
((
i
-
1
)
*
n
Edges
+
j
,
i
-
1
,
D_y
[
j
]);
Inequalities
.
dc
((
i
-
1
)
*
n
Edges
+
j
)
=
dc
[
j
];
Inequalities
.
D
.
x
.
push_back
((
i
-
1
)
*
Nb
Edges
+
j
,
i
-
1
,
D_x
[
j
]);
Inequalities
.
D
.
y
.
push_back
((
i
-
1
)
*
Nb
Edges
+
j
,
i
-
1
,
D_y
[
j
]);
Inequalities
.
dc
((
i
-
1
)
*
Nb
Edges
+
j
)
=
dc
[
j
];
}
}
...
...
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