當前位置: 首頁>>代碼示例>>Python>>正文


Python CSpace.feasible方法代碼示例

本文整理匯總了Python中klampt.cspace.CSpace.feasible方法的典型用法代碼示例。如果您正苦於以下問題:Python CSpace.feasible方法的具體用法?Python CSpace.feasible怎麽用?Python CSpace.feasible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在klampt.cspace.CSpace的用法示例。


在下文中一共展示了CSpace.feasible方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: feasible

# 需要導入模塊: from klampt.cspace import CSpace [as 別名]
# 或者: from klampt.cspace.CSpace import feasible [as 別名]
    def feasible(self,q):



        #TODO: implement me
        #the default simply checks if q is within the bounds
        return CSpace.feasible(self,q)
開發者ID:ChenyuLInx,項目名稱:ece490-s2016,代碼行數:9,代碼來源:hw4_planner.py

示例2: feasible

# 需要導入模塊: from klampt.cspace import CSpace [as 別名]
# 或者: from klampt.cspace.CSpace import feasible [as 別名]
    def feasible(self,q):
        if len(q) != len(self.bound):
            # print len(q), len(self.bound)
            qnew = q[0:len(self.bound)]
            q=qnew
        for i in range(len(q)):
            # print "q", i, q[i], self.bound[i][0], self.bound[i][1]
            if (q[i] < self.bound[i][0]) :
                print "Joint #",self.limb_indices[i],"(",q[i],") out of limits (min:",self.bound[i][0],")"
                print "Changed joint value to its minimum"
                q[i] = self.bound[i][0]

            if (q[i] > self.bound[i][1]) :
                print "Joint #",self.limb_indices[i],"(",q[i],") out of limits (max:",self.bound[i][1],")"
                print "Changed joint value to its maximum"
                q[i] = self.bound[i][1]

        if not CSpace.feasible(self,q):
            # print "LimbCSpace.feasible: Configuration is out of bounds"
            return False

        # cond = self.planner.check_limb_collision_free(self.limb,q)
        # if not cond:
        if not self.planner.check_limb_collision_free(self.limb,q):
            # print "LimbCSpace.feasible: Configuration is in collision"
            return False
        return True
開發者ID:duke-iml,項目名稱:ece490-s2016,代碼行數:29,代碼來源:motionPlanner.py

示例3: feasible

# 需要導入模塊: from klampt.cspace import CSpace [as 別名]
# 或者: from klampt.cspace.CSpace import feasible [as 別名]
 def feasible(self,q):
     if not CSpace.feasible(self,q):
         # print "LimbCSpace.feasible: Configuration is out of bounds"
         return False
     if not self.planner.check_limb_collision_free(self.limb,q):
             # print "LimbCSpace.feasible: Configuration is in collision"
             return False
     return True
開發者ID:duke-iml,項目名稱:ece490-s2016,代碼行數:10,代碼來源:hw4_planner_impl.py

示例4: feasible

# 需要導入模塊: from klampt.cspace import CSpace [as 別名]
# 或者: from klampt.cspace.CSpace import feasible [as 別名]
 def feasible(self,q):
     #bounds test
     if not CSpace.feasible(self,q): return False
     #TODO: Problem 1: implement your feasibility tests here
     #currently, only the center is checked, so the robot collides
     #with boundary and obstacles
     for o in self.obstacles:
         if o.contains(q): return False
     return True
開發者ID:haewon-mit,項目名稱:Klampt,代碼行數:11,代碼來源:ex.py

示例5: feasible

# 需要導入模塊: from klampt.cspace import CSpace [as 別名]
# 或者: from klampt.cspace.CSpace import feasible [as 別名]
 def feasible(self, q):
     # TODO: implement me
     # the default simply checks if q is within the bounds
     # check if the q is within the bounds
     if CSpace.feasible(self, q):
         if self.planner.check_limb_collision_free(self.limb, q, True):
             return True
         else:
             return False
     else:
         return False
開發者ID:duke-iml,項目名稱:ece490-s2016,代碼行數:13,代碼來源:hw4_planner.py

