Skip to content

Make Parallax_UsbPropeller and Pololu_Maestro to use the same base API and remove convenience functions. #136

@heevasti

Description

@heevasti

Description

The instruments Parallax USB Propeller and Pololu (Micro) Maestro are both serial-to-USB based servo controllers. The drivers have been developed separately though, without considering the possible overlap in functionality. The resulting APIs are quite the same but with some calls with equal functionality with slightly different interface or use-case. Earlier, the Pololu Maestro had been modified somewhat to be more similar with Parallax USB Propeller driver. Some functions were then copied and renamed to match the Parallax ones and the old ones left with deprecation warnings. Some other functions were not considered, and a few more functions that remain are most likely hardware|firmware-specific and cannot be generalized anyhow.

It would be now time to unify the driver base and clean-up the APIs. Note also that this could be done either before or after the ticket #135 but preferably after.

One solution would be a creation of a virtual instrument driver 'servo/control.py' in 'instruments' or 'servo_control.py' in 'utils'. This could be a Protocol or ABC or simple base class, but preferably one of the two former. Consider well the Protocol|ABC class which calls you want to define for both and with which exact interface and functionality. The API can be broken if necessary to make the functions more sensible and generic - the current function names are derived from specific use-cases in Diamondos.

If no base class | Protocol | ABC is desired, just line-out the function names on each driver to be with matching names and functionalities and drop deprecation warnings and respective functions. Also drop 'convenience functions'. Update unit-tests accordingly.

Modules to be created

Optionally:

  • instruments/servo/control.py or utils/servo_control.py

Modules to be modified

  • instruments.parallax (also __init__.py)
  • instruments.pololu (also __init__.py)

Tests to be created/updated

Update unit-tests accordingly.

Documentation to be updated

Update CHANGELOG.md.

Hardware

Could be useful test with the HW as well of Protocol | ABC class is used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QMI driverAddition or modification on a QMI driver

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions