class Box (object):
  rootJointType = 'freeflyer'
  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)
fk = FakeViewer (ps)

fk.loadObjectModel (Box, 'box')
fk.buildCompositeRobot (['pr2', 'box'])
fk.loadEnvironmentModel (Environment, "kitchen_area")

robot.setJointBounds ("pr2/base_joint_xy" , [-5,-2,-5.2,-2.7]     )
robot.setJointBounds ("box/base_joint_xyz", [-5.1,-2,-5.2,-2.7,0,1.5])
# 2}}}

# Load the Python class ConstraintGraph. {{{2
graph = ConstraintGraph (robot, 'graph')
# 2}}}
Exemple #2
0
    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']
class Box (object):
  rootJointType = 'freeflyer'
  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}}}

# 2}}}
    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', rootJointType="anchor")
ps = ProblemSolver(robot)
vf = ViewerFactory(ps)

robot.setJointPosition('pr2/base_joint', (-3.2, -4, 0, 1, 0, 0, 0))
vf.loadObjectModel(Box, 'box')
vf.loadEnvironmentModel(Environment, "kitchen_area")
robot.setJointBounds("box/base_joint_xyz", [-3, -2, -5, -3, 0.7, 1])
# 3}}}

# 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
Exemple #5
0
# 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
Exemple #6
0
    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:
## fk.createRealClient ()
fk = ViewerFactory(ps)

fk.loadObjectModel(Box, 'box')
fk.loadEnvironmentModel(Environment, "kitchen_area")

robot.setJointBounds("pr2/base_joint_xy", [-5, -2, -5.2, -2.7])
robot.setJointBounds("box/base_joint_xyz", [-5.1, -2, -5.2, -2.7, 0, 1.5])
# 2}}}

# Load the Python class ConstraintGraph. {{{2
  rootJointType = 'freeflyer'
  packageName = 'hpp_tutorial'
  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', rootJointType = "anchor")
ps = ProblemSolver (robot)
vf = ViewerFactory (ps)

robot.setJointPosition ('pr2/base_joint', (-3.2, -4, 0, 1, 0, 0, 0))
vf.loadObjectModel (Box, 'box')
vf.loadEnvironmentModel (Environment, "kitchen_area")
robot.setJointBounds ("box/base_joint_xyz", [-3,-2,-5,-3,0.7,1])
# 3}}}

# 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
Exemple #8
0
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.
class Box (object):
  rootJointType = 'freeflyer'
  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.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])
# 2}}}

# 1}}}
# 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
q_goal = q_init [::]

rank = robot.rankInConfiguration ['box/base_joint_xyz']
Exemple #11
0
    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, -pi, pi])
robot.setJointBounds(
    "box/root_joint",
    [-5.1, -2, -5.2, -2.7, 0, 1.5, -1, 1, -1, 1, -1, 1, -1, 1])
# 2}}}
Exemple #12
0
  rootJointType = 'freeflyer'
  packageName = 'hpp_tutorial'
  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)

robot.setJointBounds ('pr2/root_joint', [-3.2,-3.2, -4,-4, 0.,0.]) # FIX ME ! was an anchor joint, but cannot move it with pinocchio ?
vf.loadObjectModel (Box, 'box')
vf.loadEnvironmentModel (Environment, "kitchen_area")
robot.setJointBounds ("box/root_joint", [-3,-2,-5,-3,0.7,1,-1,1,-1,1,-1,1,-1,1])
# 3}}}

# Define configurations. {{{3
q_init = robot.getCurrentConfig ()
q_init[0:3] = [-3.2,-4,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']