示例6: feasible

# 需要導入模塊: from klampt.cspace import CSpace [as 別名]
# 或者: from klampt.cspace.CSpace import feasible [as 別名]
 def feasible(self,q):
     verbose = False#len(self.extra_feasibility_tests)>0
     if verbose: print "Custom CSpace test"
     if not CSpace.feasible(self,q):
         if verbose: print "Failed CSpace test"
         return False
     for index,test in enumerate(self.extra_feasibility_tests):
         if not test(q):
             if verbose: print "Extra feasibility test",index,"returned false, returning configuration infeasible"
             return False
     if verbose: print "Passed"
     return True
開發者ID:duke-iml,項目名稱:ece490-s2016,代碼行數:14,代碼來源:planner.py

示例7: feasible

# 需要導入模塊: from klampt.cspace import CSpace [as 別名]
# 或者: from klampt.cspace.CSpace import feasible [as 別名]
    def feasible(self,q):
        if not CSpace.feasible(self,q):
            #print "LimbCSpace.feasible: Configuration is out of bounds"
            return False
        if not self.planner.check_limb_collision_free(self.limb,q):
            #print "LimbCSpace.feasible: Configuration is in collision"
            return False

        for i in xrange(self.planner.world.numRigidObjects()):
            o = self.planner.world.rigidObject(i)
            g = o.geometry()
            if g != None and g.type()!="":
                if self.planner.vacuumPc.withinDistance(g, .03):
                    return False
        return True
開發者ID:duke-iml,項目名稱:ece490-s2016,代碼行數:17,代碼來源:planning.py

示例8: feasible

# 需要導入模塊: from klampt.cspace import CSpace [as 別名]
# 或者: from klampt.cspace.CSpace import feasible [as 別名]
    def feasible(self,q):
        # set robot to given q
        # get joint 55 orientation
        # if rotation is not right, return false

        qcurrent = self.robot.getConfig()
        if len(q) < len(qcurrent):
            if len(self.limb_indices) != len(q):
                return False
            else:
                for i in range(len(self.limb_indices)):
                    qcurrent[self.limb_indices[i]] = q[i]
                q = qcurrent

        # self.robot.setConfig(q)
        # Rcur = self.robot.link(55).getTransform()[0]
        # # Rgoal


        # if len(q)>len(self.limb_indices): return False
        # for i in range(len(q)):
        #     # print "q", i, q[i], self.bound[i][0], self.bound[i][1]
        #     # print self.limb, self.limb_indices, i, len(q)
        #     if (q[i] < self.bound[i][0]) :
        #         print "Joint #",self.limb_indices[i],"(",q[i],") out of limits (min:",self.bound[i][0],")"
        #         print "Changed joint value to its minimum"
        #         q[i] = self.bound[i][0]

        #     if (q[i] > self.bound[i][1]) :
        #         print "Joint #",self.limb_indices[i],"(",q[i],") out of limits (max:",self.bound[i][1],")"
        #         print "Changed joint value to its maximum"
        #         q[i] = self.bound[i][1]

        # print 1
        # # self.robot.setConfig(q)
        # # return AdaptiveCSpace.feasible(self,q)

        # print 2
        # if not self.inJointLimits(q): return False

        # print 3
        # self.robot.setConfig(q)
        # if not self.closedLoop(): return False;

        # #check extras
        # print 4
        # for f in self.extraFeasibilityTesters:
        #     if not f(q): return False

        # print 5
        # #check collisions
        # if self.selfCollision(): return False

        # print 6
        # if self.envCollision(): return False
        # return True



        if not CSpace.feasible(self,q):
            print "CSpace.feasible: Configuration is out of bounds"
            return False

        if not self.planner.check_collision_free(self.limb,q):
            # print "ClosedLoopRobotCSpace.feasible: Configuration is in collision"
            return False
        return True
開發者ID:duke-iml,項目名稱:ece490-s2016,代碼行數:69,代碼來源:motionPlanner_noClosedLoop.py


注:本文中的klampt.cspace.CSpace.feasible方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。