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
d396ce74
Commit
d396ce74
authored
3 years ago
by
odri
Browse files
Options
Downloads
Patches
Plain Diff
Remove updateState function that has been replaced by a c++ version
parent
44fc04c4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/Controller.py
+0
-48
0 additions, 48 deletions
scripts/Controller.py
with
0 additions
and
48 deletions
scripts/Controller.py
+
0
−
48
View file @
d396ce74
...
@@ -394,51 +394,3 @@ class Controller:
...
@@ -394,51 +394,3 @@ class Controller:
self
.
t_mpc
=
t_mpc
-
t_planner
self
.
t_mpc
=
t_mpc
-
t_planner
self
.
t_wbc
=
t_wbc
-
t_mpc
self
.
t_wbc
=
t_wbc
-
t_mpc
self
.
t_loop
=
time
.
time
()
-
tic
self
.
t_loop
=
time
.
time
()
-
tic
def
updateState
(
self
):
# Update reference velocity vector
self
.
v_ref
[
0
:
3
,
0
]
=
self
.
joystick
.
v_ref
[
0
:
3
,
0
]
# TODO: Joystick velocity given in base frame and not
self
.
v_ref
[
3
:
6
,
0
]
=
self
.
joystick
.
v_ref
[
3
:
6
,
0
]
# in horizontal frame (case of non flat ground)
self
.
v_ref
[
6
:,
0
]
=
0.0
# Update position and velocity state vectors
if
not
self
.
gait
.
getIsStatic
():
# Integration to get evolution of perfect x, y and yaw
Ryaw
=
np
.
array
([[
math
.
cos
(
self
.
yaw_estim
),
-
math
.
sin
(
self
.
yaw_estim
)],
[
math
.
sin
(
self
.
yaw_estim
),
math
.
cos
(
self
.
yaw_estim
)]])
self
.
q
[
0
:
2
,
0
:
1
]
=
self
.
q
[
0
:
2
,
0
:
1
]
+
Ryaw
@
self
.
v_ref
[
0
:
2
,
0
:
1
]
*
self
.
dt_wbc
# Mix perfect x and y with height measurement
self
.
q
[
2
,
0
]
=
self
.
estimator
.
getQFilt
()[
2
]
# Mix perfect yaw with pitch and roll measurements
self
.
yaw_estim
+=
self
.
v_ref
[
5
,
0
]
*
self
.
dt_wbc
self
.
q
[
3
:
7
,
0
]
=
pin
.
Quaternion
(
pin
.
rpy
.
rpyToMatrix
(
self
.
estimator
.
getRPY
()[
0
],
self
.
estimator
.
getRPY
()[
1
],
self
.
yaw_estim
)).
coeffs
()
# Actuators measurements
self
.
q
[
7
:,
0
]
=
self
.
estimator
.
getQFilt
()[
7
:]
# Velocities are the one estimated by the estimator
self
.
v
=
self
.
estimator
.
getVFilt
().
reshape
((
-
1
,
1
))
hRb
=
pin
.
rpy
.
rpyToMatrix
(
self
.
estimator
.
getRPY
()[
0
],
self
.
estimator
.
getRPY
()[
1
],
0.0
)
self
.
h_v
[
0
:
3
,
0
:
1
]
=
hRb
@
self
.
v
[
0
:
3
,
0
:
1
]
self
.
h_v
[
3
:
6
,
0
:
1
]
=
hRb
@
self
.
v
[
3
:
6
,
0
:
1
]
# self.v[:6, 0] = self.joystick.v_ref[:6, 0]
else
:
quat
=
np
.
array
([[
0.0
,
0.0
,
0.0
,
1.0
]]).
transpose
()
hRb
=
np
.
eye
(
3
)
pass
# TODO: Adapt static mode to new version of the code
# Transformation matrices between world and horizontal frames
oRh
=
np
.
eye
(
3
)
c
=
math
.
cos
(
self
.
yaw_estim
)
s
=
math
.
sin
(
self
.
yaw_estim
)
oRh
[
0
:
2
,
0
:
2
]
=
np
.
array
([[
c
,
-
s
],
[
s
,
c
]])
oTh
=
np
.
array
([[
self
.
q
[
0
,
0
]],
[
self
.
q
[
1
,
0
]],
[
0.0
]])
return
oRh
,
oTh
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