mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-20 22:55:00 +08:00
rename odrvtool to odrivetool
This commit is contained in:
@@ -9,13 +9,13 @@ Please add a note of your changes below this heading if you make a Pull Request.
|
||||
### Changed
|
||||
* The DFU script now verifies the flash after writing
|
||||
* Refactor python tools
|
||||
* The scripts `explore_odrive.py`, `liveplotter.py`, `drv_status.py` and `rate_test.py` have been merged into one single `odrvtool` script. Running this script without any arguments provides the shell that `explore_odrive.py` used to provide.
|
||||
* The command line options of `odrvtool` have changed compared to the original `explore_odrive.py`. See `odrvtool --help` for more details.
|
||||
* `odrvtool` (previously `explore_odrive.py`) now supports controlling multiple ODrives concurrently (`odrv0`, `odrv1`, ...)
|
||||
* No need to restart the `odrvtool` shell when devices get disconnected and reconnected
|
||||
* The scripts `explore_odrive.py`, `liveplotter.py`, `drv_status.py` and `rate_test.py` have been merged into one single `odrivetool` script. Running this script without any arguments provides the shell that `explore_odrive.py` used to provide.
|
||||
* The command line options of `odrivetool` have changed compared to the original `explore_odrive.py`. See `odrivetool --help` for more details.
|
||||
* `odrivetool` (previously `explore_odrive.py`) now supports controlling multiple ODrives concurrently (`odrv0`, `odrv1`, ...)
|
||||
* No need to restart the `odrivetool` shell when devices get disconnected and reconnected
|
||||
* ODrive accesses from within python tools are now thread-safe. That means you can read from the same remote property from multiple threads concurrently.
|
||||
* The liveplotter (`odrvtool liveplotter`, formerly `liveplotter.py`) does no longer steal focus and closes as expected
|
||||
* (experimental: start liveplotter from `odrvtool` shell by typing `start_liveplotter(lambda: odrv0.motor0.encoder.encoder_state)`)
|
||||
* The liveplotter (`odrivetool liveplotter`, formerly `liveplotter.py`) does no longer steal focus and closes as expected
|
||||
* (experimental: start liveplotter from `odrivetool` shell by typing `start_liveplotter(lambda: odrv0.motor0.encoder.encoder_state)`)
|
||||
|
||||
### Fixed
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ gdb: all
|
||||
arm-none-eabi-gdb $(FIRMWARE) -x openocd.gdbinit
|
||||
|
||||
dfu: all
|
||||
../tools/odrvtool $(if $(value SERIAL_NUMBER),--serial-number $(SERIAL_NUMBER),) dfu $(FIRMWARE_HEX)
|
||||
../tools/odrivetool $(if $(value SERIAL_NUMBER),--serial-number $(SERIAL_NUMBER),) dfu $(FIRMWARE_HEX)
|
||||
|
||||
bmp: all
|
||||
arm-none-eabi-gdb --ex 'target extended-remote /dev/stlink' \
|
||||
|
||||
+6
-6
@@ -139,7 +139,7 @@ For working with the ODrive code you don't need an IDE, but the open-source IDE
|
||||
## Communicating over USB or UART
|
||||
Warning: If testing USB or UART communication for the first time it is recommend that your motors are free to spin continuously and are not connected to a drivetrain with limited travel.
|
||||
### From Linux/Windows/macOS
|
||||
There are two example python scripts to help you get started with controlling the ODrive using python. One will drop you into an interactive shell to query settings, parameters, and variables, and let you send setpoints manually ([tools/odrvtool](../tools/odrvtool)). The other is a demo application to show you how to control the ODrive programmatically ([tools/odrive_demo.py](../tools/odrive_demo.py)). Below follows a step-by-step guide on how to run these.
|
||||
There are two example python scripts to help you get started with controlling the ODrive using python. One will drop you into an interactive shell to query settings, parameters, and variables, and let you send setpoints manually ([tools/odrivetool](../tools/odrivetool)). The other is a demo application to show you how to control the ODrive programmatically ([tools/odrive_demo.py](../tools/odrive_demo.py)). Below follows a step-by-step guide on how to run these.
|
||||
|
||||
|
||||
* __Windows__: It is recommended to use a Unix style command prompt, such as Git Bash that comes with [Git for windows](https://git-scm.com/download/win).
|
||||
@@ -165,9 +165,9 @@ pip install pyusb pyserial
|
||||
5. __Windows__: Use the [Zadig](http://zadig.akeo.ie/) utility to set ODrive (not STLink!) driver to libusb-win32.
|
||||
* If 'Odrive version 3.x' is not in the list of devices upon opening Zadig, check 'List All Devices' from the options menu. With the Odrive selected in the device list choose 'libusb-win32' from the target driver list and select the large 'install driver' button.
|
||||
6. Open the bash prompt in the `ODrive/tools/` folder.
|
||||
7. Run `python3 odrive_demo.py` or `python3 odrvtool`.
|
||||
7. Run `python3 odrive_demo.py` or `python3 odrivetool`.
|
||||
- `odrive_demo.py` is a very simple script which will make motor 0 turn back and forth. Use this as an example if you want to control the ODrive yourself programatically.
|
||||
- `odrvtool` drops you into an interactive python shell when started without any arguments. There you can explore and edit the parameters that are available on your device. For instance `odrv0.motor0.pos_setpoint = 10000` makes motor0 move to position 10000. To connect over serial instead of USB run `./tools/odrvtool --path serial`. Run `./tools/odrvtool --help` to see what else you can do with the script.
|
||||
- `odrivetool` drops you into an interactive python shell when started without any arguments. There you can explore and edit the parameters that are available on your device. For instance `odrv0.motor0.pos_setpoint = 10000` makes motor0 move to position 10000. To connect over serial instead of USB run `./tools/odrivetool --path serial`. Run `./tools/odrivetool --help` to see what else you can do with the script.
|
||||
|
||||
### From Arduino
|
||||
[See ODrive Arduino Library](https://github.com/madcowswe/ODriveArduino)
|
||||
@@ -180,7 +180,7 @@ See the [protocol specification](protocol.md) or the [legacy protocol specificat
|
||||
The majority of the important parameters you would want to set after flashing the ODrive with firmware are configurable over the USB communication interface. These include some mandatory parameters that you must set for correct operation, as well as tuning and optional parameters.
|
||||
To start the configuration session:
|
||||
|
||||
* Launch `./tools/odrvtool`. This will give you a command prompt where you can modify using simple assignments.
|
||||
* Launch `./tools/odrivetool`. This will give you a command prompt where you can modify using simple assignments.
|
||||
* Configure parameters of the `odrv0.[...].config` objects.
|
||||
* For example to adjust the position gain: `odrv0.motor0.config.pos_gain = 30` <kbd>Enter</kbd>.
|
||||
* The complete list of configurable parameters is:
|
||||
@@ -253,7 +253,7 @@ If you have an encoder with an index (Z) signal, you may avoid having to do the
|
||||
* All the parameters we will be modifying are in the motor structs at the top of [MotorControl/low_level.c](MotorControl/low_level.c).
|
||||
* Set `.encoder.use_index = true` and `.encoder.calibrated = false`.
|
||||
* Flash this configuration, and let the motor scan for the index pulse and then complete the encoder calibration.
|
||||
* Run `odrvtool`, check [Communicating over USB or UART](#communicating-over-usb-or-uart) for instructions on how to do that.
|
||||
* Run `odrivetool`, check [Communicating over USB or UART](#communicating-over-usb-or-uart) for instructions on how to do that.
|
||||
* Enter the following to print out the calibration parameters (substitute the motor number you are calibrating for `<NUM>`):
|
||||
* `odrv0.motor<NUM>.encoder.encoder_offset` - This should print a number, like -326 or 1364.
|
||||
* `odrv0.motor<NUM>.encoder.motor_dir` - This should print 1 or -1.
|
||||
@@ -267,7 +267,7 @@ If you have an encoder with an index (Z) signal, you may avoid having to do the
|
||||
|
||||
<br><br>
|
||||
## Checking for error codes
|
||||
`odrvtool` can also be used to check error codes when your odrive is not working as expected. For example `odrv0.motor0.error` will list the error code associated with motor 0.
|
||||
`odrivetool` can also be used to check error codes when your odrive is not working as expected. For example `odrv0.motor0.error` will list the error code associated with motor 0.
|
||||
<br><br>
|
||||
The error nummber corresponds to the following:
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ print = functools.partial(print, flush=True)
|
||||
|
||||
## Parse arguments ##
|
||||
parser = argparse.ArgumentParser(description='ODrive command line utility\n'
|
||||
'Running this tool without any arguments is equivalent to running `odrvtool shell`\n',
|
||||
'Running this tool without any arguments is equivalent to running `odrivetool shell`\n',
|
||||
formatter_class=argparse.RawTextHelpFormatter)
|
||||
|
||||
# Subcommands
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ if creating_package:
|
||||
setup(
|
||||
name = 'odrive',
|
||||
packages = ['odrive'], # this must be the same as the name above
|
||||
scripts = ['odrvtool', 'odrive_demo.py'],
|
||||
scripts = ['odrivetool', 'odrive_demo.py'],
|
||||
version = version,
|
||||
description = 'Control utilities for the ODrive high performance motor controller',
|
||||
author = 'Oskar Weigl',
|
||||
|
||||
Reference in New Issue
Block a user