Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamline odrive setup process #6

Open
uconnamber opened this issue Jun 10, 2022 · 0 comments
Open

Streamline odrive setup process #6

uconnamber opened this issue Jun 10, 2022 · 0 comments

Comments

@uconnamber
Copy link
Contributor

uconnamber commented Jun 10, 2022

Directions:

Currently to run the configuration of the odrive, here is what the process looks like:

  1. run the command odrivetool in the terminal
  2. Sketchily import the old_setup.py module into the odrivetool python session
import sys
sys.path.insert(1, "/home/nvidia/amber_robot/odrive") # 0 is the odrivetool script path, 1 is the place we want to put our package

import setup
  1. Setup the axes by running the following function located in old_setup.py
setup.setup_axes(odrv0, [odrv0.axis0, odrv0.axis1])
  1. Enable the sensorless mode configuration for the odrive
setup.setup_sensorless(odrv0.axis1)

The goal

As of right now, anytime you change a value in the old_setup.py, you have to reimport the module, which is not ideal.

Instead, we want to write a class that instantiates odrive and axis objects and configured the file whenever you run setup.py

  1. Import the odrive python package directly into the setup.py file, alongside any enums that are used
  2. Instantiate the odrive object and acquire all the axes
  3. Take the current functions in old_setup.py and add them as instance methods to the same class
  4. Figure out how to save the configuration using the odrive import

use the following example for reference

https://github.com/AustinOwens/robodog/blob/main/odrive/configs/odrive_hoverboard_config.py

Make sure you DO NOT change any of the configuration itself. Simply just reorganize the code.

Create a new branch streamlined_odrive_config and do all changes there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant