Example #1
0
    def __init__(self, objname, markerid=5):
        self.markerid = markerid
        self.objname = objname
        self.gdb = db.GraspDB(database="wrs",
                              user="******",
                              password="******")
        self.robot = ur3dualsim.Ur3DualRobot()
        self.rgthnd = rtq85nm.newHand(hndid="rgt")
        self.lfthnd = rtq85nm.newHand(hndid="lft")
        self.robotmesh = ur3dualsimmesh.Ur3DualMesh(rgthand=self.rgthnd,
                                                    lfthand=self.lfthnd)
        self.robotball = ur3dualsimball.Ur3DualBall()
        self.robotik = ur3dualik
        self.env = bunrisettingfree.Env()
        self.env.reparentTo(base.render)
        self.objcm = self.env.loadobj(objname)
        self.obstaclecmlist = self.env.getstationaryobslist()
        for obstaclecdcm in self.obstaclecmlist:
            obstaclecdcm.showcn()

        self.robot.goinitpose()

        self.rgtwatchpos = [400.0, -200.0, 1200.0]
        self.rgtwatchrotmat = [[0.09141122, -0.76823672, 0.63360582],
                               [-0.99509199, -0.04625775, 0.08747659],
                               [-0.03789355, -0.63849242, -0.76869468]]
        self.rgtwatchjs = self.robot.numik(self.rgtwatchpos,
                                           self.rgtwatchrotmat, "rgt")

        self.robot.movearmfk(self.rgtwatchjs, armname="rgt")
        self.rbtmnp = self.robotmesh.genmnp(self.robot,
                                            self.rgthnd.jawwidthopen,
                                            self.lfthnd.jawwidthopen)
        self.rbtmnp.reparentTo(base.render)

        # uncomment the following commands to actuate the robot
        # self.ur3u = ur3urx.Ur3DualUrx()
        # self.ur3u.movejntssgl(self.robot.initjnts[3:9], 'rgt')
        # self.ur3u.movejntssgl(self.robot.initjnts[9:15], 'lft')
        # self.ur3u.movejntssgl(self.rgtwatchjs, 'rgt')

        self.hc = cameras.HndCam(rgtcamid=0, lftcamid=1)

        # goallist, a list of 4x4 h**o numpy mat
        self.goallist = []
        self.objrenderlist = []
        self.startobjcm = None

        self.rbtmnpani = [None, None]
        self.objmnpani = [None]
Example #2
0
from motionplanning import ctcallback as ctcb
from motionplanning import collisioncheckerball as cdck
from motionplanning.rrt import rrtconnect as rrtc
from robotsim.ur3dual import ur3dual
from robotsim.ur3dual import ur3dualmesh
from robotsim.ur3dual import ur3dualball
from pandaplotutils import pandactrl
import bunrisettingfree
import numpy as np
import copy
import utiltools.robotmath as rm

base = pandactrl.World(camp=[2700, 300, 2700], lookatp=[0, 0, 1000])

objname = "tool_motordriver.stl"
env = bunrisettingfree.Env(base)
env.reparentTo(base.render)
obscmlist = env.getstationaryobslist()
# for obscm in obscmlist:
#     obscm.showcn()

# load obj collision model using env
objcm = env.loadobj("bunnysim.stl")

# another example -- load obj collision model independently
# this_dir, this_filename = os.path.split(__file__)
# objname = "tool_motordriver.stl"
# objpath = os.path.join(this_dir, "objects", objname)
# objcm = cm.CollisionModel(objpath)

robot = ur3dual.Ur3DualRobot()