Exemplo n.º 1
0
    def __init__(self,
                 jointNames,
                 poseData,
                 cameraInfoDict,
                 cameraSerialNumber=1112170110,
                 poseFilename=None,
                 cameraInfoFilename=None,
                 tfBuffer=None):

        self.jointNames = jointNames
        self.poseData = poseData
        self.cameraInfoDict = cameraInfoDict
        self.tfBuffer = tfBuffer

        self.poseFilename = poseFilename
        self.cameraInfoFilename = cameraInfoFilename
        self.robotService = rosUtils.RobotService(self.jointNames)
        self.cameraSerialNumber = cameraSerialNumber
        self.setupConfig()
        self.setup()

        if USING_DIRECTOR:
            self.taskRunner = TaskRunner()
            self.taskRunner.callOnThread(self.setupTF)
        else:
            self.setupTF()
Exemplo n.º 2
0
	def __init__(self):
		self.bagging = False
		self.rosbag_proc = None
		storedPosesFile = os.path.join(spartanUtils.getSpartanSourceDir(), 'src', 'catkin_projects', 'station_config','RLG_iiwa_1','stored_poses.yaml')
		self.storedPoses = spartanUtils.getDictFromYamlFilename(storedPosesFile)
		self.robotService = rosUtils.RobotService(self.storedPoses['header']['joint_names'])
		self.setupConfig()
Exemplo n.º 3
0
 def __init__(self, camera_serial_number="carmine_1"):
     self.camera_serial_number = camera_serial_number
     self.bagging = False
     self.rosbag_proc = None
     self.tfBuffer = None
     storedPosesFile = os.path.join(spartanUtils.getSpartanSourceDir(), 'src', 'catkin_projects', 'station_config','RLG_iiwa_1','stored_poses.yaml')
     self.storedPoses = spartanUtils.getDictFromYamlFilename(storedPosesFile)
     self.robotService = rosUtils.RobotService(self.storedPoses['header']['joint_names'])
     self.setupConfig()
     self.setupSubscribers()
     self.setupPublishers()
     self.setupTF()
     self.setupCache()
Exemplo n.º 4
0
    def __init__(self, homeCartesianPoint, touchCartesianPoints):
        self.jointNames = (u'iiwa_joint_1', u'iiwa_joint_2', u'iiwa_joint_3',
                           u'iiwa_joint_4', u'iiwa_joint_5', u'iiwa_joint_6',
                           u'iiwa_joint_7')
        self.robotService = spartanROSUtils.RobotService(self.jointNames)
        self.currentJointPosition = [0] * len(self.jointNames)

        self.maxJointDegreesPerSecond = 15

        self.homeJointPosition = self.getJointPositions(homeCartesianPoint)
        self.touchJointPositions = [
            self.getJointPositions(point) for point in touchCartesianPoints
        ]

        rospy.Subscriber("/joint_states", sensor_msgs.msg.JointState,
                         self.storeCurrentJointPosition)
        rospy.Subscriber("/stop", std_msgs.msg.Bool, self.stopCurrentPoint)
Exemplo n.º 5
0
    def __init__(self,
                 robotSystem,
                 handFrame='palm',
                 stopChannel="/stop",
                 removeFloatingBase=True,
                 cameraSerialNumber=1112170110):
        self.robotSystem = robotSystem
        self.jointNames = self.robotSystem.ikPlanner.robotModel.model.getJointNames(
        )
        print self.jointNames
        if removeFloatingBase:
            self.jointNames = self.jointNames[6:]
        self.robotService = spartanROSUtils.RobotService(self.jointNames)
        self.handFrame = handFrame
        self.cameraSerialNumber = cameraSerialNumber
        self.removeFloatingBase = removeFloatingBase
        self.maxJointDegreesPerSecond = 15

        rospy.Subscriber(stopChannel, std_msgs.msg.Bool, self.stopCurrentPoint)

        self.taskRunner = TaskRunner()
Exemplo n.º 6
0
    def __init__(self, storedPosesFile=None, cameraSerialNumber=1112170110):
        self.storedPoses = spartanUtils.getDictFromYamlFilename(
            storedPosesFile)
        self.cameraSerialNumber = cameraSerialNumber

        self.cameraName = 'camera_' + str(cameraSerialNumber)
        self.pointCloudTopic = '/' + str(self.cameraName) + '/depth/points'
        self.graspFrameName = 'base'
        self.depthOpticalFrameName = self.cameraName + "_depth_optical_frame"

        self.robotService = rosUtils.RobotService(
            self.storedPoses['header']['joint_names'])

        self.usingDirector = True
        self.setupConfig()

        if USING_DIRECTOR:
            self.taskRunner = TaskRunner()
            self.taskRunner.callOnThread(self.setupSubscribers)
            self.taskRunner.callOnThread(self.setupTF)
        else:
            self.setupSubscribers()
            self.setupTF()