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


Python robot.Robot方法代碼示例

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


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

示例1: test_rest_name

# 需要導入模塊: import robot [as 別名]
# 或者: from robot import Robot [as 別名]
def test_rest_name(self):
        # Set a seed
        seed = "Totally random."

        # Initialize RNG using the seed
        random.seed(seed)

        # Call the generator
        robot = Robot()
        name = robot.name

        # Reinitialize RNG using seed
        random.seed(seed)

        # Call the generator again
        robot.reset()
        name2 = robot.name
        self.assertNotEqual(name, name2)
        self.assertRegex(name2, self.name_re) 
開發者ID:rootulp,項目名稱:exercism,代碼行數:21,代碼來源:robot_name_test.py

示例2: __init__

# 需要導入模塊: import robot [as 別名]
# 或者: from robot import Robot [as 別名]
def __init__(self):
        self.map = None
        self.start = None
        self.goal = None

        self.moves = [Move(0.1, 0),  # forward
                      Move(-0.1, 0),  # back
                      Move(0, 1.5708),  # turn left 90
                      Move(0, -1.5708)] # turn right 90
        self.robot = Robot(0.5, 0.5)
        self.is_working = False # Replace with mutex after all

        self.map_subscriber = rospy.Subscriber("map", OccupancyGrid, self.new_map_callback)
        self.start_subscriber = rospy.Subscriber("initialpose", PoseWithCovarianceStamped, self.new_start_callback)
        self.goal_subscriber = rospy.Subscriber("goal", PoseStamped, self.new_goal_callback)

        self.path_publisher = rospy.Publisher("trajectory", MarkerArray, queue_size=1)
        self.pose_publisher = rospy.Publisher("debug_pose", PoseStamped, queue_size=1)

        # what will be there. A module goes into variable. Isn't it too much memory consumption. Maybe I should assign function replan() to this variable?
        self.planner = planners.astar.replan 
開發者ID:LetsPlayNow,項目名稱:TrajectoryPlanner,代碼行數:23,代碼來源:trajectory_planner.py

示例3: run

# 需要導入模塊: import robot [as 別名]
# 或者: from robot import Robot [as 別名]
def run(self):
        ns = Pyro5.api.locate_ns()
        with self.pyrodaemon:
            with ns:
                uri = self.pyrodaemon.register(self.pyroserver)
                ns.register("example.robotserver", uri)
                print("Pyro server registered on %s" % self.pyrodaemon.locationStr)
                self.pyrodaemon.requestLoop()


# register the Robot class with Pyro's serializers: 
開發者ID:irmen,項目名稱:Pyro5,代碼行數:13,代碼來源:gameserver.py

示例4: test_has_name

# 需要導入模塊: import robot [as 別名]
# 或者: from robot import Robot [as 別名]
def test_has_name(self):
        self.assertRegex(Robot().name, self.name_re) 
開發者ID:rootulp,項目名稱:exercism,代碼行數:4,代碼來源:robot_name_test.py

示例5: test_name_sticks

# 需要導入模塊: import robot [as 別名]
# 或者: from robot import Robot [as 別名]
def test_name_sticks(self):
        robot = Robot()
        robot.name
        self.assertEqual(robot.name, robot.name) 
開發者ID:rootulp,項目名稱:exercism,代碼行數:6,代碼來源:robot_name_test.py

示例6: test_different_robots_have_different_names

# 需要導入模塊: import robot [as 別名]
# 或者: from robot import Robot [as 別名]
def test_different_robots_have_different_names(self):
        self.assertNotEqual(
            Robot().name,
            Robot().name
        ) 
開發者ID:rootulp,項目名稱:exercism,代碼行數:7,代碼來源:robot_name_test.py


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