# draw the robot
from graph.multibody import MultiBodyViz
# add visualization of the of the b4 and b5 body that don't have any successors
X_b4_ef = sva.PTransformd(sva.RotY(-np.pi/2.), e.Vector3d(0.2, 0., 0.))
X_b5_ef = sva.PTransformd(sva.RotX(-np.pi/2.), e.Vector3d(0., 0.2, 0.))
mbv = MultiBodyViz(mbg, mb, endEffectorDict={'b4':(X_b4_ef, 0.1, (1., 1., 0.)),
'b5':(X_b5_ef, 0.1, (1., 1., 0.))})
mbv.addActors(viewer.scene)
Error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-14-7731b7605e8a> in <module>
8 'b5':(X_b5_ef, 0.1, (1., 1., 0.))})
9
---> 10 mbv.addActors(viewer.scene)
~/src/jrl-umi3218/sva_rbdyn_tutorials/graph/multibody.py in addActors(self, scene)
81 map(lambda aj: aj[1], self.aJoints)]
82 for actor in actors:
---> 83 scene.renderer.add_actor(actor)
84
85
~/src/mayavi/tvtk/tvtk_classes.zip/tvtk_classes/renderer.pyc in add_actor(self, *args)
~/src/mayavi/tvtk/tvtk_base.py in _wrap_call(self, vtk_method, *args)
593 mtime = self._wrapped_mtime(vtk_obj) + 1
594 try:
--> 595 ret = vtk_method(*args)
596 finally:
597 self._in_set -= 1
TypeError: AddActor argument 1: method requires a VTK object
The code in multibody.py::addActors is very strange:
def addActors(self, scene):
"""
Add all actors to the scene.
"""
actors = map(lambda ab: ab[1], self.aBodies) +\
map(lambda aj: aj[1], self.aJoints)
for actor in actors:
scene.renderer.add_actor(actor)
I'm not really sure what is supposed to be achieved by this, or how to fix it. Any ideas?
In
MultiBody.ipynb
tError:
The code in
multibody.py::addActors
is very strange:I'm not really sure what is supposed to be achieved by this, or how to fix it. Any ideas?