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

Scalars or lists for motor constants, gear ratios and max currents #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

paLeziart
Copy link
Collaborator

Description

Right now, motor constants, gear ratios and max currents are scalars in the yaml configuration file for ODRI control interface. For instance, for Solo-12 it could be:

        motor_constants: 0.025
        gear_ratios: 9.
        max_currents: 8.

Internally, these quantities are already handled as vectors, the scalar value simply fills the whole vector.

With this PR, the motor constants, gear ratios and max currents can be specified per motor, which makes possible the use of robots with more complex designs, like having a different gear ratio for the knee joints compared the HAA and HFE.

You could have for instance:

        motor_constants: 0.025
        gear_ratios: [9., 9., 12., 9., 9., 12., 9., 9., 12., 9., 9., 12.]
        max_currents: [8., 8., 10., 8., 8., 10., 8., 8., 10., 8., 8., 10.]

The detection of the data type is automatic, so the behavior remains the same for people that do not use this new feature.

How I Tested

I compiled the code and launched it several times on our Solo-12 with debug outputs in the code to check that the data in the configuration file was properly detected and loaded.

I fulfilled the following requirements

  • All new code is formatted according to our style guide (for C++ run clang-format, for Python, run flake8 and fix all warnings).
  • All new functions/classes are documented and existing documentation is updated according to changes.
  • No commented code from testing/debugging is kept (unless there is a good reason to keep it).

For the .clang-format file, I am not sure which one is used for the style of this repository. I tried to keep the same style than the existing code.

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

Successfully merging this pull request may close these issues.

1 participant