Openmct
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # opencmt設定 [toc] ## 開發環境 - [Git 筆記](https://hackmd.io/@aU_yFH-8SQCvwIIDNY3J7w/BysAOKNkd) - [Ubuntu 筆記](/MTYar05MRyeVyydxr4RFKw) - [JavaScript Define](https://requirejs.org/docs/api.html#define) - [JSON 懶人包](https://developer.mozilla.org/zh-TW/docs/Learn/JavaScript/Objects/JSON) - [OpenMCT官網](https://nasa.github.io/openmct/) - [Node JS Download](https://nodejs.org/en/) - [Node and npm update](https://www.geeksforgeeks.org/installation-of-node-js-on-linux/) - [Building Applications With Open MCT](https://hackmd.io/@isaPv93jQuix8iD4DT34kQ/H1RFoGRNO) - [Open MCT Integration Tutorials](https://hackmd.io/@isaPv93jQuix8iD4DT34kQ/Hy9jHYxru) ### 1.下載node.js ### 2.安裝git bash ### 3.建議使用vscode編輯 ### 4.下載PX4 ``` #git git clone https://github.com/PX4/PX4-Autopilot.git --recursive ``` ## 開始設定 ### 1.下載vis_frame (這是人家官方做好的教學包) 官方連結: ``` #git git clone https://gitlab.lrz.de/lls/vis-frame.git ``` [UAV mavlink to js python-script](https://drive.google.com/drive/folders/1pvtsyZ9Pnl29PyMCOieQXeIzCpiMvShI?usp=sharing) ### 2.製作Telemetry_Object ![](https://i.imgur.com/dGLLaQy.png) 1. 至vis-frame\python_scripts\Telemetry_Object_Generator 2. 編輯Telemetry_Object_Generater.py 3. 將telemetry_object_name改成飛行器的名字 4. 將UDP_PORT改成自己要傳給openmct的port 5. 除了generate_pythonScripts皆改為true ```#python generate_Dictionary = True generate_OpenMCT_object = True generate_server_object = True generate_pythonScripts = False ``` ### 3.下載另一個傳輸腳本 預設產生的傳輸腳本需經過misson planner [MavSDK ver2.0 連結](https://hackmd.io/q80yrkPCTuitar3Rv8Uf2w) ### 4.執行Telemetry_Object_Generater.py ![](https://i.imgur.com/UDHz4cS.png) 位置在vis-frame/python_scripts/Telemetry_Object_Generator 將會產生幾個不同的檔案 在openmct/example/飛行器的名字中會有兩個檔案 #### Plugin.js - Plugin的種類分為三種 ![](https://i.imgur.com/7vEdB7g.png) 更多資訊可以看 [Open MCT Integration Tutorials](https://hackmd.io/@isaPv93jQuix8iD4DT34kQ/Hy9jHYxru) 官方文件: [Github](https://github.com/nasa/openmct-tutorial) #### dictionary.json name是在openmct上所顯示的名稱 format是變數的型態 key是在傳輸腳本所用到的變數名稱,因此在選擇變數名稱後須將他寫入python腳本中 如下圖 ![](https://i.imgur.com/2tP8K6E.png) attribute | type | flags | notes --- | --- | --- | --- `key` | string | required | unique identifier for this field. `hints` | object | required | Hints allow views to intelligently select relevant attributes for display, and are required for most views to function. See section on "Value Hints" below. `name` | string | optional | a human readable label for this field. If omitted, defaults to `key`. `source` | string | optional | identifies the property of a datum where this value is stored. If omitted, defaults to `key`. `format` | string | optional | a specific format identifier, mapping to a formatter. If omitted, uses a default formatter. For enumerations, use `enum`. For timestamps, use `utc` if you are using utc dates, otherwise use a key mapping to your custom date format. `units` | string | optional | the units of this value, e.g. `km`, `seconds`, `parsecs` `min` | number | optional | the minimum possible value of this measurement. Will be used by plots, gauges, etc to automatically set a min value. `max` | number | optional | the maximum possible value of this measurement. Will be used by plots, gauges, etc to automatically set a max value. `enumerations` | array | optional | for objects where `format` is `"enum"`, this array tracks all possible enumerations of the value. Each entry in this array is an object, with a `value` property that is the numerical value of the enumeration, and a `string` property that is the text value of the enumeration. ex: `{"value": 0, "string": "OFF"}`. If you use an enumerations array, `min` and `max` will be set automatically for you. ## 定義plugin.js 編輯openmct/src/plugin/plugin.js 這個檔案定義了所有openmct要使用的plugin ### 1.檔案位置 在define後輸入plugin的檔案位置 ![](https://i.imgur.com/4FXQ6vn.png) ### 2.函式名稱 在function後輸入plugin名稱 ![](https://i.imgur.com/4By0ku4.png) ### 3.定義函式 ```#javasripts plugins.Aircraft_YEEPlugin = Aircraft_YEEPlugin; ``` 將Aircraft_YEE改成自己飛行器的名字 ![](https://i.imgur.com/HXXPIVz.png) ### 4. 將plugin安裝至openmct 編輯openmct/index.html 在程式碼後面添加 ```javascript openmct.install(function install(openmctAPI) {'//......'}); ``` eg: ```javascript openmct.install(openmct.plugins.Aircraft_YEEPlugin()); openmct.install(openmct.plugins.HistoricalTelemetryPlugin('Aircraft_YEE.telemetry', '/AircraftYEEHistory/', '0.0.0.0')); openmct.install(openmct.plugins.RealtimeTelemetryPlugin('Aircraft_YEE.telemetry', '/AircraftYEERealtime/', '0.0.0.0')); ``` /AircraftYEEHistory/ 為歷史資料 /AircraftYeeRealtine/ 為即時資料 後面的'localhost'定義了此plugin裝在位置為http://localhost:8002/openmct 的openmct API 須將其更改為'0.0.0.0'並開啟port與修改server.js才得以遠端存取 ![](https://i.imgur.com/qJ8wvxl.png) ### 5. 編輯OpenMCT_Telemetry_Server #### import由腳本所添加的檔案 到OpenMCT_Telemetry_Server/server.js 傳入檔案 ```#javasripts var Aircraft_YEE = require('./Aircraft_YEE'); ``` ![](https://i.imgur.com/cCOVyWP.png) #### 新增一個變數: ```#javasripts var aircraftYEE = new Aircraft_YEE; ``` #### 添加連接: ```#javascripts app.use('/AircraftYEERealtime', realtimeServerAircraftYEE); app.use('/AircraftYEEHistory', historyServerAircraftYEE); ``` ![](https://i.imgur.com/mZRLcHo.png) ## 開始測試 ### 打開模擬器 windows用jmavsim 在PX4-Autopilot中執行 ``` make px4_sitl jmavsim ``` linux用其他的 ### 開啟外部連線功能 至 openmct/app.js 將`'localhost'`改為`'0.0.0.0'` ![](https://i.imgur.com/pfkKppv.png) :qw 儲存並退出 ### 執行OpenMCT、OpenMCT_Telemetry_Server、Telemetry的腳本 ### 到localhost:8080 開始編輯介面 [Q-Ground 介面參考](https://docs.qgroundcontrol.com/master/en/FlyView/FlyView.html) ## 四元數 - w x y z - 角速度 : angularvelocityfrd: - (狀態顯示): class health: - class velocity x y z velocity - (壓力表) class ScaledPressure: absolutealtitude - 空速 推力 爬升速度 fixedwingMatrics ### 影片介面製作 vue 教學 https://cn.vuejs.org/v2/guide/ scss 教學 https://eddychang.me/learn-scss-in-15-mins/ 資料存放位置: openmct\src\ui\layout 面板(?) pane.vue / pane.scss 定義左側選單 mct-tree.vue / mct-tree.scss / tree-item.vue 定義左側選單搜尋欄 ![](https://i.imgur.com/3SspwKo.png) BrowseBar.vue 母集介面 layout.vue / layout. 定義本體 openmct\src\ui\components "創建的按鈕"![](https://i.imgur.com/jpP7GEd.png) createbutton.vue / CreateButton.scss

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully