Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Q
quadruped-reactive-walking
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
Gepetto
quadruped-reactive-walking
Commits
94b50c7f
Commit
94b50c7f
authored
3 years ago
by
Pierre-Alexandre Leziart
Browse files
Options
Downloads
Patches
Plain Diff
Commit controller for same reason
parent
0613aa3c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#16024
failed
3 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/Controller.py
+10
-7
10 additions, 7 deletions
scripts/Controller.py
with
10 additions
and
7 deletions
scripts/Controller.py
+
10
−
7
View file @
94b50c7f
...
@@ -255,7 +255,7 @@ class Controller:
...
@@ -255,7 +255,7 @@ class Controller:
int
(
self
.
k_mpc
-
self
.
k
%
self
.
k_mpc
),
int
(
self
.
k_mpc
-
self
.
k
%
self
.
k_mpc
),
self
.
q
[:,
0
],
self
.
q
[:,
0
],
self
.
h_v_windowed
[
0
:
6
,
0
:
1
].
copy
(),
self
.
h_v_windowed
[
0
:
6
,
0
:
1
].
copy
(),
self
.
v_ref
[
0
:
6
,
0
])
self
.
v_ref
[
0
:
6
,
0
:
1
])
# Run state planner (outputs the reference trajectory of the base)
# Run state planner (outputs the reference trajectory of the base)
self
.
statePlanner
.
computeReferenceStates
(
self
.
q_filt_mpc
[
0
:
6
,
0
:
1
],
self
.
h_v_filt_mpc
[
0
:
6
,
0
:
1
].
copy
(),
self
.
statePlanner
.
computeReferenceStates
(
self
.
q_filt_mpc
[
0
:
6
,
0
:
1
],
self
.
h_v_filt_mpc
[
0
:
6
,
0
:
1
].
copy
(),
...
@@ -311,10 +311,12 @@ class Controller:
...
@@ -311,10 +311,12 @@ class Controller:
if
(
not
self
.
error
)
and
(
not
self
.
joystick
.
stop
):
if
(
not
self
.
error
)
and
(
not
self
.
joystick
.
stop
):
# Update configuration vector for wbc
# Update configuration vector for wbc
self
.
q_wbc
[
2
,
0
]
=
self
.
h_ref
# Height
"""
self.q_wbc[2, 0] = self.h_ref # Height
self.q_wbc[3, 0] = self.q_filt_mpc[3, 0] # Roll
self.q_wbc[3, 0] = self.q_filt_mpc[3, 0] # Roll
self.q_wbc[4, 0] = self.q_filt_mpc[4, 0] # Pitch
self.q_wbc[4, 0] = self.q_filt_mpc[4, 0] # Pitch
self
.
q_wbc
[
6
:,
0
]
=
self
.
wbcWrapper
.
qdes
[:]
# with reference angular positions of previous loop
self.q_wbc[6:, 0] = self.wbcWrapper.qdes[:] # with reference angular positions of previous loop
"""
self
.
q_wbc
[:,
0
]
=
self
.
q_filt_mpc
[:,
0
].
copy
()
self
.
q_wbc
[
2
,
0
]
=
self
.
h_ref
# Height
# Update velocity vector for wbc
# Update velocity vector for wbc
self
.
dq_wbc
[:
6
,
0
]
=
self
.
estimator
.
getVFilt
()[:
6
]
# Velocities in base frame (not horizontal frame!)
self
.
dq_wbc
[:
6
,
0
]
=
self
.
estimator
.
getVFilt
()[:
6
]
# Velocities in base frame (not horizontal frame!)
...
@@ -327,8 +329,9 @@ class Controller:
...
@@ -327,8 +329,9 @@ class Controller:
oRh
.
transpose
(),
np
.
zeros
((
3
,
1
)),
np
.
zeros
((
3
,
1
)))
oRh
.
transpose
(),
np
.
zeros
((
3
,
1
)),
np
.
zeros
((
3
,
1
)))
self
.
feet_p_cmd
=
self
.
footTrajectoryGenerator
.
getFootPositionBaseFrame
(
oRh
.
transpose
(),
oTh
)
self
.
feet_p_cmd
=
self
.
footTrajectoryGenerator
.
getFootPositionBaseFrame
(
oRh
.
transpose
(),
oTh
)
#
Desired position, orientation and velocities of the base
#
Desired position, orientation and velocities of the base
if
not
self
.
gait
.
getIsStatic
():
if
not
self
.
gait
.
getIsStatic
():
self
.
xgoals
[[
0
,
1
,
5
],
0
]
=
self
.
q_filt_mpc
[[
0
,
1
,
5
],
0
]
self
.
xgoals
[
2
:
5
,
0
]
=
[
self
.
h_ref
,
0.0
,
0.0
]
# Height (in horizontal frame!)
self
.
xgoals
[
2
:
5
,
0
]
=
[
self
.
h_ref
,
0.0
,
0.0
]
# Height (in horizontal frame!)
else
:
else
:
self
.
xgoals
[
2
:
5
,
0
]
+=
self
.
vref_filt_mpc
[
2
:
5
,
0
]
*
self
.
dt_wbc
self
.
xgoals
[
2
:
5
,
0
]
+=
self
.
vref_filt_mpc
[
2
:
5
,
0
]
*
self
.
dt_wbc
...
@@ -338,9 +341,9 @@ class Controller:
...
@@ -338,9 +341,9 @@ class Controller:
# Run InvKin + WBC QP
# Run InvKin + WBC QP
self
.
wbcWrapper
.
compute
(
self
.
q_wbc
,
self
.
dq_wbc
,
self
.
wbcWrapper
.
compute
(
self
.
q_wbc
,
self
.
dq_wbc
,
(
self
.
x_f_mpc
[
12
:
24
,
0
:
1
]).
copy
(),
np
.
array
([
cgait
[
0
,
:]]),
(
self
.
x_f_mpc
[
12
:
24
,
0
:
1
]).
copy
(),
np
.
array
([
cgait
[
0
,
:]]),
self
.
f
eet_p_cmd
,
self
.
f
ootTrajectoryGenerator
.
getFootPosition
()
,
self
.
f
eet_v_cmd
,
self
.
f
ootTrajectoryGenerator
.
getFootVelocity
()
,
self
.
f
eet_a_cmd
,
self
.
f
ootTrajectoryGenerator
.
getFootAcceleration
()
,
self
.
xgoals
)
self
.
xgoals
)
# Quantities sent to the control board
# Quantities sent to the control board
...
...
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