Warning
This page is located in archive. Go to the latest version of this course pages.

Differences

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

Link to this comparison view

Next revision
Previous revision
courses:b4m36uir:tutorials:vrep_tut [2018/09/06 14:06]
127.0.0.1 external edit
courses:b4m36uir:tutorials:vrep_tut [2018/10/01 01:34]
cizekpe6
Line 30: Line 30:
 === Labs Python Scripts ===  === Labs Python Scripts === 
  
-The python scripts for controlling the robot in V-REP used in during the labs are for python version ​2.7. Besides, they rely on python libraries that help to solve the lab tasks. The required libraries are already installed on the lab computers, but they can be install using, e.g., +The python scripts for controlling the robot in V-REP used in during the labs are for python version ​3.5. Besides, they rely on python libraries that help to solve the lab tasks. The required libraries are already installed on the lab computers, but they can be install using, e.g., 
 <​code>​ <​code>​
-sudo apt install python-numpy python-scipy python-matplotlib ​ipython ipython-notebook ​python-pandas python-sympy python-nose+sudo apt install python-numpy python-scipy python-matplotlib python-pandas python-sympy python-nose
 </​code>​ </​code>​
- 
- 
-Further, the scripts for controlling the hexapod rely on the provided [[courses:​b4m36uir:​labs:​resources|hardware abstraction layer]], in particular for V-REP {{:​courses:​b4m36uir:​labs:​hexapod_vrep.zip|hexapod_vrep}}. The libraries must be accessible to your python scripts, and thus you can added (or symlink) them to the working directory. However, it is more easier to setup your working environment and the library to the search path. This can be done, e.g., in .bashrc. For example, let suppose the ''​hexapod_vrep''​ is in ''​$HOME/​uir/''​. Then, you can added it to search path by 
- 
-<​code>​ 
-export PYTHONPATH=$PYHTONPATH:​$HOME/​uir:​$HOME/​uir/​hexapod_vrep/​vrep_api 
-</​code>​ 
- 
-Besides, the scripts use python2.7, while the default version is python 3 in ubuntu 16.04. Therefore, you can use alias to python e.g., 
- 
-<​code>​ 
-alias python=python2.7 
-</​code>​ 
- 
-and specify the python interpret in the scripts files by the first line as 
- 
-<​code>​ 
-#​!/​usr/​bin/​env python 
-</​code>​ 
- 
-Notice, using ''​env''​ is platform independent as it can be in various directories. 
- 
-Finally, you can set the execution flag of the scripts using, e.g.,  <​code>​chmod +x lab01.py</​code>​ and enjoy a directly executable scripts. 
-So, your ''​.bashrc''​ can contain some thing like 
-<​code>​ 
-alias python=python2.7 
-export PYTHONPATH=$HOME/​uir:​$HOME/​uir/​hexapod_vrep/​vrep_api 
-export PATH=$PATH:​$HOME/​uir/​V-REP_PRO_EDU_V3_4_0_Linux 
-</​code> ​ 
- 
  
courses/b4m36uir/tutorials/vrep_tut.txt · Last modified: 2018/10/01 01:34 by cizekpe6