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?
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 thecls
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