Exemple #1
0
    urdfName = 'construction_set/sphere'
    urdfSuffix = ""
    srdfSuffix = ""


class Ground(object):
    rootJointType = 'anchor'
    packageName = 'hpp_environments'
    urdfName = 'construction_set/ground'
    urdfSuffix = ""
    srdfSuffix = ""


nSphere = 2

robot = Robot('ur3-spheres', 'ur3')
ps = ProblemSolver(robot)
ps.setErrorThreshold(1e-4)
ps.setMaxIterProjection(40)

vf = ViewerFactory(ps)

# Change bounds of robots to increase workspace and avoid some collisions
robot.setJointBounds('ur3/shoulder_pan_joint', [-pi, 4])
robot.setJointBounds('ur3/shoulder_lift_joint', [-pi, 0])
robot.setJointBounds('ur3/elbow_joint', [-2.6, 2.6])

vf.loadEnvironmentModel(Ground, 'ground')

objects = list()
p = ps.client.basic.problem.getProblem()
Exemple #2
0
    rootJointType = 'freeflyer'
    urdfFilename = \
      "package://hpp_environments/urdf/construction_set/sphere.urdf"
    srdfFilename = \
      "package://hpp_environments/srdf/construction_set/sphere.srdf"


class Ground(object):
    rootJointType = 'freeflyer'
    urdfFilename = \
      "package://hpp_environments/urdf/construction_set/ground.urdf"
    srdfFilename = \
      "package://hpp_environments/srdf/construction_set/ground.srdf"


robot = Robot('2ur5-sphere', 'r0')
robot.setJointPosition('r0/root_joint', [-.25, 0, 0, 0, 0, 0, 1])

ps = ProblemSolver(robot)
ps.setErrorThreshold(1e-4)
ps.setMaxIterProjection(40)

vf = ViewerFactory(ps)

#
#  Load robots and objets
#    - 2 UR3,
#    - 4 spheres,
#    - 4 short cylinders,

vf.loadRobotModel(Robot, "r1")
Exemple #3
0
from hpp.corbaserver.manipulation.ur5 import Robot
from hpp.corbaserver.manipulation import ProblemSolver
from scene_publisher3b import ScenePublisher as MultiRobotPub

Robot.packageName = "fiad_description"
Robot.urdfName = "ur5"
Robot.urdfSuffix = ''
Robot.srdfSuffix = '_ee'
withWaypoint = True
withLevelSetEgde = True

robot = Robot ('ur5')
robot.client.basic.problem.selectPathPlanner ("M-RRT")
robot.loadObjectModel ('box', 'freeflyer', 'fiad_description', 'box', '', '')
robot.buildCompositeRobot ('robot', ['ur5', 'box'])
for a in ["x","y","z"]:
  robot.setJointBounds ("box/base_joint_"+a, [-1,1])
robot.client.basic.problem.resetRoadmap ()
robot.client.basic.problem.selectPathOptimizer ('None')
robot.client.basic.problem.setMaxIterations (40)

r = MultiRobotPub (robot)

half_sitting = robot.getCurrentConfig ();
qinit=[0,0,0,0,0,0,0, 0.5,0,1,0,0,0]
qgoal=[0,0,0,0,0,0,0,-0.5,0,1,0,0,0]

p = ProblemSolver (robot)
p.createGrasp ('grasp', 'ur5/ee', 'box/handle')
p.createGrasp ('grasp-passive', 'ur5/ee', 'box/handle')
if withWaypoint:
Exemple #4
0
# coding: utf-8
from hpp.corbaserver.manipulation.ur5 import Robot
from hpp.corbaserver.manipulation import ProblemSolver, newProblem
from hpp.corbaserver import loadServerPlugin

loadServerPlugin ("corbaserver", "manipulation-corba.so")

newProblem()
robot = Robot ("robot", "ur5")
ps = ProblemSolver (robot)
distance = ps.hppcorba.problem.getDistance()

q0 = robot.getCurrentConfig()
qr = robot.shootRandomConfig()
print distance.value (q0, qr)
weights = distance.getWeights()
weights[0] = 0
distance.setWeights (weights)
print distance.value (q0, qr)

from hpp.corbaserver.tools import Tools
tools = Tools()
ior=ps.hppcorba.orb.object_to_string (distance)
tools.deleteServant(ior)

tools.shutdown()
class Sphere (object):
  rootJointType = 'freeflyer'
  packageName = 'hpp_environments'
  urdfName = 'construction_set/sphere'
  urdfSuffix = ""
  srdfSuffix = ""

class Ground (object):
  rootJointType = 'anchor'
  packageName = 'hpp_environments'
  urdfName = 'construction_set/ground'
  urdfSuffix = ""
  srdfSuffix = ""

robot = Robot ('2ur5-sphere', 'r0')
robot.setJointPosition ('r0/root_joint', [-.25, 0, 0, 0, 0, 0, 1])

ps = ProblemSolver (robot)
ps.setErrorThreshold (1e-4)
ps.setMaxIterProjection (40)

vf = ViewerFactory (ps)

#
#  Load robots and objets
#    - 2 UR3,
#    - 4 spheres,
#    - 4 short cylinders,

vf.loadRobotModel (Robot, "r1")
Exemple #6
0
from hpp.corbaserver.manipulation.ur5 import Robot
from hpp.corbaserver.manipulation import ProblemSolver
from scene_publisher3b import ScenePublisher as MultiRobotPub

Robot.packageName = "fiad_description"
Robot.urdfName = "ur5"
Robot.urdfSuffix = ''
Robot.srdfSuffix = '_ee'
withWaypoint = True
withLevelSetEgde = True

robot = Robot('ur5')
robot.client.basic.problem.selectPathPlanner("M-RRT")
robot.loadObjectModel('box', 'freeflyer', 'fiad_description', 'box', '', '')
robot.buildCompositeRobot('robot', ['ur5', 'box'])
for a in ["x", "y", "z"]:
    robot.setJointBounds("box/base_joint_" + a, [-1, 1])
robot.client.basic.problem.resetRoadmap()
robot.client.basic.problem.selectPathOptimizer('None')
robot.client.basic.problem.setMaxIterations(40)

r = MultiRobotPub(robot)

half_sitting = robot.getCurrentConfig()
qinit = [0, 0, 0, 0, 0, 0, 0, 0.5, 0, 1, 0, 0, 0]
qgoal = [0, 0, 0, 0, 0, 0, 0, -0.5, 0, 1, 0, 0, 0]

p = ProblemSolver(robot)
p.createGrasp('grasp', 'ur5/ee', 'box/handle')
p.createGrasp('grasp-passive', 'ur5/ee', 'box/handle')
if withWaypoint: