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
a0756559
Commit
a0756559
authored
3 years ago
by
Pierre-Alexandre Leziart
Browse files
Options
Downloads
Patches
Plain Diff
Remove Planner.py
parent
9a7edc59
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/Planner.py
+0
-74
0 additions, 74 deletions
scripts/Planner.py
with
0 additions
and
74 deletions
scripts/Planner.py
deleted
100644 → 0
+
0
−
74
View file @
9a7edc59
import
time
import
numpy
as
np
import
libquadruped_reactive_walking
as
la
class
PyPlanner
:
def
__init__
(
self
,
dt
,
dt_tsid
,
T_gait
,
T_mpc
,
k_mpc
,
on_solo8
,
h_ref
,
fsteps_init
):
# Reference height for the trunk
self
.
h_ref
=
h_ref
# Number of time steps in the prediction horizon
self
.
n_steps
=
np
.
int
(
T_gait
/
dt
)
# Reference trajectory matrix of size 12 by (1 + N) with the current state of
# the robot in column 0 and the N steps of the prediction horizon in the others
self
.
xref
=
np
.
zeros
((
12
,
1
+
self
.
n_steps
))
# Gait matrix
self
.
gait
=
np
.
zeros
((
20
,
5
))
self
.
is_static
=
False
# Flag for static gait
self
.
q_static
=
np
.
zeros
(
19
)
self
.
RPY_static
=
np
.
zeros
((
3
,
1
))
self
.
goals
=
fsteps_init
.
copy
()
# Store 3D target position for feet
self
.
vgoals
=
np
.
zeros
((
3
,
4
))
# Store 3D target velocity for feet
self
.
agoals
=
np
.
zeros
((
3
,
4
))
# Store 3D target acceleration for feet
self
.
target_position
=
np
.
zeros
((
3
,
4
))
# Store 3D target acceleration for feet
# C++ class
shoulders
=
np
.
zeros
((
3
,
4
))
shoulders
[
0
,
:]
=
[
0.1946
,
0.1946
,
-
0.1946
,
-
0.1946
]
shoulders
[
1
,
:]
=
[
0.14695
,
-
0.14695
,
0.14695
,
-
0.14695
]
self
.
planner
=
la
.
Planner
(
dt
,
dt_tsid
,
T_gait
,
T_mpc
,
k_mpc
,
h_ref
,
fsteps_init
,
shoulders
)
def
run_planner
(
self
,
k
,
q
,
v
,
b_vref
):
# Run C++ planner
self
.
planner
.
run_planner
(
k
,
q
,
v
,
b_vref
)
# Retrieve data from C++ planner
self
.
fsteps
=
self
.
planner
.
get_fsteps
()
self
.
gait
=
self
.
planner
.
get_gait
()
self
.
goals
=
self
.
planner
.
get_goals
()
self
.
vgoals
=
self
.
planner
.
get_vgoals
()
self
.
agoals
=
self
.
planner
.
get_agoals
()
return
0
def
updateGait
(
self
,
k
,
k_mpc
,
q
,
joystick
=
None
):
# Check joystick buttons to trigger a change of gait type
joystick_code
=
0
if
joystick
is
not
None
:
if
joystick
.
northButton
:
joystick_code
=
1
self
.
is_static
=
False
joystick
.
northButton
=
False
elif
joystick
.
eastButton
:
joystick_code
=
2
self
.
is_static
=
False
joystick
.
eastButton
=
False
elif
joystick
.
southButton
:
joystick_code
=
3
self
.
is_static
=
False
joystick
.
southButton
=
False
elif
joystick
.
westButton
:
joystick_code
=
4
self
.
is_static
=
True
self
.
q_static
[
0
:
7
,
0
:
1
]
=
q
.
copy
()
joystick
.
westButton
=
False
# Update gait internally with functions of the gait class
self
.
planner
.
updateGait
(
k
,
k_mpc
,
q
,
joystick_code
)
return
0
def
setGait
(
self
,
gaitMatrix
):
# Directly set the gait matrix from Python
self
.
planner
.
setGait
(
gaitMatrix
)
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