# # from __future__ import print_function import time, CORBA, re, os, sys from hpp.corbaserver.manipulation import ProblemSolver, ConstraintGraph, \ ConstraintGraphFactory, Constraints, Rule from hpp.corbaserver.manipulation.romeo import Robot from hpp.gepetto.manipulation import Viewer, ViewerFactory from hpp.gepetto import PathPlayer from hpp import Transform Robot.srdfSuffix = '_moveit' robot = Robot('romeo-placard', 'romeo') # Define classes for the objects {{{4 class Placard(object): rootJointType = 'freeflyer' packageName = 'hpp_environments' urdfName = 'placard' urdfSuffix = '' srdfSuffix = '' def __init__(self, name, vf): self.name = name self.vf = vf self.joints = [name + '/root_joint'] self.handles = dict() self.handles['low'] = name + '/low' self.handles['high'] = name + '/high'
from hpp.gepetto.manipulation import Viewer, ViewerFactory from hpp.gepetto import PathPlayer from hpp import Transform from hpp.corbaserver import loadServerPlugin parser = ArgumentParser() parser.add_argument('-N', default=20, type=int) parser.add_argument('--display', action='store_true') parser.add_argument('--run', action='store_true') args = parser.parse_args() loadServerPlugin("corbaserver", "manipulation-corba.so") Client().problem.resetProblem() Robot.srdfSuffix = '_moveit' robot = Robot('romeo-placard', 'romeo') # Define classes for the objects {{{4 class Placard(object): rootJointType = 'freeflyer' packageName = 'hpp_environments' urdfName = 'placard' urdfSuffix = '' srdfSuffix = '' def __init__(self, name, vf): self.name = name self.vf = vf self.joints = [name + '/root_joint'] self.handles = dict()
handle = "kitchen_area/fridge_handle_fridge_handle" class Cup (object): rootJointType = "freeflyer" packageName = 'hpp_tutorial' meshPackageName = 'hpp_tutorial' urdfName = 'cup' urdfSuffix = "" srdfSuffix = "" joint = "cup/base_joint" handle = "cup/handle" Robot.srdfSuffix = "_moveit" # 4}}} robot = Robot ('romeo-kitchen', 'romeo') ps = ProblemSolver (robot) vf = ViewerFactory (ps) robot.setJointBounds ("romeo/base_joint_xyz" , [-6,-2,-5.2,-2.7, 0, 2]) vf.loadObjectModel (Kitchen, "kitchen_area") vf.loadObjectModel (Cup, "cup") robot.setJointBounds ('cup/base_joint_xyz', [-6,-4,-5,-3,0,1.5]) # 3}}} # Define configurations. {{{3 robot.setCurrentConfig (robot.getInitialConfig ()) q_init = robot.getHandConfig ("both", "open") rank = robot.rankInConfiguration ['romeo/base_joint_xyz'] q_init [rank:rank+7] = [-3.5,-3.7, 0.877, 1, 0, 0, 0]
# # from __future__ import print_function import time, CORBA, re, os, sys from hpp.corbaserver.manipulation import ProblemSolver, ConstraintGraph, \ ConstraintGraphFactory, Constraints, Rule from hpp.corbaserver.manipulation.romeo import Robot from hpp.gepetto.manipulation import Viewer, ViewerFactory from hpp.gepetto import PathPlayer from hpp import Transform Robot.srdfSuffix = '_moveit' robot = Robot ('romeo-placard', 'romeo') # Define classes for the objects {{{4 class Placard (object): rootJointType = 'freeflyer' packageName = 'hpp_environments' urdfName = 'placard' urdfSuffix = '' srdfSuffix = '' def __init__ (self, name, vf): self.name = name self.vf = vf self.joints = [name + '/root_joint'] self.handles = dict () self.handles ['low'] = name + '/low' self.handles ['high'] = name + '/high' vf.loadObjectModel (self.__class__, name) self.rank = vf.robot.rankInConfiguration [name + '/root_joint']
class Cup(object): rootJointType = "freeflyer" packageName = 'hpp_tutorial' meshPackageName = 'hpp_tutorial' urdfName = 'cup' urdfSuffix = "" srdfSuffix = "" joint = "cup/base_joint" handle = "cup/handle" Robot.srdfSuffix = "_moveit" # 4}}} robot = Robot('romeo-kitchen', 'romeo') ps = ProblemSolver(robot) vf = ViewerFactory(ps) robot.setJointBounds("romeo/base_joint_xyz", [-6, -2, -5.2, -2.7, 0, 2]) vf.loadObjectModel(Kitchen, "kitchen_area") vf.loadObjectModel(Cup, "cup") robot.setJointBounds('cup/base_joint_xyz', [-6, -4, -5, -3, 0, 1.5]) # 3}}} # Define configurations. {{{3 robot.setCurrentConfig(robot.getInitialConfig()) q_init = robot.getHandConfig("both", "open") rank = robot.rankInConfiguration['romeo/base_joint_xyz'] q_init[rank:rank + 7] = [-3.5, -3.7, 0.877, 1, 0, 0, 0]