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

Use of specific classname instead of cls when loading from xml #13

Open
fishbotics opened this issue Aug 14, 2020 · 0 comments
Open

Use of specific classname instead of cls when loading from xml #13

fishbotics opened this issue Aug 14, 2020 · 0 comments

Comments

@fishbotics
Copy link

Hi,

I'm using urdfpy for some deep learning tasks and wrote a hacky extension that uses Pytorch tensors instead of numpy arrays. In order to do this, I extended the classes in urdfpy and only replaced the relevant methods. While doing that, I noticed that a lot of the classes have a _from_xml classmethod, but at the end of the method, they end up instantiating with the specific class instead of the cls variable. I ended up having to override all of these methods so that I could instantiate my subclass.

I'm happy to make a PR to change this, but I wanted to know: is there any reason why it's written the way it currently is?

As an example: https://github.com/mmatl/urdfpy/blob/master/urdfpy/urdf.py#L1145

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

No branches or pull requests

1 participant