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')
Beispiel #2
0
def show_image(im):
    mlab.figure()
    mlab.imagesc(data.x_vec, data.y_vec, 20*numpy.log10(numpy.abs(im)))
    mlab.colormap('green14',nout=0)
    mlab.axis('image', nout=0)
    mlab.colorbar(nout=0)
    mlab.axis('xy',nout=0)
    mlab.caxis(numpy.max(mlab.caxis()) - numpy.array([do(data.dyn_range), 0]), nout=0)
Beispiel #3
0
def show_image(im):
    mlab.figure()
    mlab.imagesc(data.x_vec, data.y_vec, 20 * numpy.log10(numpy.abs(im)))
    mlab.colormap('green14', nout=0)
    mlab.axis('image', nout=0)
    mlab.colorbar(nout=0)
    mlab.axis('xy', nout=0)
    mlab.caxis(numpy.max(mlab.caxis()) - numpy.array([do(data.dyn_range), 0]),
               nout=0)
Beispiel #4
0
def show_image(im):
    """Matlab-specific function to plot a dB image nicely."""
    mlab.figure()
    mlab.imagesc(data.x_vec, data.y_vec, 20*numpy.log10(numpy.abs(im)))
    mlab.colormap('green14',nout=0)
    mlab.axis('image', nout=0)
    mlab.colorbar(nout=0)
    mlab.axis('xy',nout=0)
    mlab.caxis(numpy.max(mlab.caxis()) - numpy.array([a2f(data.dyn_range), 0]), nout=0)
human = mlab.human24(lengths)

# ----------------------------------------------------------- #
# 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')