lift up python tools, restructre other files

This commit is contained in:
Oskar Weigl
2017-10-15 02:03:35 -07:00
parent b9a7a204a6
commit cf1677d5bd
12 changed files with 2 additions and 50 deletions
+2 -2
View File
@@ -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.
-1
View File
@@ -1 +0,0 @@
*.py[cod]

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

-47
View File
@@ -1,47 +0,0 @@
#include <stdio.h>
#include <math.h>
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<POINTS; i++) {
float angle = ((float)i/POINTS + 0.5 + 0.125) * TWOPI ;
if (!(i%2) != !j)
pickupto(cos(angle)*0.8, sin(angle)*0.8);
else {
moveto(cos(angle)*0.8, sin(angle)*0.8);
searchat(cos(angle)*0.8, sin(angle)*0.8);
}
}
moveto(-1,-1);
}