Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
sot-talos
Commits
e200c73a
Commit
e200c73a
authored
Sep 26, 2018
by
Joseph Mirabel
Browse files
Encapsulate prologue in a function
* in order to avoid variables in modules.
parent
f81b9da5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/dynamic_graph/sot/pyrene/prologue.py
View file @
e200c73a
...
...
@@ -23,16 +23,17 @@ from dynamic_graph.sot.pyrene.robot import Robot
# 1. it does not provide the increment command
# 2. it forwards the robot control to the sot-abstract
# controller.
DeviceTalos
=
PyEntityFactoryClass
(
'DeviceTalos'
)
def
makeRobot
():
DeviceTalos
=
PyEntityFactoryClass
(
'DeviceTalos'
)
# Create the robot using the device.
robot
=
Robot
(
name
=
'robot'
,
device
=
DeviceTalos
(
'PYRENE'
))
# Create the robot using the device.
robot
=
Robot
(
name
=
'robot'
,
device
=
DeviceTalos
(
'PYRENE'
))
robot
.
dynamic
.
com
.
recompute
(
0
)
_com
=
robot
.
dynamic
.
com
.
value
robot
.
device
.
zmp
.
value
=
(
_com
[
0
],
_com
[
1
],
0.
)
robot
.
dynamic
.
com
.
recompute
(
0
)
_com
=
robot
.
dynamic
.
com
.
value
robot
.
device
.
zmp
.
value
=
(
_com
[
0
],
_com
[
1
],
0.
)
__all__
=
[
"
robot
"
]
return
robot
####################################
# --- IMPORTANT --- #
...
...
src/sot-pyrene-controller.cpp
View file @
e200c73a
...
...
@@ -33,7 +33,11 @@ void SoTPyreneController::startupPython()
runPython
(
aof
,
"from dynamic_graph.sot.pyrene.prologue import robot"
,
"from dynamic_graph.sot.pyrene.prologue import makeRobot"
,
*
interpreter_
);
runPython
(
aof
,
"robot = makeRobot ()"
,
*
interpreter_
);
aof
.
close
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment