Skip to content

Why the loaders? #5

@gabrielebndn

Description

@gabrielebndn

In robots_loader.py there are many utility methods to load a RobotWrapper containing one of the robots of this repository.

Is it really needed? I do not like these special methods. There are many reasons why I say this:

  1. First of all, they are based on RobotWrapper, and we should not encourage the use of RobotWrapper

  2. For most robots, they amount to little more than a call to RobotWrapper.BuildFromURDF. Pinocchio methods are already convenient enough to load robots.

  3. They make the code employing them less transparent

  4. They introduce a dependency to Pinocchio

  5. They are not general

  6. They are not flexible.

    • file path is hardcoded
    • If one wants to use a slightly modified URDF, you cannot by using these methods, unless you modify the installed files.
    • If you are using one of those methods and you find you need to modify the URDF but you do not want to do change the installed files, the only option is to scrap them and rewrite the code so that they are not used. Better not to give this option entirely! You should know were your URDF files are and what's in them
    • What if a robot is removed from this repo? Then the Python code will be removed too. This will break the code using it, and this is really unnecessary.
  7. They introduce yet-another-way of doing the same thing, i. e. loading a URDF model. Do we really need another way? This is not really desirable, as goes, for instance, the Zen of Python : There should be one-- and preferably only one --obvious way to do it. We already have

    1. native Pinocchio methods
    2. shortcuts buildModelsFromUrdf and createDatas(models)
    3. the RobotWrapper interface
  8. They make the robots contained in this repo sort of "special", because they have a special way to be loaded

  9. They are confusing to newcomers, because they hide too much detail and then they will not know how to load a generic robot or a slightly modified one (I can call some newcomers to testify)

Summarizing, I think this loader functions are a bad idea and should be removed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions