<commit_before>import os
import sys
import vtkAll as vtk
from ddapp import botpy
import math
import time
import types
import functools
import numpy as np

from ddapp import transformUtils
from ddapp import lcmUtils
from ddapp.timercallback import TimerCallback
from ddapp.asynctaskqueue import AsyncTaskQueue
from ddapp.fieldcontainer import FieldContainer
from ddapp import objectmodel as om
from ddapp import visualization as vis
from ddapp import applogic as app
from ddapp.debugVis import DebugData
from ddapp import ikplanner
from ddapp import ioUtils
from ddapp import affordanceitems
from ddapp.simpletimer import SimpleTimer
from ddapp.utime import getUtime
from ddapp import robotstate
from ddapp import robotplanlistener
from ddapp import segmentation
from ddapp import planplayback
from ddapp.footstepsdriver import FootstepRequestGenerator
from ddapp.tasks.taskuserpanel import TaskUserPanel
from ddapp.tasks.taskuserpanel import ImageBasedAffordanceFit


import ddapp.tasks.robottasks as rt
import ddapp.tasks.taskmanagerwidget as tmw

import drc as lcmdrc

from PythonQt import QtCore, QtGui


class DoorDemo(object):

    def __init__(self, robotModel, footstepPlanner, manipPlanner, ikPlanner, lhandDriver, rhandDriver, atlasDriver, multisenseDriver, affordanceFitFunction, sensorJointController, planPlaybackFunction, showPoseFunction):
        self.robotModel = robotModel
        self.footstepPlanner = footstepPlanner
        self.manipPlanner = manipPlanner
        self.ikPlanner = ikPlanner
        self.lhandDriver = lhandDriver
        self.rhandDriver = rhandDriver
        self.atlasDriver = atlasDriver
        self.multisenseDriver = multisenseDriver
        self.affordanceFitFunction = affordanceFitFunction
        self.sensorJointController = sensorJointController
        self.planPlaybackFunction = planPlaybackFunction
        self.showPoseFunction = showPoseFunction
        self.graspingHand = 'right'

        self.endPose = None

        self.planFromCurrentRobotState = True
        self.visOnly = False
        self.useFootstepPlanner = False
        self.userPromptEnabled = True

        self.constraintSet = None
        self.plans = []

        self.pinchDistance = 0.1
        self.doorHandleFrame = None
        self.doorHandleGraspFrame = None
        self.doorHingeFrame = None

        self.handleTouchHeight = 0.09
        self.handleTouchDepth = -0.05
        self.handleTouchWidth = 0.02

        self.handleTurnHeight = -0.07
        self.handleTurnWidth = 0.01

        self.handleLiftHeight = 0.12
        self.handlePushDepth = 0.0
        self.handleOpenDepth = 0.1
        self.handleOpenWidth = 0.4

        self.setFootstepThroughDoorParameters()



    def addPlan(self, plan):
        self.plans.append(plan)


    def computeGroundFrame(self, robotModel):
        '''
        Given a robol model, returns a vtkTransform at a position between
        the feet, on the ground, with z-axis up and x-axis aligned with the
        robot pelvis x-axis.
        '''
        t1 = robotModel.getLinkFrame('l_foot')
        t2 = robotModel.getLinkFrame('r_foot')
        pelvisT = robotModel.getLinkFrame('pelvis')

        xaxis = [1.0, 0.0, 0.0]
        pelvisT.TransformVector(xaxis, xaxis)<commit_msg>small adjustments to door handle parameters<commit_after>import os
import sys
import vtkAll as vtk
from ddapp import botpy
import math
import time
import types
import functools
import numpy as np

from ddapp import transformUtils
from ddapp import lcmUtils
from ddapp.timercallback import TimerCallback
from ddapp.asynctaskqueue import AsyncTaskQueue
from ddapp.fieldcontainer import FieldContainer
from ddapp import objectmodel as om
from ddapp import visualization as vis
from ddapp import applogic as app
from ddapp.debugVis import DebugData
from ddapp import ikplanner
from ddapp import ioUtils
from ddapp import affordanceitems
from ddapp.simpletimer import SimpleTimer
from ddapp.utime import getUtime
from ddapp import robotstate
from ddapp import robotplanlistener
from ddapp import segmentation
from ddapp import planplayback
from ddapp.footstepsdriver import FootstepRequestGenerator
from ddapp.tasks.taskuserpanel import TaskUserPanel
from ddapp.tasks.taskuserpanel import ImageBasedAffordanceFit


import ddapp.tasks.robottasks as rt
import ddapp.tasks.taskmanagerwidget as tmw

import drc as lcmdrc

from PythonQt import QtCore, QtGui


class DoorDemo(object):

    def __init__(self, robotModel, footstepPlanner, manipPlanner, ikPlanner, lhandDriver, rhandDriver, atlasDriver, multisenseDriver, affordanceFitFunction, sensorJointController, planPlaybackFunction, showPoseFunction):
        self.robotModel = robotModel
        self.footstepPlanner = footstepPlanner
        self.manipPlanner = manipPlanner
        self.ikPlanner = ikPlanner
        self.lhandDriver = lhandDriver
        self.rhandDriver = rhandDriver
        self.atlasDriver = atlasDriver
        self.multisenseDriver = multisenseDriver
        self.affordanceFitFunction = affordanceFitFunction
        self.sensorJointController = sensorJointController
        self.planPlaybackFunction = planPlaybackFunction
        self.showPoseFunction = showPoseFunction
        self.graspingHand = 'right'

        self.endPose = None

        self.planFromCurrentRobotState = True
        self.visOnly = False
        self.useFootstepPlanner = False
        self.userPromptEnabled = True

        self.constraintSet = None
        self.plans = []

        self.pinchDistance = 0.1
        self.doorHandleFrame = None
        self.doorHandleGraspFrame = None
        self.doorHingeFrame = None

        self.handleTouchHeight = 0.09
        self.handleTouchDepth = -0.05
        self.handleTouchWidth = 0.03

        self.handleTurnHeight = -0.08
        self.handleTurnWidth = 0.01

        self.handleLiftHeight = 0.12
        self.handlePushDepth = 0.0
        self.handleOpenDepth = 0.1
        self.handleOpenWidth = 0.4

        self.setFootstepThroughDoorParameters()



    def addPlan(self, plan):
        self.plans.append(plan)


    def computeGroundFrame(self, robotModel):
        '''
        Given a robol model, returns a vtkTransform at a position between
        the feet, on the ground, with z-axis up and x-axis aligned with the
        robot pelvis x-axis.
        '''
        t1 = robotModel.getLinkFrame('l_foot')
        t2 = robotModel.getLinkFrame('r_foot')
        pelvisT = robotModel.getLinkFrame('pelvis')

        xaxis = [1.0, 0.0, 0.0]
        pelvisT.TransformVector(xaxis, xaxis)
{'fraction_non_alphanumeric': 0.054045801526717556, 'fraction_numerical': 0.010381679389312977, 'mean_word_length': 3.2594278283485045, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6860427', 'n_tokens_mistral': 1969, 'n_tokens_neox': 1826, 'n_words': 522}