From cf1677d5bda7f39c2f51c26246fe2bd515251331 Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Sun, 15 Oct 2017 02:03:02 -0700 Subject: [PATCH] lift up python tools, restructre other files --- Firmware/README.md | 4 +- Firmware/tools/.gitignore | 1 - .../motor_analysis}/350kvTP.PNG | Bin .../motor_analysis}/350kvVelli.PNG | Bin .../motor_analysis}/VelliPlot.m | 0 .../numeric_path_opt}/Main.m | 0 .../numeric_path_opt}/predictionmatrices.m | 0 {Firmware/tools => tools}/odrive/__init__.py | 0 {Firmware/tools => tools}/odrive/usbbulk.py | 0 {Firmware/tools => tools}/odrive/util.py | 0 .../test_communication.py | 0 various/path.c | 47 ------------------ 12 files changed, 2 insertions(+), 50 deletions(-) delete mode 100644 Firmware/tools/.gitignore rename {motor_analysis => analysis/motor_analysis}/350kvTP.PNG (100%) rename {motor_analysis => analysis/motor_analysis}/350kvVelli.PNG (100%) rename {motor_analysis => analysis/motor_analysis}/VelliPlot.m (100%) rename {numeric_path_opt => analysis/numeric_path_opt}/Main.m (100%) rename {numeric_path_opt => analysis/numeric_path_opt}/predictionmatrices.m (100%) rename {Firmware/tools => tools}/odrive/__init__.py (100%) rename {Firmware/tools => tools}/odrive/usbbulk.py (100%) rename {Firmware/tools => tools}/odrive/util.py (100%) rename Firmware/tools/test_bulk.py => tools/test_communication.py (100%) delete mode 100644 various/path.c diff --git a/Firmware/README.md b/Firmware/README.md index a1024e5c..5498b4b5 100644 --- a/Firmware/README.md +++ b/Firmware/README.md @@ -99,14 +99,14 @@ If you prefer to debug from eclipse, see [Setting up Eclipse development environ ## Communicating over USB There is currently a very primitive method to read/write configuration, commands and errors from the ODrive over the USB. -Please use the `ODriveFirmware/tools/test_bulk.py` python script for this. It is written for Python 3. +Please use the `tools/test_communication.py` python script for this. It is written for Python 3. Setup instructions as follows: * Install PyUSB (pip install --pre pysusb) * Plug in the STLink or another power source to power the ODrive board * Plug in a separate USB cable into the microUSB connector on ODrive * On Windows, use the [Zadig](http://zadig.akeo.ie/) utility to set ODrive (not STLink!) driver to libusb -* Run test_bulk.py +* Run `tools/test_communication.py` ### Command set The most accurate way to understand the commands is to read [the code](https://github.com/madcowswe/ODriveFirmware/blob/f19f1b78de4bd917284ff95bc61ca616ca9bacc4/MotorControl/low_level.c#L353) that parses the commands. diff --git a/Firmware/tools/.gitignore b/Firmware/tools/.gitignore deleted file mode 100644 index 9886e1ed..00000000 --- a/Firmware/tools/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.py[cod] diff --git a/motor_analysis/350kvTP.PNG b/analysis/motor_analysis/350kvTP.PNG similarity index 100% rename from motor_analysis/350kvTP.PNG rename to analysis/motor_analysis/350kvTP.PNG diff --git a/motor_analysis/350kvVelli.PNG b/analysis/motor_analysis/350kvVelli.PNG similarity index 100% rename from motor_analysis/350kvVelli.PNG rename to analysis/motor_analysis/350kvVelli.PNG diff --git a/motor_analysis/VelliPlot.m b/analysis/motor_analysis/VelliPlot.m similarity index 100% rename from motor_analysis/VelliPlot.m rename to analysis/motor_analysis/VelliPlot.m diff --git a/numeric_path_opt/Main.m b/analysis/numeric_path_opt/Main.m similarity index 100% rename from numeric_path_opt/Main.m rename to analysis/numeric_path_opt/Main.m diff --git a/numeric_path_opt/predictionmatrices.m b/analysis/numeric_path_opt/predictionmatrices.m similarity index 100% rename from numeric_path_opt/predictionmatrices.m rename to analysis/numeric_path_opt/predictionmatrices.m diff --git a/Firmware/tools/odrive/__init__.py b/tools/odrive/__init__.py similarity index 100% rename from Firmware/tools/odrive/__init__.py rename to tools/odrive/__init__.py diff --git a/Firmware/tools/odrive/usbbulk.py b/tools/odrive/usbbulk.py similarity index 100% rename from Firmware/tools/odrive/usbbulk.py rename to tools/odrive/usbbulk.py diff --git a/Firmware/tools/odrive/util.py b/tools/odrive/util.py similarity index 100% rename from Firmware/tools/odrive/util.py rename to tools/odrive/util.py diff --git a/Firmware/tools/test_bulk.py b/tools/test_communication.py similarity index 100% rename from Firmware/tools/test_bulk.py rename to tools/test_communication.py diff --git a/various/path.c b/various/path.c deleted file mode 100644 index 341e5c4b..00000000 --- a/various/path.c +++ /dev/null @@ -1,47 +0,0 @@ -#include - -#include - -void output(float x, float y, float str, float param) { - printf("{ %05.1ff, %05.1ff, %1.1ff, %06.1ff },\n", (x+1)*75, (y+1)*75, str, param); -} - -void searchat(float x, float y) { - output(x, y, 0.4, 500); - //output(x+0.02, y, 0.4, 1000); - //output(x, y+0.02, 0.4, 1000); - //output(x-0.02, y, 0.4, 1000); - //output(x, y-0.02, 0.4, 1000); -} - -void pickupto(float x, float y) { - output(x, y, 0.4, 0); - //output(x, y, 0.4, 1000); - output(x, y, 0, 1000); -} - -void moveto(float x, float y) { - output(x, y, 0, 0); -} - -#define POINTS 15 -#define TWOPI (3.1415*2.0) - -int main(int argc, char** argv) { - moveto(-1,-1); - - for (int j=0; j<2; j++) - for (int i=0; i