def set_camera_1(): global cam_id pymanoid.get_viewer().SetCamera( [[0.79144370, 0.24411156, -0.56038061, 3.21349812], [0.61108966, -0.29552771, 0.73432472, -2.30738068], [0.01364915, -0.92361947, -0.38306759, 2.12724948], [0., 0., 0., 1.]]) cam_id = 1
def set_camera_0(): global cam_id pymanoid.get_viewer().SetCamera( [[5.62570981e-01, -4.66264164e-01, 6.82723678e-01, -1.87612975e+00], [-8.26747455e-01, -3.18865212e-01, 4.63479905e-01, -1.98973417e+00], [1.59276025e-03, -8.25180408e-01, -5.64867026e-01, 3.30956650e+00], [0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 1.00000000e+00]]) cam_id = 0
camera_travel.on_tick(sim) time.sleep(2) sim.start() if __name__ == "__main__": seed(24) pylab.ion() pymanoid.init(set_viewer=False) robot = RobotModel(download_if_needed=True) robot.set_transparency(0.3) env = pymanoid.get_env() env.SetViewer('qtcoin') pymanoid.env.set_default_background_color() viewer = pymanoid.get_viewer() viewer.SetCamera( [[5.39066316e-01, 3.61154816e-01, -7.60903874e-01, 6.57677031e+00], [8.42254221e-01, -2.26944015e-01, 4.88982864e-01, -2.9774201e+00], [3.91593606e-03, -9.04468691e-01, -4.26522042e-01, 2.25269456e+00], [0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 1.00000000e+00]]) contacts = generate_contacts() com = PointMass([0, 0, 0], robot.mass, visible=False) free_foot = FreeFoot(color='c', visible=False) preview_buffer = PreviewBuffer(com, free_foot) fsm = StateMachine(robot, contacts, com, free_foot, 'DS-R',
def recompute_polygon(): global polygon_handle vertices = contacts.compute_static_equilibrium_polygon() polygon_handle = pymanoid.draw_polygon( [(x[0], x[1], z_polygon) for x in vertices], normal=[0, 0, 1], color=(0.5, 0., 0.5, 0.5)) if __name__ == "__main__": pymanoid.init() robot = pymanoid.robots.JVRC1('JVRC-1.dae', download_if_needed=True) pymanoid.get_viewer().SetCamera([ [0.60587192, -0.36596244, 0.70639274, -2.4904027], [-0.79126787, -0.36933163, 0.48732874, -1.6965636], [0.08254916, -0.85420468, -0.51334199, 2.79584694], [0., 0., 0., 1.]]) robot.set_transparency(0.25) contacts = pymanoid.ContactSet({ 'left_foot': pymanoid.Contact( X=0.2, Y=0.1, pos=[0.20, 0.15, 0.1], rpy=[0, 0, 0], friction=0.5, visible=True), 'right_foot': pymanoid.Contact( X=0.2, Y=0.1,
os.system('import -window %s %s' % (window_id, fname)) frame_index += 1 for _ in xrange(int(framerate * duration)): next_fname = './recording/full_area/%05d.png' % frame_index os.system('cp %s %s' % (fname, next_fname)) frame_index += 1 if __name__ == '__main__': if '--benchmark' not in sys.argv: print "\nUsage: %s [-c[0-3]] [--benchmark] [--record]\n" % sys.argv[0] pymanoid.init() # viewer.SetBkgndColor([.7, .7, .9]) pymanoid.get_viewer().SetCamera(array( [[0.43294998, -0.40765653, 0.80397168, -1.7904253], [-0.90127634, -0.17995773, 0.39410173, -0.99202776], [-0.01597723, -0.89522699, -0.44532388, 1.42718434], [0., 0., 0., 1.]])) plane_origin = pymanoid.Box( X=0.1, Y=0.1, Z=0.1, pos=[-0.5, -1.5, 0.], color='b') if '-c0' in sys.argv: contacts = pymanoid.ContactSet({ 'C1': pymanoid.Contact( X=0.01, Y=0.01,
def set_camera_2(): global cam_id pymanoid.get_viewer().SetCamera([[0., -1., 0., 0.7], [-1., 0., 0., 0.3], [0., 0., -1., 4.65], [0., 0., 0., 1.]]) cam_id = 2
def set_camera_1(): pymanoid.get_viewer().SetCamera([ [1., 0., 0., -7.74532557e-04], [0., 0., 1., -4.99819374e+00], [0., -1., 0., 1.7], [0., 0., 0., 1.]])
def set_camera_0(): pymanoid.get_viewer().SetCamera([ [0.97248388, 0.01229851, -0.23264533, 2.34433222], [0.21414823, -0.44041135, 0.87188209, -2.02105641], [-0.0917368, -0.89771186, -0.43092664, 3.40723848], [0., 0., 0., 1.]])