機器人體驗筆記(三)進階

      網友投稿 611 2022-05-30

      全文內容來源于國外權威資料匯總整理,具體信息請查閱文末參考文獻。

      For specific information, please refer to the reference at the end of the article.

      編程重點 Code Points

      協程和異步,Coroutines & Asynchronous

      機器人體驗營筆記(三)進階

      并發和并行,Concurrency & parallelism

      asyncio — Asynchronous I/O

      思考案例:機器人在本體運動過程中轉動攝像頭,同時顯示表情并發出語音提示。

      Problem Case: The robot rotates the camera during the movement of the body, simultaneously displaying the expression and giving a voice prompt.

      有限狀態機?Finite State Machine(FSM)

      狀態機廣泛用于機器人編程,從LEGO Mindstorms(NXT-G)到ROS(Smach)。State machines are widely used in robot programming, from LEGO Mindstorms (NXT-G) to ROS (Smach).

      將控制邏輯(鏈接)與功能(節點)分開。Separates the control logic (links) from the functionality (nodes).

      清潔機器人通過傳感器識別地板、瓷磚或地毯,應用不同的清掃策略。The cleaning robot uses sensors to identify floors, tiles or carpets and apply different cleaning strategies.

      事件驅動結構,Event-Driven Architecture

      花式狀態機

      cozmo_fsm是一個分層、并行、消息傳遞狀態機形式:

      分層:狀態機可以嵌套。

      并行:可以同時激活多個狀態。

      消息傳遞:轉換可以將信息傳輸到其目標節點

      Fancy State Machines

      cozmo_fsm is a hierarchical, parallel, message passing state machine formalism:

      Hierarchical: state machines can nest.

      Parallel: multiple states can be active at the same time.

      Message passing: transitions can transmit information to their target nodes

      機器人前進或轉向后,位置的變化數據。The change in position and orientation data is output after the robot moves forward or turns.

      案例 demo:

      """

      The BackItUp demo illustrates the use of fork/join to launch

      parallel actions and synchronize them again. The fork is performed

      by the NullTrans transition with two destinations, while the join is

      performed by the CompletionTrans transition with two sources.

      Behavior: Cozmo backs up by 100 mm while simultaneously beeping. He

      uses DriveForward instead of Forward to avoid conflict with the Say

      action. When he's done backing up, he stops beeping and says 'Safety first'.

      """

      try:

      from cozmo_fsm import *

      except ImportError:

      raise ImportError("Can't find the cozmo_fsm package. Check your search path.")

      class BackItUp(StateMachineProgram):

      def setup(self):

      """

      launcher: StateNode() =N=> {driver, speaker}

      driver: Forward(-100,10)

      speaker: Say('beep',duration_scalar=0.8,abort_on_stop=True) =C=> speaker

      {driver,speaker} =C=> finisher: Say('Safety first!')

      """

      # Code generated by genfsm on Thu Feb 16 23:51:48 2017:

      launcher = StateNode() .set_name("launcher") .set_parent(self)

      driver = Forward(-100,10) .set_name("driver") .set_parent(self)

      speaker = Say('beep',duration_scalar=0.8,abort_on_stop=True) .set_name("speaker") .set_parent(self)

      finisher = Say('Safety first!') .set_name("finisher") .set_parent(self)

      nulltrans1 = NullTrans() .set_name("nulltrans1")

      nulltrans1 .add_sources(launcher) .add_destinations(driver,speaker)

      completiontrans1 = CompletionTrans() .set_name("completiontrans1")

      completiontrans1 .add_sources(speaker) .add_destinations(speaker)

      completiontrans2 = CompletionTrans() .set_name("completiontrans2")

      completiontrans2 .add_sources(driver,speaker) .add_destinations(finisher)

      return self

      particle_fiter_demo:

      立方體 cube

      tf:

      持續更新完善,時間標簽:2019-07-26。

      參考文獻references:

      Anki文檔:http://cozmosdk.anki.com/docs/

      cozmopedia:https://github.com/touretzkyds/cozmopedia/wiki

      認知機器人學:https://blog.csdn.net/ZhangRelay/article/details/86736743

      機器人

      版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。

      上一篇:華為云助力青島量谷科技打造移動物聯
      下一篇:海量小文件處理方式——facebook開源的Haystack(一)
      相關文章
      亚洲成aⅴ人片在线影院八| 亚洲一区精品视频在线| 亚洲av无码片在线播放| 国产精品久久亚洲一区二区| 亚洲中文字幕无码爆乳app| 亚洲国产日韩在线成人蜜芽| 色拍自拍亚洲综合图区| 亚洲AV无码久久精品蜜桃| 亚洲国产精品无码成人片久久| 亚洲无av在线中文字幕| 亚洲中文字幕久久精品无码喷水| 亚洲爽爽一区二区三区| 亚洲成?v人片天堂网无码| 亚洲av日韩aⅴ无码色老头| 青青青亚洲精品国产| 亚洲日韩国产一区二区三区| 亚洲AV永久无码精品网站在线观看 | 国产亚洲情侣久久精品| 国产成人人综合亚洲欧美丁香花| 亚洲hairy多毛pics大全| 欧美日韩亚洲精品| 青青青国产色视频在线观看国产亚洲欧洲国产综合 | 中文字幕亚洲一区| 亚洲人成中文字幕在线观看| 国产亚洲精品精品国产亚洲综合| 亚洲婷婷五月综合狠狠爱| 亚洲AV无码久久精品狠狠爱浪潮 | 亚洲Aⅴ在线无码播放毛片一线天| 色欲色欲天天天www亚洲伊| www亚洲精品少妇裸乳一区二区| 国产亚洲综合视频| 亚洲情侣偷拍精品| 亚洲人成色77777| 亚洲bt加勒比一区二区| 亚洲黄色免费网址| 日本亚洲精品色婷婷在线影院| 亚洲天然素人无码专区| yy6080久久亚洲精品| 中文字幕亚洲天堂| 久久青草亚洲AV无码麻豆| 五月天网站亚洲小说|