From 95ab4954b33f559925a71825388c89c79c707d29 Mon Sep 17 00:00:00 2001 From: Aurelie Clodic Date: Wed, 22 Oct 2014 18:02:14 +0200 Subject: [PATCH 1/2] [cmake] Synchronize --- cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake b/cmake index c4377b88..a831f540 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit c4377b88bff0dd8abd1f2816fd956e620504eb45 +Subproject commit a831f5403a93b67c6cb8675625e79dd676a565f3 From 10a3a893bd755efb0f3902ab9f2adf88566d2ed3 Mon Sep 17 00:00:00 2001 From: Aurelie Clodic Date: Thu, 23 Oct 2014 09:37:38 +0200 Subject: [PATCH 2/2] Divide walk_romeo in two scripts walk_romeo.py loads and uses romeo urdf full model walk_romeo_small.py loads and uses romeo_small urdf model --- python/CMakeLists.txt | 2 +- python/walk_romeo_small.py | 53 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 python/walk_romeo_small.py diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 6abe4bda..40527fca 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(../cmake/python.cmake) FINDPYTHON() INSTALL( - FILES walk_romeo.py + FILES walk_romeo.py walk_romeo_small.py DESTINATION ${PYTHON_SITELIB}/dynamic_graph/tutorial ) diff --git a/python/walk_romeo_small.py b/python/walk_romeo_small.py new file mode 100644 index 00000000..91e4e7b2 --- /dev/null +++ b/python/walk_romeo_small.py @@ -0,0 +1,53 @@ +# ______________________________________________________________________________ +# ****************************************************************************** +# A simple Herdt walking pattern generator for Romeo. +# ______________________________________________________________________________ +# ****************************************************************************** + +# from dynamic_graph.sot.romeo.sot_romeo_controller import * +# Create the robot. +from dynamic_graph.sot.core import * +from dynamic_graph.sot.dynamics import * +from dynamic_graph.sot.romeo.robot import * +robot = Robot('romeo_small', device=RobotSimu('romeo_small')) + +from dynamic_graph import plug +plug(robot.device.state, robot.dynamic.position) + +# Binds with ros, export joint_state. +from dynamic_graph.ros import * +ros = Ros(robot) + +# Create a solver. +from dynamic_graph.sot.application.velocity.precomputed_tasks import initialize +solver = initialize ( robot ) + +from dynamic_graph.sot.pattern_generator.walking import CreateEverythingForPG , walkFewSteps, walkAndrei +CreateEverythingForPG ( robot , solver ) +# walkFewSteps ( robot ) +walkAndrei( robot ) + +#------------------------------------------------------------------------------- +#----- MAIN LOOP --------------------------------------------------------------- +#------------------------------------------------------------------------------- + +from dynamic_graph.sot.core.utils.thread_interruptible_loop import loopInThread,loopShortcuts +dt=5e-3 +@loopInThread +def inc(): + robot.device.increment(dt) + +runner=inc() +[go,stop,next,n]=loopShortcuts(runner) + +# --- HERDT PG AND START ------------------------------------------------------- +# Set the algorithm generating the ZMP reference trajectory to Herdt's one. +# pg.startHerdt(False) + +print('You can now modifiy the speed of the robot by setting pg.pg.velocitydes') +print('example : robot.pg.velocitydes.value =(0.1,0.0,0.0)\n') + +robot.pg.velocitydes.value =(0.1,0.0,0.0) + +go() +