{"id":13651846,"url":"https://github.com/PX4/jMAVSim","last_synced_at":"2025-04-22T22:32:32.428Z","repository":{"id":33736640,"uuid":"37391254","full_name":"PX4/jMAVSim","owner":"PX4","description":"Simple multirotor simulator with MAVLink protocol support","archived":false,"fork":true,"pushed_at":"2024-03-18T14:51:36.000Z","size":89672,"stargazers_count":79,"open_issues_count":16,"forks_count":206,"subscribers_count":39,"default_branch":"main","last_synced_at":"2024-03-18T16:19:05.280Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"DrTon/jMAVSim","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PX4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-13T23:11:25.000Z","updated_at":"2024-02-24T16:04:29.000Z","dependencies_parsed_at":"2023-01-16T22:45:39.268Z","dependency_job_id":null,"html_url":"https://github.com/PX4/jMAVSim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PX4%2FjMAVSim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PX4%2FjMAVSim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PX4%2FjMAVSim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PX4%2FjMAVSim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PX4","download_url":"https://codeload.github.com/PX4/jMAVSim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250334122,"owners_count":21413513,"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-08-02T02:00:52.870Z","updated_at":"2025-04-22T22:32:29.061Z","avatar_url":"https://github.com/PX4.png","language":"Java","funding_links":[],"categories":["Simulation","Security \u0026 Safety 🪂"],"sub_categories":["Simulators 🌐"],"readme":"[![Build Status](https://travis-ci.org/PX4/jMAVSim.svg?branch=master)](https://travis-ci.org/PX4/jMAVSim)\n\nSimple multirotor simulator with MAVLink protocol support\n\n![screenshot](art/screenshot.png)\n\n### Installation ###\n\nRequirements:\n * Java 8 or newer (JDK, http://www.oracle.com/technetwork/java/javase/downloads/index.html)\n\n * Java3D and JOGL/JOAL jars, including native libs for Linux (i586/64bit), Windows (i586/64bit) and Mac OS (universal) already included in this repository, no need to install it.\n\n * libvecmath-java (for ubuntu)\n\nClone repository and initialize submodules:\n```\ngit clone https://github.com/PX4/jMAVSim.git\ncd ~/jMAVSIM\ngit submodule init\ngit submodule update\n```\n\nInstall prerequisites via HomeBrew:\n\n```\nbrew install ant\n```\n\nCreate a standalone runnable JAR file with all libraries included, copy supporting resources, and use a shorter command to execute:\n\n```\nant create_run_jar copy_res\ncd out/production\njava -Djava.ext.dirs= -jar jmavsim_run.jar [any jMAVSim options]\n```\n\nTo create a complete package ready for distribution, build the `distro` target (this will create `out/production/jMAVSim-distrib.zip`):\n\n```\nant distro\n```\n\nTo delete everything in the build folder `ant clean-all`.\n\n#### Alternate build / run / distribute\n\nCompile:\n```\nant\n```\n\nRun:\n```\njava -cp lib/*:out/production/jmavsim.jar me.drton.jmavsim.Simulator\n```\n\nSome shells (e.g. tcsh) will try to expand `*`, so use `\\*` instead:\n```\njava -cp lib/\\*:out/production/jmavsim.jar me.drton.jmavsim.Simulator\n```\n\nOn **Windows** use `;` instead of `:` in -cp:\n```\njava -cp lib/*;out/production/jmavsim.jar me.drton.jmavsim.Simulator\n```\n\n#### Key command ####\n\nViews:\n-    F    - First-person-view camera.\n-    S    - Stationary ground camera.\n-    G    - Gimbal camera.\n-    Z    - Toggle auto-zoom for Stationary camera.\n-   +/-   - Zoom in/out\n- 0/ENTER - Reset zoom to default.\n\nActions:\n-   Q   - Disable sim on MAV.\n-   I   - Enable sim on MAV.\n-   H   - Toggle HUD overlay.\n-   C   - Clear all messages on HUD.\n-   R   - Toggle data report sidebar.\n-   T   - Toggle data report updates.\n-   D   - Toggle sensor parameter control sidebar.\n-   F1  - Show this key commands reference.\n-   P   - Pause.\n-  ESC  - Exit jMAVSim.\n- SPACE - Reset vehicle \u0026 view to start position.\n\nManipulate Vehicle:\n-  ARROW KEYS      - Rotate around pitch/roll.\n-  END/PG-DN       - Rotate CCW/CW around yaw.\n-  SHIFT + ARROWS  - Move N/S/E/W.\n-  SHIFT + INS/DEL - Move Up/Down.\n-  NUMPAD 8/2/4/6  - Start/increase rotation rate around pitch/roll axis.\n-  NUMPAD 1/3      - Start/increase rotation rate around yaw axis.\n-  NUMPAD 5        - Stop all rotation.\n-  CTRL + NUMPAD 5 - Reset vehicle attitude, velocity, \u0026 accelleration.\n\nManipulate Environment:\n- ALT +\n    - ARROW KEYS      - Increase wind deviation in N/S/E/W direction.\n    - INS/DEL         - Increase wind deviation in Up/Down direction.\n    - NUMPAD 8/2/4/6  - Increase wind speed in N/S/E/W direction.\n    - NUMPAD 7/1      - Increase wind speed in Up/Down direction.\n    - NUMPAD 5        - Stop all wind and deviations.\n\n- CTRL+ Manipulate - Rotate/move/increase at a higher/faster rate.\n\n### Troubleshooting ###\n\n#### Java 3D\n\njMAVSim uses java3d library for visualization.\nIt was discontinued for long time, but now maintained again and uses JOGL backend.\nAll necessary jars with java classes and native binaries (Linux/Mac OS/Windows) included in this repo, no need to install java3d manually.\nBut need to make sure that java doesn't use any other deprecated version of java3d.\nFor more info related to java3d see this article: https://gouessej.wordpress.com/2012/08/01/java-3d-est-de-retour-java-3d-is-back/\n\nOn **Mac OS** java may use deprecated version of java3d as extension, if you get following error:\n```\nJavaVM WARNING: JAWT_GetAWT must be called after loading a JVM\nAWT not found\nException in thread \"main\" java.lang.NoClassDefFoundError: apple/awt/CGraphicsDevice\n\tat javax.media.j3d.GraphicsConfigTemplate3D.\u003cclinit\u003e(GraphicsConfigTemplate3D.java:55)\n...\n```\n\nThen add `-Djava.ext.dirs=` option to command line when starting:\n```\njava -Djava.ext.dirs= -cp lib/*:out/production/jmavsim.jar me.drton.jmavsim.Simulator\n```\n\n#### Serial port\n\nSerial port access is common problem. Make sure to hardcode correct port in Simulator.java:\n```\nserialMAVLinkPort.open(\"/dev/tty.usbmodem1\", 230400, 8, 1, 0);\n```\n(Baudrate for USB ACM ports (that PX4 uses) has no effect, you can use any value)\n\nUsually port is:\n```\nMac OS: /dev/tty.usbmodem1\nLinux: /dev/ttyACM0\nWindows: COM15\n```\n\nOn **Linux** you may also get `Permission denied` error, add your user to `dialout` group and relogin, or just run as root.\n\n#### UDP\n\nUDP port used to connect ground station, e.g. qgroundcontrol.\njMAVSim in this case works as bridge between ground station and autopilot (behavior can be configured of course).\nMake sure that jMAVSim and ground station use the same ports.\nIn qgroundcontrol (or another GCS) you also need to add target host in UDP port configuration (localhost:14555), so both ends will know to which port they should send UDP packets.\n\n### Development ###\n\nThe simulator configuration is hardcoded in file `src/me/drton/jmavsim/Simulator.java`. Critical settings like port names or IP addresses can be provided as commandline arguments.\n\nNew vehicle types (e.g. non standard multirotors configurations) can be added very easily.\n(But for fixed wing you will need some more aerodynamics knowledge).\nSee files under `src/me/drton/jmavsim/vehicle/` as examples.\n\nThe camera can be placed on any point, including gimabal, that can be controlled by autopilot, see `CameraGimbal2D` class and usage example (commented) in Simulator.java.\n\nSensors data can be replayed from real flight log, use `LogPlayerSensors` calss for this.\n\nCustom vehicle visual models in .obj format can be used, edit this line:\n```\nAbstractMulticopter vehicle = new Quadcopter(world, \"models/3dr_arducopter_quad_x.obj\", \"x\", 0.33 / 2, 4.0, 0.05, 0.005, gc);\n```\n\nCustom MAVLink protocols can be used, no any recompilation needed, just specify XML file instead of `custom.xml` here:\n```\nMAVLinkSchema schema = new MAVLinkSchema(\"mavlink/message_definitions/common.xml\");\n```\n\nIt's convenient to start the simulator from IDE. Free and powerful \"IntelliJ IDEA\" IDE recommended, project files for it are already included, just open project file `jMAVSim.ipr` and right-click -\u003e Run `Simulator`.\n\n\n### Exporting 3D vehicle models using Blender\n\nFor custom vehicles it might be desirable to export new 3D models. One way of doing so is using [Blender](https://www.blender.org/). To import an existing model from another application into blender, (e.g. [onshape](https://cad.onshape.com)), export to the Collada (`.dae`) file format.\n\nOnce the Collada file has been imported into blender, it is necessary to set the *Ambient* value in the shading property to `0.0` for all materials used. A value of `1.0` will produce white surfaces in jMAVSIM regardless of the material settings.\n\nWhen exporting from Blender, choose the `Wavefront (.obj)` file format. In the export dialogue, make the following changes:\n* Adjust the orientation of the model by specifying the `Forward` and `Up` directions. For example, if the z-axis in the Blender scene is pointing upwards, the correct setting for `Up:` would be `-Z up` for jMAVSIM.\n* Deselect \"Objects as OBJ Objects\" and select \"Objects as OBJ Groups\" instead. Otherwise jMAVSim will fail parsing the 3D model.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPX4%2FjMAVSim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPX4%2FjMAVSim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPX4%2FjMAVSim/lists"}