{"id":15984431,"url":"https://github.com/unitech/mavlinkjs","last_synced_at":"2025-07-14T00:37:44.499Z","repository":{"id":42661721,"uuid":"276085730","full_name":"Unitech/mavlinkjs","owner":"Unitech","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-05T22:36:03.000Z","size":244,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T20:46:24.674Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Unitech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-30T11:57:54.000Z","updated_at":"2023-03-04T15:24:35.000Z","dependencies_parsed_at":"2024-10-30T09:02:28.095Z","dependency_job_id":null,"html_url":"https://github.com/Unitech/mavlinkjs","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"537fc917b3d9761677b16ff718f6d1c46fb6b9f9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Unitech/mavlinkjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unitech%2Fmavlinkjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unitech%2Fmavlinkjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unitech%2Fmavlinkjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unitech%2Fmavlinkjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Unitech","download_url":"https://codeload.github.com/Unitech/mavlinkjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unitech%2Fmavlinkjs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265228135,"owners_count":23731067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-08T02:08:24.925Z","updated_at":"2025-07-14T00:37:44.477Z","avatar_url":"https://github.com/Unitech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## MAVLINKJS\n\nWorking system to directly connect to a PX4 controller via USB with Raw Javascript.\nAll GRPC files are linked into this repository, ready to be used without any compilation steps.\n\n```bash\ngit clone https://github.com/Unitech/mavlinkjs.git\ncd mavlinkjs\nnpm install\nnode example.js\n```\n\nContent of example.js:\n\n```javascript\nvar SerialPort = require('serialport')\nvar message_registry = require('./assets/message-registry')\nvar node_mavlink = require('@ifrunistuttgart/node-mavlink')\nvar mavLink = new node_mavlink.MAVLinkModule(message_registry.messageRegistry)\n\nvar serialPort = new SerialPort('/dev/ttyACM0', {\n  baudRate: 1921600\n})\n\nserialPort.on('data', function (data) {\n  mavLink.parse(data)\n})\n\nmavLink.on('error', function (e) {\n  console.log(e)\n})\n\nmavLink.on('message', function (message) {\n  console.log(message)\n})\n```\n\nResult of running this will output this data at very high rate:\n\n```javascript\nLocalPositionNed {\n  _system_id: 1,\n  _component_id: 1,\n  _message_id: 32,\n  _message_name: 'LOCAL_POSITION_NED',\n  _crc_extra: 185,\n  _message_fields: [\n    [ 'time_boot_ms', 'uint32_t', false ],\n    [ 'x', 'float', false ],\n    [ 'y', 'float', false ],\n    [ 'z', 'float', false ],\n    [ 'vx', 'float', false ],\n    [ 'vy', 'float', false ],\n    [ 'vz', 'float', false ]\n  ],\n  time_boot_ms: 119908,\n  x: 0,\n  y: 0,\n  z: -0.502192497253418,\n  vx: 0.0037622619420289993,\n  vy: -0.021268177777528763,\n  vz: 0.043966297060251236\n}\nActuatorControlTarget {\n  _system_id: 1,\n  _component_id: 1,\n  _message_id: 140,\n  _message_name: 'ACTUATOR_CONTROL_TARGET',\n  _crc_extra: 181,\n  _message_fields: [\n    [ 'time_usec', 'uint64_t', false ],\n    [ 'controls', 'float', false ],\n    [ 'group_mlx', 'uint8_t', false ]\n  ],\n  time_usec: 119907157,\n  controls: -0.018576160073280334,\n  group_mlx: 227\n}\nScaledImu2 {\n  _system_id: 1,\n  _component_id: 1,\n  _message_id: 116,\n  _message_name: 'SCALED_IMU2',\n  _crc_extra: 76,\n  _message_fields: [\n    [ 'time_boot_ms', 'uint32_t', false ],\n    [ 'xacc', 'int16_t', false ],\n    [ 'yacc', 'int16_t', false ],\n    [ 'zacc', 'int16_t', false ],\n    [ 'xgyro', 'int16_t', false ],\n    [ 'ygyro', 'int16_t', false ],\n    [ 'zgyro', 'int16_t', false ],\n    [ 'xmag', 'int16_t', false ],\n    [ 'ymag', 'int16_t', false ],\n    [ 'zmag', 'int16_t', false ],\n    [ 'temperature', 'int16_t', true ]\n  ],\n  time_boot_ms: 119940,\n  xacc: -5,\n  yacc: -1,\n  zacc: -215,\n  xgyro: 14,\n  ygyro: 19,\n  zgyro: 8,\n  xmag: -384,\n  ymag: 9402,\n  zmag: -92\n}\nHeartbeat {\n  _system_id: 1,\n  _component_id: 1,\n  _message_id: 0,\n  _message_name: 'HEARTBEAT',\n  _crc_extra: 50,\n  _message_fields: [\n    [ 'custom_mode', 'uint32_t', false ],\n    [ 'type', 'uint8_t', false ],\n    [ 'autopilot', 'uint8_t', false ],\n    [ 'base_mode', 'uint8_t', false ],\n    [ 'system_status', 'uint8_t', false ],\n    [ 'mavlink_version', 'uint8_t', false ]\n  ],\n  custom_mode: 65536,\n  type: 2,\n  autopilot: 12,\n  base_mode: 81,\n  system_status: 3,\n  mavlink_version: 3\n}\nPing {\n  _system_id: 1,\n  _component_id: 1,\n  _message_id: 4,\n  _message_name: 'PING',\n  _crc_extra: 237,\n  _message_fields: [\n    [ 'time_usec', 'uint64_t', false ],\n    [ 'seq', 'uint32_t', false ],\n    [ 'target_system', 'uint8_t', false ],\n    [ 'target_component', 'uint8_t', false ]\n  ],\n  time_usec: 119960505,\n  seq: 116,\n  target_system: 0,\n  target_component: 0\n}\nGpsRawInt {\n  _system_id: 1,\n  _component_id: 1,\n  _message_id: 24,\n  _message_name: 'GPS_RAW_INT',\n  _crc_extra: 24,\n  _message_fields: [\n    [ 'time_usec', 'uint64_t', false ],\n    [ 'lat', 'int32_t', false ],\n    [ 'lon', 'int32_t', false ],\n    [ 'alt', 'int32_t', false ],\n    [ 'eph', 'uint16_t', false ],\n    [ 'epv', 'uint16_t', false ],\n    [ 'vel', 'uint16_t', false ],\n    [ 'cog', 'uint16_t', false ],\n    [ 'fix_type', 'uint8_t', false ],\n    [ 'satellites_visible', 'uint8_t', false ],\n    [ 'alt_ellipsoid', 'int32_t', true ],\n    [ 'h_acc', 'uint32_t', true ],\n    [ 'v_acc', 'uint32_t', true ],\n    [ 'vel_acc', 'uint32_t', true ],\n    [ 'hdg_acc', 'uint32_t', true ],\n    [ 'yaw', 'uint16_t', true ]\n  ],\n  time_usec: 119961265,\n  lat: 0,\n  lon: 0,\n  alt: -17000,\n  eph: 9999,\n  epv: 9999,\n  vel: 0,\n  cog: 0,\n  fix_type: 0,\n  satellites_visible: 0\n}\nAttitude {\n  _system_id: 1,\n  _component_id: 1,\n  _message_id: 30,\n  _message_name: 'ATTITUDE',\n  _crc_extra: 39,\n  _message_fields: [\n    [ 'time_boot_ms', 'uint32_t', false ],\n    [ 'roll', 'float', false ],\n    [ 'pitch', 'float', false ],\n    [ 'yaw', 'float', false ],\n    [ 'rollspeed', 'float', false ],\n    [ 'pitchspeed', 'float', false ],\n    [ 'yawspeed', 'float', false ]\n  ],\n  time_boot_ms: 119964,\n  roll: 0.008923572488129139,\n  pitch: -0.022306503728032112,\n  yaw: 2.5876522064208984,\n  rollspeed: -0.0006045978516340256,\n  pitchspeed: -0.0007540639489889145,\n  yawspeed: 0.00029691122472286224\n}\nHighresImu {\n  _system_id: 1,\n  _component_id: 1,\n  _message_id: 105,\n  _message_name: 'HIGHRES_IMU',\n  _crc_extra: 93,\n  _message_fields: [\n    [ 'time_usec', 'uint64_t', false ],\n    [ 'xacc', 'float', false ],\n    [ 'yacc', 'float', false ],\n    [ 'zacc', 'float', false ],\n    [ 'xgyro', 'float', false ],\n    [ 'ygyro', 'float', false ],\n    [ 'zgyro', 'float', false ],\n    [ 'xmag', 'float', false ],\n    [ 'ymag', 'float', false ],\n    [ 'zmag', 'float', false ],\n    [ 'abs_pressure', 'float', false ],\n    [ 'diff_pressure', 'float', false ],\n    [ 'pressure_alt', 'float', false ],\n    [ 'temperature', 'float', false ],\n    [ 'fields_updated', 'uint16_t', false ],\n    [ 'id', 'uint8_t', true ]\n  ],\n  time_usec: 119968657,\n  xacc: -0.2032364308834076,\n  yacc: -0.06762934476137161,\n  zacc: -9.82526683807373,\n  xgyro: 0.000703832134604454,\n  ygyro: 0.00020623020827770233,\n  zgyro: 0.0015877345576882362,\n  xmag: -0.7811354994773865,\n  ymag: -0.48602935671806335,\n  zmag: -0.6154966354370117,\n  abs_pressure: 100659,\n  diff_pressure: 0,\n  pressure_alt: 55.5970458984375,\n  temperature: 29.959999084472656,\n  fields_updated: 7167\n}\n```\n\n\n### Getting further\n\nTo be able to build the GRPC messages protos:\n\n#### pymavlink\n\nInstall pymavlink:\n```\ngit clone https://github.com/ArduPilot/pymavlink.git\nsudo apt-get install gcc python-dev libxml2-dev libxslt-dev\ncd pymavlink\nsudo pip2 install -U future lxml\n```\n\nEdit the generator file:\n```\ncd pymavlink\nemacs pymavlink/generator/mavgen_typescript.py\n# Replace node-mavlink to '@ifrunistuttgart/node-mavlink'\n```\n\n#### Retrieve messages_definitions\n\n```\ngit clone https://github.com/mavlink/mavlink.git\ncd ..\nmkdir assets\npython ./pymavlink/tools/mavgen.py -o ./assets --lang TypeScript --wire-protocol 2.0 mavlink/message_definitions/v1.0/ardupilotmega.xml\n```\n\nThis will generates all GRPC mavlink message definitions in `./assets/`\n\n```\ncd assets/\ntsc\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funitech%2Fmavlinkjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funitech%2Fmavlinkjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funitech%2Fmavlinkjs/lists"}