Using a simulated robot with V-REP¶
Connecting to V-REP¶
As it is often easier to work in simulation rather than with the real robot, pypot has been linked with the V-REP simulator. It is described as the “Swiss army knife among robot simulators” and is a very powerful tool to quickly (re)create robotics setup. As presenting V-REP is way beyond the scope of this tutorial, we will here assume that you are already familiar with this tool. Otherwise, you should directly refer to V-REP documentation.
Details about how to connect pypot and V-REP can be found in this post.
The connection between pypot and V-REP was designed to let you seamlessly switch from your real robot to the simulated one. It is based on V-REP’s remote API.
This IO can be used to:
- connect to the V-REP server :
- load a scene :
- start/stop/restart a simulation :
- pause/resume the simulation :
- get/set a motor position :
- get an object position/orienation :
Switch between the simulation and the real robot in a single line of code¶
As stated above, the bridge between V-REP and pypot has been designed to let you easily switch from the robot to the simulated version. In most case, you should only have to change the way you instantiate your robot:
# Working with the real robot import pypot.robot poppy = pypot.robot.from_config(config) poppy.walk.start()
# Working with the simulated version import pypot.vrep poppy = pypot.vrep.from_vrep(config, vrep_host, vrep_port, vrep_scene) poppy.walk.start()
In particular, the walking primitive should work exactly the same way in both cases without needing to change anything.
Not all dynamixel registers have their V-REP equivalent. For the moment, only the control of the position is used. More advanced features can be easily added thanks to the controller abstraction (see section Extending pypot).