mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-20 22:14:34 +08:00
lift up python tools, restructre other files
This commit is contained in:
+2
-2
@@ -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 +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 |
@@ -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);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user