本文整理汇总了Python中Move.Move.get_motion_plan方法的典型用法代码示例。如果您正苦于以下问题:Python Move.get_motion_plan方法的具体用法?Python Move.get_motion_plan怎么用?Python Move.get_motion_plan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Move.Move
的用法示例。
在下文中一共展示了Move.get_motion_plan方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: explore
# 需要导入模块: from Move import Move [as 别名]
# 或者: from Move.Move import get_motion_plan [as 别名]
def explore(motor, buzzer):
'''
Function will initialize and execute a new "move"
Args:
motor(motor_obj): used to control robot movement
buzzer(buzzer_obj): signals start of exploration
'''
# Test output
print "Exploring (moving to a new location) ..."
# Beep to indicate begining of explore step
buzzer.play(5)
# Initialize new move object
move = Move()
# Vector of movement used
move.get_move_vector()
# Break down movement vector into motion primitives that robot can execute
move.get_motion_plan()
# Debug print move fields
print(str(move))
# Execute motion from given move primitives
for (direction, amount) in move.primitives:
print "Moving " + str(direction) + " " + str(amount)
motor.move_bot(direction, distance=amount)