当前位置: 首页>>代码示例>>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;未经允许,请勿转载。