{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Populating the interactive namespace from numpy and matplotlib\n" ] } ], "source": [ "from poppy.creatures import PoppyHumanoid\n", "\n", "poppy = PoppyHumanoid(simulator='vrep',scene='poppy_humanoid_add_force.ttt')\n", "\n", "%pylab inline\n", "import time" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [], "source": [ "t0 = time.time()\n", "t_simu = poppy.current_simulation_time\n", "while time.time()-t0 <10:\n", " if poppy.current_simulation_time - t_simu < 1 :\n", " time.sleep(0.01)\n", " else :\n", " poppy.set_VREP_force([7,0,0],'l_forearm_respondable')\n", " t_simu = poppy.current_simulation_time\n", " while poppy.current_simulation_time - t_simu < 0.025:\n", " time.sleep(0.01)\n", " poppy.set_VREP_force([0,0,0],'l_forearm_respondable') \n", " " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.9" } }, "nbformat": 4, "nbformat_minor": 0 }