I've been using urdf2webots to port some humanoid robots to Webots (e.g. https://github.com/roboticslab-uc3m/teo-webots-models lacks textures and dynamics but serves its purpose). While porting PAL Robotics REEM-C robot, I ran into TypeError: 'Map' object does not support indexing upon passing through visual.material.specular = colorVector2Instance(data.material.effect.specular). Here are the robot model repositories:
Hello!
I've been using
urdf2webots
to port some humanoid robots to Webots (e.g. https://github.com/roboticslab-uc3m/teo-webots-models lacks textures and dynamics but serves its purpose). While porting PAL Robotics REEM-C robot, I ran intoTypeError: 'Map' object does not support indexing
upon passing throughvisual.material.specular = colorVector2Instance(data.material.effect.specular)
. Here are the robot model repositories:It turns out a Python
tuple
is expected; however, https://pycollada.readthedocs.io/en/latest/reference/generated/collada.material.Effect.html#collada.material.Effect as documented can alternatively return an instance of collada.material.Map, which is the case for this robot. The shameless (and textureless) hack at https://github.com/cyberbotics/urdf2webots/blob/master/urdf2webots/parserURDF.py#L553 (perma) was the following:I understand the expected behavior would be to treat the different situations where https://pycollada.readthedocs.io/en/latest/reference/generated/collada.material.Effect.html#collada.material.Effect returns a
collada.material.Map
(which is not restricted tospecular
), and/or at least prevent theTypeError
. Thank you!