meshPackageName = 'hpp_tutorial' urdfName = 'box' urdfSuffix = "" srdfSuffix = "" class Environment(object): packageName = 'iai_maps' meshPackageName = 'iai_maps' urdfName = 'kitchen_area' urdfSuffix = "" srdfSuffix = "" # Load robot and object. {{{3 robot = Robot('pr2-box', 'pr2') # was anchor joint ps = ProblemSolver(robot) vf = ViewerFactory(ps) vf.loadObjectModel(Box, 'box') vf.loadEnvironmentModel(Environment, "kitchen_area") robot.setJointBounds("pr2/root_joint", [-5, -2, -5.2, -2.7]) robot.setJointBounds("box/root_joint", [-5.1, -2, -5.2, -2.7, 0, 1.5]) # 3}}} # Define configurations. {{{3 q_init = robot.getCurrentConfig() q_init[0:4] = [-3.2, -4, 1, 0] # FIX ME ! (see up ) rank = robot.rankInConfiguration['pr2/r_gripper_l_finger_joint'] q_init[rank] = 0.5 rank = robot.rankInConfiguration['pr2/r_gripper_r_finger_joint']
packageName = 'hpp_tutorial' meshPackageName = 'hpp_tutorial' urdfName = 'box' urdfSuffix = "" srdfSuffix = "" class Environment(object): packageName = 'iai_maps' meshPackageName = 'iai_maps' urdfName = 'kitchen_area' urdfSuffix = "" srdfSuffix = "" robot = Robot('pr2-box', 'pr2') ps = ProblemSolver(robot) ## ViewerFactory is a class that generates Viewer on the go. It means you can ## restart the server and regenerate a new windows. ## To generate a window: ## vf.createRealClient () vf = ViewerFactory(ps) vf.loadObjectModel(Box, 'box') vf.loadEnvironmentModel(Environment, "kitchen_area") robot.setJointBounds("pr2/root_joint", [-5, -2, -5.2, -2.7, -2, 2, -2, 2]) robot.setJointBounds( "box/root_joint", [-5.1, -2, -5.2, -2.7, 0, 1.5, -2, 2, -2, 2, -2, 2, -2, 2]) # 2}}}
# vim: foldmethod=marker foldlevel=2 from hpp.corbaserver.manipulation.pr2 import Robot from math import sqrt # Load robot and object. {{{3 robot = Robot('pr2', rootJointType="anchor") robot.client.manipulation.robot.setRootJointPosition('pr2', (-3.2, -4, 0, 1, 0, 0, 0)) robot.loadObjectModel('box', 'freeflyer', 'hpp_tutorial', 'box', '', '') robot.buildCompositeRobot('pr2-box', ['pr2', 'box']) robot.client.manipulation.robot.loadEnvironmentModel("iai_maps", "kitchen_area", '', '', "") robot.setJointBounds("box/base_joint_xyz", [-3, -2, -5, -3, 0.7, 1]) # 3}}} from hpp_ros.manipulation import ScenePublisher r = ScenePublisher(robot) # Define configurations. {{{3 q_init = robot.getCurrentConfig() rank = robot.rankInConfiguration['pr2/r_gripper_l_finger_joint'] q_init[rank] = 0.5 rank = robot.rankInConfiguration['pr2/r_gripper_r_finger_joint'] q_init[rank] = 0.5 rank = robot.rankInConfiguration['pr2/l_gripper_l_finger_joint'] q_init[rank] = 0.5 rank = robot.rankInConfiguration['pr2/l_gripper_r_finger_joint'] q_init[rank] = 0.5 rank = robot.rankInConfiguration['pr2/torso_lift_joint'] q_init[rank] = 0.2
class Box(object): rootJointType = "freeflyer" packageName = "hpp_tutorial" urdfName = "box" urdfSuffix = "" srdfSuffix = "" class Environment(object): packageName = "hpp_tutorial" urdfName = "kitchen_area" urdfSuffix = "" srdfSuffix = "" robot = Robot("pr2-box", "pr2") ps = ProblemSolver(robot) # ViewerFactory is a class that generates Viewer on the go. It means you can # restart the server and regenerate a new windows. # To generate a window: # vf.createViewer () vf = ViewerFactory(ps) vf.loadObjectModel(Box, "box") vf.loadEnvironmentModel(Environment, "kitchen_area") robot.setJointBounds("pr2/root_joint", [-5, -2, -5.2, -2.7]) robot.setJointBounds("box/root_joint", [-5.1, -2, -5.2, -2.7, 0, 1.5]) # Initialization.