pose.useregex=True pose[mask]=T (env,options)=oh.setup('qtcoin') env.SetDebugLevel(3) options.scenefile='gripper.env.xml' options.robotfile=None options.physics='ode' options.stop=True [robot,ctrl,ind,ref,recorder]=oh.load_scene(env,options) rod=env.GetKinBody('rod') trans=rod.GetTransform() pose=oh.Pose(robot) success=False strength=0 oh.set_robot_color(robot,[.7,.7,.7],[.7,.7,.7],0.0) oh.set_finger_torquemode(robot) #recorder.realtime=False #recorder.filename='griptest.avi' #recorder.start() while not success: strength+=.2 print "Added torque {}".format(strength) rod.SetVelocity(zeros(3),zeros(3)) rod.SetTransform(trans) print "Mass is {}".format(rod.GetLinks()[0].GetMass()) env.GetPhysicsEngine().SetGravity([0, 0, 0])
from optparse import OptionParser import time import openravepy import openhubo from openhubo import kbhit if __name__ == "__main__": """Modified version of contact display from openrave examples""" (env,options)=openhubo.setup('qtcoin',True) env.SetDebugLevel(2) time.sleep(.25) [robot,ctrl,ind,ref,recorder]=openhubo.load_scene(env,options) stop=False # Set the floor and other bodies to be slightly transparent to better visualize interpenetrations for b in env.GetBodies(): if not b == robot: openhubo.set_robot_color(b,trans=.3) while not stop: handles=openhubo.plot_contacts(robot) #handles=openhubo.plot_dirs(robot) openhubo.sleep(.05) if kbhit.kbhit(True): stop=True
pose[mask] = T (env, options) = oh.setup('qtcoin') env.SetDebugLevel(3) options.scenefile = 'gripper.env.xml' options.robotfile = None options.physics = 'ode' options.stop = True [robot, ctrl, ind, ref, recorder] = oh.load_scene(env, options) rod = env.GetKinBody('rod') trans = rod.GetTransform() pose = oh.Pose(robot) success = False strength = 0 oh.set_robot_color(robot, [.7, .7, .7], [.7, .7, .7], 0.0) oh.set_finger_torquemode(robot) #recorder.realtime=False #recorder.filename='griptest.avi' #recorder.start() while not success: strength += .2 print "Added torque {}".format(strength) rod.SetVelocity(zeros(3), zeros(3)) rod.SetTransform(trans) print "Mass is {}".format(rod.GetLinks()[0].GetMass()) env.GetPhysicsEngine().SetGravity([0, 0, 0]) print "starting..."
__license__ = 'Apache License, Version 2.0' from optparse import OptionParser import time import openravepy import openhubo from openhubo import kbhit if __name__ == "__main__": """Modified version of contact display from openrave examples""" (env, options) = openhubo.setup('qtcoin', True) env.SetDebugLevel(2) time.sleep(.25) [robot, ctrl, ind, ref, recorder] = openhubo.load_scene(env, options) stop = False # Set the floor and other bodies to be slightly transparent to better visualize interpenetrations for b in env.GetBodies(): if not b == robot: openhubo.set_robot_color(b, trans=.3) while not stop: handles = openhubo.plot_contacts(robot) #handles=openhubo.plot_dirs(robot) openhubo.sleep(.05) if kbhit.kbhit(True): stop = True