本文整理汇总了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)
示例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
示例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:
示例4: test_has_name
# 需要导入模块: import robot [as 别名]
# 或者: from robot import Robot [as 别名]
def test_has_name(self):
self.assertRegex(Robot().name, self.name_re)
示例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)
示例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
)