Commit e200c73a authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Encapsulate prologue in a function

* in order to avoid variables in modules.
parent f81b9da5
......@@ -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 --- #
......
......@@ -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();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment