Ejemplo n.º 1
0
 def draw_chains(self):
    ''' Draws the source and target chain on the same axes, for debugging
    purposes. '''
    mlab.figure()
    mlab.grid('on')
    mlab.draw(self.source)
    mlab.draw(self.target, 'r')
Ejemplo n.º 2
0
# ----------------------------------------------------------- #
# Manipulating and Visualizing Chains: 
# ----------------------------------------------------------- #

#  Manipulate chain pose with setJointAngles(chain, angles)
pr2_initial_angles = np.matrix([0,0,0,0])
pr2 = mlab.setJointAngles(pr2, pr2_initial_angles)

human_initial_angles = np.matrix([0,-110,40,-60])
human = mlab.setJointAngles(human, human_initial_angles)

#  Visualize chains with the draw() function.

mlab.figure()
mlab.grid('on')
mlab.headSphere() #creates a dummy head that provides context.

mlab.draw(pr2,'k')
mlab.draw(human)

# ----------------------------------------------------------- #
# Retargeting Chains: 
# ----------------------------------------------------------- #

# easy_retarget(source, target) abstracts away all the messy bits.
pr2_retargeted = mlab.easy_retarget(human, pr2)

# draw on the open figure:
mlab.draw(pr2_retargeted,'g')
mlab.title('Retargeting Demo')