コード例 #1
0
    def setPlan(self, plan):

        self.ui.playbackSlider.value = 0
        self.ui.timeLabel.text = 'Time: 0.00 s'
        self.ui.planNameLabel.text = ''
        self.plan = plan
        self.endTime = 1.0
        self.updateButtonColor()

        if not self.plan:
            return

        planText = 'Plan: %d.  %.2f seconds' % (
            plan.utime, self.planPlayback.getPlanElapsedTime(plan))
        self.ui.planNameLabel.text = planText

        self.startTime = 0.0
        self.endTime = self.planPlayback.getPlanElapsedTime(plan)
        self.interpolationChanged()
        info = self.getPlanInfo(plan)
        app.displaySnoptInfo(info)

        if self.ui.hideButton.text == 'show':
            self.hideClicked()
        else:
            self.viewModeChanged()

        self.updateButtonColor()

        if self.autoPlay and self.widget.parent() is not None:
            self.widget.parent().show()
コード例 #2
0
ファイル: playbackpanel.py プロジェクト: mlab-upenn/arch-apex
    def setPlan(self, plan):

        self.ui.playbackSlider.value = 0
        self.ui.timeLabel.text = 'Time: 0.00 s'
        self.ui.planNameLabel.text = ''
        self.plan = plan
        self.endTime = 1.0
        self.updateButtonColor()

        if not self.plan:
            return

        planText = 'Plan: %d.  %.2f seconds' % (plan.utime, self.planPlayback.getPlanElapsedTime(plan))
        self.ui.planNameLabel.text = planText

        self.startTime = 0.0
        self.endTime = self.planPlayback.getPlanElapsedTime(plan)
        self.interpolationChanged()
        info = self.getPlanInfo(plan)
        app.displaySnoptInfo(info)

        if self.ui.hideButton.text == 'show':
            self.hideClicked()
        else:
            self.viewModeChanged()

        self.updateButtonColor()

        if self.autoPlay and self.widget.parent() is not None:
            self.widget.parent().show()
コード例 #3
0
ファイル: valvedemo.py プロジェクト: mlab-upenn/arch-apex
    def planTurn(self, wristAngleCW=np.radians(320)):
        ikParameters = IkParameters(maxDegreesPerSecond=self.speedTurn)
        startPose = self.getPlanningStartPose()
        wristAngleCW = min(np.radians(320)-0.01, max(-np.radians(160)+0.01, wristAngleCW))
        if self.graspingHand == 'left':
            postureJoints = {'l_arm_lwy': -np.radians(160) + wristAngleCW}
        else:
            postureJoints = {'r_arm_lwy': np.radians(160) - wristAngleCW}

        endPose = self.ikPlanner.mergePostures(startPose, postureJoints)

        plan = self.ikPlanner.computePostureGoal(startPose, endPose, ikParameters=ikParameters)
        app.displaySnoptInfo(1)

        self.addPlan(plan)
コード例 #4
0
    def planTurn(self, wristAngleCW=np.radians(320)):
        ikParameters = IkParameters(maxDegreesPerSecond=self.speedTurn)
        startPose = self.getPlanningStartPose()
        wristAngleCW = min(
            np.radians(320) - 0.01, max(-np.radians(160) + 0.01, wristAngleCW))
        if self.graspingHand == 'left':
            postureJoints = {'l_arm_lwy': -np.radians(160) + wristAngleCW}
        else:
            postureJoints = {'r_arm_lwy': np.radians(160) - wristAngleCW}

        endPose = self.ikPlanner.mergePostures(startPose, postureJoints)

        plan = self.ikPlanner.computePostureGoal(startPose,
                                                 endPose,
                                                 ikParameters=ikParameters)
        app.displaySnoptInfo(1)

        self.addPlan(plan)