FlexSEA Wiki

A WEARABLE ROBOTICS TOOLKIT

User Tools

Site Tools


pythonscripts2

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
pythonscripts2 [2019/01/23 17:54]
flabelle
pythonscripts2 [2020/01/20 20:03]
rqurashi
Line 1: Line 1:
 ====== Python Interface 2.0 ====== ====== Python Interface 2.0 ======
  
-This document describes Python 3 scripts that demonstrate how to control the FlexSEA-Rigid. These scripts are accompanied by and are dependent upon C based libraries for both Windows (.dll) and Rasbian(.so). ​A preliminary version of the C library ​for Ubuntu ​operating systems can be made available upon request.+This document describes ​the Python 3 scripts that demonstrate how to control the Actuator Package. These scripts are accompanied by and are dependent upon C based libraries for both Windows (.dll) and Unix (.so). ​Pre-compiled libraries are provided ​for Windows 32 and 64 bits, RaspberryPi and Linux (Ubuntu).
  
-These scripts are written in Python 3 and have been tested on Python version 3.6 32 bit and 64 bit (using Windows 10 Pro), as well as 32 bit Rasbian on a Raspberry Pi 3.+These scripts are written in Python 3 and have been tested on Python version ​3.7.3 and 3.6 32 bit and 64 bit (using Windows 10 Pro), as well as 32 bit Rasbian on a Raspberry Pi 3 and Ubuntu 18 64 bits. They do not seem to work with Python 3.8.1
  
-The code is available at [[https://​github.com/​DephyInc/​Actuator-Package|Actuator Package]]. This git repository contains the API, DLLs, and example scripts. The functions are documented in pyFlexsea.py. Take a look at the Python demo scripts to see examples of the interface usage, and look [[python_interface2_doc|here]] for an overview of the API functions. Additional documentation on the fx_plan_stack API can be found [[fx_plan_stack|here]].+The code is available at [[https://​github.com/​DephyInc/​Actuator-Package|Actuator Package]]. This git repository contains the API, DLLs, and example scripts. The functions are documented in pyFlexsea.py. Additional documentation on the fx_plan_stack API can be found [[build_fx_plan|here]].
  
 =====Converting from Python interface 1.0===== =====Converting from Python interface 1.0=====
Line 14: Line 14:
 If you have not already setup up your Actuator Package, please read the [[dephyactpack#​Quick Start Guide|ActPack'​s quick start guide]]. ​ If you have not already setup up your Actuator Package, please read the [[dephyactpack#​Quick Start Guide|ActPack'​s quick start guide]]. ​
  
-Ready to get started? Try running a demo script:+Ready to get started? Try running a [[demodescriptions|demo script]]:
  
-  - Make sure your device has recent ​enough ​firmware ​(later ​than August 2018)+  - Make sure your device has recent firmware 
 +    - At a minimum it has to be newer than August 2018 
 +    - We recommend using the latest from the Release page
   - Clone the repo :<​code>​ git clone --recursive https://​github.com/​DephyInc/​Actuator-Package.git </​code>​   - Clone the repo :<​code>​ git clone --recursive https://​github.com/​DephyInc/​Actuator-Package.git </​code>​
-  - Copy the appropriate lib into the correct build folder. All prebuilt libs are found under the release folder. To get a specific version, it may be necessary to [[build_fx_plan| build the fx plan library from scratch]]. The library placement is system specific: +  - Copy ''​Actuator-Package/Python/flexseapython/​com_template.txt'' ​to a file named ''​Actuator-Package/Python/flexseapython/com.txt''​ 
-    * For Windows, copy release/win/libfx_plan_stack.dll to fx_plan_stack/build/win. Ensure the redistributable DLLs (libgcc_s_dw2.dll,​ libstdc++-6.dll,​ and libwinpthread-1.dll) are in the Python ​directory. +    ​- The first line is the baud rate. If connecting over USB or Bluetooth you can ignore the baud rateotherwise please enter your desired rate
-    * For Rasppberry Pi, copy release/raspi/libfx_plan_stack.so to fx_plan_stack/​build/​unix +    - The second line is the port name (ex.: COM5 or /​dev/​ttyACM0) 
-    ​* For Linuxcopy release/​linux/​libfx_plan_stack.so to fx_plan_stack/​build/​unix ​ -- (sorry, not released yet!) +    - If connecting to more than one device ​you can add additional port names each on a new line
-  - In a text editor: +
-    - Open flexseapython/​com.txt and configure ​the correct ports (ex.: COM5 or /​dev/​ttyACM0) +
-    - If you have more than one device, use one line per COM port+
   - Plug in and turn on the device. If you are using Windows make sure that you have the [[stm32driver|STM32 Virtual Com Port Driver]] installed.   - Plug in and turn on the device. If you are using Windows make sure that you have the [[stm32driver|STM32 Virtual Com Port Driver]] installed.
-  - From a cmd window or terminal, run the fxMain.py script in python+  - From a cmd window or terminal, run the Actuator-Package/​Python/​fxMain.py script in Python <​code>​python ​fxMain.py</​code>​ 
 +  - Enter the experiment number. Be careful, most of them will make the motor move! 
 + 
 +{{ :​pythonscript.png |}} 
 +=====Matplotlib===== 
 + 
 +Some of the scripts (High-speed test, Impedance, etc.) include plotting. By default we use the WebAgg engine to show the plots in a browser. 
 +The first time you use the scripts you will need to install matplotlib and tornado (via pip).
  
 =====Notes===== =====Notes=====
pythonscripts2.txt · Last modified: 2020/01/20 20:03 by rqurashi