Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tutorials:pycram:repl [2021/04/23 12:31] – created jdechtutorials:pycram:repl [2023/02/23 12:33] (current) – [Setup IPython as a PyCRAM Repl] jdech
Line 23: Line 23:
 robot = bullet_world.Object("boxy", "robot", "resources/boxy.urdf", [0, 0, 0], [0, 0, 0, 1]) robot = bullet_world.Object("boxy", "robot", "resources/boxy.urdf", [0, 0, 0], [0, 0, 0, 1])
 floor = bullet_world.Object("floor", "environment", "resources/plane.urdf") floor = bullet_world.Object("floor", "environment", "resources/plane.urdf")
-milk = bullet_world.Object("milk", "milk""resources/milk.obj")+milk = bullet_world.Object("milk", "milk""resources/milk.obj")
 world.robot = robot world.robot = robot
  
Line 44: Line 44:
  
 Now the BulletWorld window should show up and load all objects specified in the setup file. After everything is loaded you are presented with a prompt where you can now type python code as well as use the objects which are initialized in the executed code. Now the BulletWorld window should show up and load all objects specified in the setup file. After everything is loaded you are presented with a prompt where you can now type python code as well as use the objects which are initialized in the executed code.
 +
 +==== Enable autoreload ====
 +To use changes made in the Python file while the Repl is running you need to enable the iPython extension autoreload. This can be done using the iPython startup files, these are files which are always run if iPython is started. 
 +The startup files are located in ~/.ipython/profile_default/startup along with a README file which explains the usage of the startup files. 
 +In this directory create a file called 00-autoreload.ipy and enter the following code to the file.
 +<code>
 +%load_ext autoreload 
 +%autoreload 2
 +</code>
 +
 +The first line loads the extension to iPython and the second line configures autoreload to reload all modules before the typed in code is executed.
 +
 +**Tip** 
 +If you use iPython only as a Repl for PyCRAM you can create a symbolic link in the startup directory which links to your setup.py file.