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


Python PlanarTracker.followPath方法代碼示例

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


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

示例1: NaslabNetwork

# 需要導入模塊: from tracker import PlanarTracker [as 別名]
# 或者: from tracker.PlanarTracker import followPath [as 別名]
#!/usr/bin/env python

from tracker import PlanarTracker
from communication import NaslabNetwork
from actuate import ROS2DimActuate
from numpy import pi
from path_generator import PathGenerator


connection = NaslabNetwork()
act = ROS2DimActuate()
tracker = PlanarTracker(act.actuate, connection.getStates)

for i in range(10):
    tracker.goToPoint(1, 0)
    tracker.faceDirection(pi/2)
    path = PathGenerator(path_type='circle', speed=.3)
    tracker.followPath(path)
開發者ID:NASLab,項目名稱:GroundROS,代碼行數:20,代碼來源:follow_line.py

示例2: LabNavigation

# 需要導入模塊: from tracker import PlanarTracker [as 別名]
# 或者: from tracker.PlanarTracker import followPath [as 別名]

connection = LabNavigation()
act = ROS2DimActuate()
tracker = PlanarTracker(act.actuate, connection.getStates)
tracker.setID(0)
path = PathGenerator(path_type='two_lines', speed=.2)


sleep(2)

# tracker.goToPoint(0, -2)
#
# tracker.faceDirection(-pi/4)

start_location = path.getBeginning()
tracker.goToPoint(start_location[0]+.3, start_location[1])
sleep(1)
tracker.faceDirection(pi / 2)
sleep(1)
path.startNow()
_, x, y, _, _, _, _ = connection.getStates(0)
tracker.followPath(path, x - start_location[0], y - start_location[1])

# tracker.goToPoint(-2.5/10, -2.5)
# tracker.faceDirection(pi / 2)
# path.setVelocity = .3
# sleep(1)
# path.startNow()
# tracker.followTrajectory(path)
開發者ID:NASLab,項目名稱:GroundROS,代碼行數:31,代碼來源:tracking_performance_analysis.py


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