-
Notifications
You must be signed in to change notification settings - Fork 0
3. Developer Guide
Developing a mod is very easy. Let's start by making a new directory and type
omm mod init
This will generate your manifest file manifest.yml
. This file must be placed in root of your folder
name: omm-my-mod # same as github project name
displayName: my mod
repoURL: https://github.com/myname/omm-my-mod
version: v0.8.13-1
publisher: my name
description: my first mod!
dependencies: # planned. not in use right now
- url: https://github.com/borgmon/some-UI-framework
version: v0.8.13-18
MMO works by injecting your code block into the source code.
For example, if you want to add a new param to selfdrive/common/params.cc
, find the line number you want to append to. For example line 177 line
Create the patch file by running
omm mod new selfdrive/common/params.cc
This will create an empty file with that path. Open newly created file and enter:
// >>>#177
{"MyNewParam", PERSISTENT},
The >>>
will tell omm which line to append after. Pretty neat yeah? You can add multiple code blocks like that in the same file. Also noticed the indentation? MMO will append the code block as-is so make sure it's right, especially for python scripts.(for python the comment token is #
, omm only cares about operands)
currently 2 operands are supported:
>>>
is for adding code block. For example,>>>#177
this will inject your code block between line 176 and 178, pushing original line 177 down.
---
is for deleting code block. this line will be removed. If you use>>>
for the same line, this line will be replaced.
Keep repeating step 2 until you finish all your changes.
Install your mod by go to openpilot dir and type
omm install {absolute path to your local mod}
MMO will create a new branch with the name omm-timestemp
, and commit all your changes here.
Here you can test your mod and see if it's working.
When you push your mod repo to github, you can publish your code by adding tags.
It has to be in this format:
{openpilot_version}-{mod_version}
for example v0.8.13-1.0
.
And you are done! Share your mod url and let people try it out!