本文整理匯總了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
)