In [2]: PR2()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Input In [2], in <cell line: 1>()
----> 1 PR2()
File ~/python/scikit-robot/skrobot/models/pr2.py:18, in PR2.__init__(self, use_tight_joint_limit)
17 def __init__(self, use_tight_joint_limit=True):
---> 18 super(PR2, self).__init__()
20 self.rarm_end_coords = CascadedCoords(
21 parent=self.r_gripper_tool_frame,
22 name='rarm_end_coords')
23 self.larm_end_coords = CascadedCoords(
24 parent=self.l_gripper_tool_frame,
25 name='larm_end_coords')
File ~/python/scikit-robot/skrobot/models/urdf.py:18, in RobotModelFromURDF.__init__(self, urdf, urdf_file)
16 self.load_urdf_file(file_obj=urdf_file)
17 else:
---> 18 self.load_urdf_file(file_obj=self.default_urdf_path)
File ~/python/scikit-robot/skrobot/model/robot_model.py:1734, in RobotModel.load_urdf_file(self, file_obj)
1732 else:
1733 self.urdf_path = getattr(file_obj, 'name', None)
-> 1734 self.urdf_robot_model = URDF.load(file_obj=file_obj)
1735 root_link = self.urdf_robot_model.base_link
1737 links = []
File ~/python/scikit-robot/skrobot/utils/urdf.py:3092, in URDF.load(file_obj)
3089 path, _ = os.path.split(file_obj.name)
3091 node = tree.getroot()
-> 3092 return URDF._from_xml(node, path)
File ~/python/scikit-robot/skrobot/utils/urdf.py:3201, in URDF._from_xml(cls, node, path)
3198 @classmethod
3199 def _from_xml(cls, node, path):
3200 valid_tags = set(['joint', 'link', 'transmission', 'material'])
-> 3201 kwargs = cls._parse(node, path)
3203 extra_xml_node = ET.Element('extra')
3204 for child in node:
File ~/python/scikit-robot/skrobot/utils/urdf.py:365, in URDFType._parse(cls, node, path)
345 """Parse all elements and attributes in the _ELEMENTS and _ATTRIBS
346
347 Parse all elements and attributes in the _ELEMENTS and _ATTRIBS
(...)
362 and elements in the class arrays.
363 """
364 kwargs = cls._parse_simple_attribs(node)
--> 365 kwargs.update(cls._parse_simple_elements(node, path))
366 return kwargs
File ~/python/scikit-robot/skrobot/utils/urdf.py:339, in URDFType._parse_simple_elements(cls, node, path)
332 if len(vs) == 0 and r:
333 raise ValueError(
334 'Missing required subelement(s) of type {} when '
335 'parsing an object of type {}'.format(
336 t.__name__, cls.__name__
337 )
338 )
--> 339 v = [t._from_xml(n, path) for n in vs]
340 kwargs[a] = v
341 return kwargs
File ~/python/scikit-robot/skrobot/utils/urdf.py:339, in <listcomp>(.0)
332 if len(vs) == 0 and r:
333 raise ValueError(
334 'Missing required subelement(s) of type {} when '
335 'parsing an object of type {}'.format(
336 t.__name__, cls.__name__
337 )
338 )
--> 339 v = [t._from_xml(n, path) for n in vs]
340 kwargs[a] = v
341 return kwargs
File ~/python/scikit-robot/skrobot/utils/urdf.py:385, in URDFType._from_xml(cls, node, path)
368 @classmethod
369 def _from_xml(cls, node, path):
370 """Create an instance of this class from an XML node.
371
372 Parameters
(...)
383 An instance of this class parsed from the node.
384 """
--> 385 return cls(**cls._parse(node, path))
File ~/python/scikit-robot/skrobot/utils/urdf.py:365, in URDFType._parse(cls, node, path)
345 """Parse all elements and attributes in the _ELEMENTS and _ATTRIBS
346
347 Parse all elements and attributes in the _ELEMENTS and _ATTRIBS
(...)
362 and elements in the class arrays.
363 """
364 kwargs = cls._parse_simple_attribs(node)
--> 365 kwargs.update(cls._parse_simple_elements(node, path))
366 return kwargs
File ~/python/scikit-robot/skrobot/utils/urdf.py:329, in URDFType._parse_simple_elements(cls, node, path)
327 v = node.find(t._TAG)
328 if r or v is not None:
--> 329 v = t._from_xml(v, path)
330 else:
331 vs = node.findall(t._TAG)
File ~/python/scikit-robot/skrobot/utils/urdf.py:1282, in Inertial._from_xml(cls, node, path)
1276 zz = float(n.attrib['izz'])
1277 inertia = np.array([
1278 [xx, xy, xz],
1279 [xy, yy, yz],
1280 [xz, yz, zz]
1281 ])
-> 1282 return Inertial(mass=mass, inertia=inertia, origin=origin)
File ~/python/scikit-robot/skrobot/utils/urdf.py:1227, in Inertial.__init__(self, mass, inertia, origin)
1225 def __init__(self, mass, inertia, origin=None):
1226 self.mass = mass
-> 1227 self.inertia = inertia
1228 self.origin = origin
File ~/python/scikit-robot/skrobot/utils/urdf.py:1250, in Inertial.inertia(self, value)
1248 @inertia.setter
1249 def inertia(self, value):
-> 1250 value = np.asanyarray(value).astype(np.float)
1251 if not np.allclose(value, value.T):
1252 raise ValueError('Inertia must be a symmetric matrix')
File ~/.local/lib/python3.8/site-packages/numpy/__init__.py:284, in __getattr__(attr)
281 from .testing import Tester
282 return Tester
--> 284 raise AttributeError("module {!r} has no attribute "
285 "{!r}".format(__name__, attr))
AttributeError: module 'numpy' has no attribute 'float'