Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/en/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
* [Missions](cpp/guide/missions.md)
* [Offboard Control](cpp/guide/offboard.md)
* [Follow Me](cpp/guide/follow_me.md)
* [Camera](cpp/guide/camera.md)
* [Gimbal](cpp/guide/gimbal.md)
* [VTOL Support](cpp/guide/vtol.md)
* [MavlinkDirect](cpp/guide/mavlink_direct.md)
* [Building C++ Apps](cpp/guide/toolchain.md)
* [Logging](cpp/guide/logging.md)
* [Plugin/Test Logging](cpp/guide/dev_logging.md)
* [Testing](cpp/guide/test.md)
* [Build on Linux](cpp/guide/build_linux.md)
* [Building on macOS](cpp/guide/build.md)
* [Building on macOS](cpp/guide/build_macos.md)
* [Building on Windows](cpp/guide/build_windows.md)
* [Building using Dockcross](cpp/guide/build_dockcross.md)
* [Generate API docs from Source](cpp/guide/build_docs.md)
Expand Down
48 changes: 19 additions & 29 deletions docs/en/cpp/contributing/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ You will need a [Github](https://github.com/) login to make and submit changes t

## Overview

This guide is written in [markdown](https://github.com/GitbookIO/gitbook/blob/master/docs/syntax/markdown.md) wiki syntax and stored in the Github [mavlink/MAVSDK-docs](https://github.com/mavlink/MAVSDK-docs) repo.
This guide is written in [markdown](https://vitepress.dev/guide/markdown) and stored in the Github [mavlink/MAVSDK](https://github.com/mavlink/MAVSDK) repository under the `docs/` folder.

The [API Reference](../api_reference/index.md) section is compiled from source code into markdown using a [separate toolchain](#api-reference) and then copied into Github.
Updates to the reference should be made in the [source code repository](https://github.com/mavlink/MAVSDK) (see [API Reference](#api-reference) below for more information).
The [API Reference](../api_reference/index.md) section is compiled from source code into markdown using a [separate toolchain](#api-reference) and then checked in.
Updates to the reference should be made in the [source code](https://github.com/mavlink/MAVSDK) (see [API Reference](#api-reference) below for more information).

The guide is licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) - if you make any changes then they will be made available under the same license.

Expand All @@ -21,45 +21,35 @@ The guide is licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/

Simple fixes to an existing page can be made directly on Github:

1. Click the **Edit** button in the top toolbar to open the page

![Edit page](../../../assets/site/gitbook_toolbar_edit.png)

1. Make required changes in the editor section near the top of the page.
2. At the bottom of the page, add a comment and select the second radio button to create a new branch.

![Edit page](../../../assets/site/github_edit.png)

3. Follow the on-screen instructions to create a pull request with your change.
1. Navigate to the relevant file in the [docs/en/](https://github.com/mavlink/MAVSDK/tree/main/docs/en) folder.
1. Click the pencil (edit) icon to open the file editor.
1. Make the required changes.
1. At the bottom of the page, enter a commit message and select **Create a new branch** to open a pull request.


## Raising an Issue

To raise an issue against the documentation:

1. Open the page with problem content.
1. Click the **Bug** button in the top toolbar.

![Raise bug](../../../assets/site/gitbook_toolbar_bug.png)

This will open a bug in Github, seeded with the URL/name for the current page.
1. Enter enough information for someone to understand the problem, and ideally to fix it.
To raise an issue against the documentation, open a [Github issue](https://github.com/mavlink/MAVSDK/issues) and include the page URL and a description of the problem.

TODO: still valid?

## Building the Docs Locally

## Making a Big Change
The docs use [VitePress](https://vitepress.dev/). To build and preview locally:

If you want to make more significant changes or additions to the documentation you will need to set up *Git* and the *Gitbook* toolchain (this allows you to render the documentation and check that links work).
```bash
cd docs
npm install
npm run dev
```

For setup information see: [Gitbook toolchain](https://github.com/GitbookIO/gitbook/blob/master/docs/setup.md).
This starts a local dev server at `http://localhost:5173`.


## API Reference

The C++ public header files are annotated using docstrings using [Doxygen](http://doxygen.nl/manual/index.html) syntax.
You can extract the documentation to markdown files (one per class) on macOS or Linux using the instructions in [Build API Reference Documentation](../guide/build_docs.md).

In order to include new API reference in the *SDK Documentation* it must be manually added to the [Github repository](https://github.com/mavlink/MAVSDK-docs):
- Copy the files into the [/en/cpp/api_reference](https://github.com/mavlink/MAVSDK-docs/tree/main/en/cpp/api_reference) folder
- *New* APIs should be added to appropriate sections in the [MAVSDK-docs/en/SUMMARY.md](https://github.com/mavlink/MAVSDK-docs/blob/main/en/SUMMARY.md) and [/en/cpp/api_reference/README.md](https://github.com/mavlink/MAVSDK-docs/blob/main/en/cpp/api_reference/README.md).
In order to include new API reference in the documentation:
- Copy the generated files into the [docs/en/cpp/api_reference](https://github.com/mavlink/MAVSDK/tree/main/docs/en/cpp/api_reference) folder
- *New* APIs should be added to the appropriate sections in [docs/en/SUMMARY.md](https://github.com/mavlink/MAVSDK/tree/main/docs/en/SUMMARY.md) and [docs/en/cpp/api_reference/index.md](https://github.com/mavlink/MAVSDK/tree/main/docs/en/cpp/api_reference/index.md).
2 changes: 1 addition & 1 deletion docs/en/cpp/contributing/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Once the proto file has been created, you can generate all files required for th

1. Run the configure step to prepare the tools required:
```
cmake -DBUILD_MAVSDK_SERVER=ON -Bbuild/default -S.
Comment thread
julianoes marked this conversation as resolved.
cmake -DBUILD_MAVSDK_SERVER=ON -B build/default -S .
```
1. Install `protoc_gen_mavsdk` which is required for the auto-generation:
```
Expand Down
23 changes: 6 additions & 17 deletions docs/en/cpp/contributing/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,12 @@ The idea is of course to automate this as much as possible.
- `brew bump-formula-pr mavsdk --tag=vX.Y.Z --revision=<GIT HASH>`
- This should then open the browser with the pull request already created.

## MAVSDK-docs part

1. [Generate the docs](../guide/build_docs.md) and update the reference docs.
1. Check or update the examples in the docs.
1. Create a branch off `main` for the release
- Create the branch
```
git switch main
git pull
git switch -c vX.Y
```
- Modify **book.json** in the vX.Y branch to change the value of `github_branch` to match the new branch: `"github_branch": "vX.Y"`
- Push the branch to the upstream repo
```
git push origin vX.Y
```
1. Add the branch to the version checker in main branch [book.json](https://github.com/mavlink/MAVSDK-docs/blob/main/book.json) (see pattern below `versions`).
## Documentation part

Documentation is now in-tree under the `docs/` folder in this repository, so it is released together with the code.

1. [Generate the API reference docs](../guide/build_docs.md) and commit any changes to `docs/en/cpp/api_reference/`.
1. Check or update the examples and guides in `docs/en/` as needed.

## Other

Expand Down
4 changes: 2 additions & 2 deletions docs/en/cpp/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ See [installation guide](../guide/installation.md) if that is not already the ca
Then build the example:
```sh
cd cpp/examples/takeoff_and_land/
cmake -Bbuild -S.
cmake -B build -S .
cmake --build build -j4
```

::: info
if MAVSDK is installed locally (e.g. on Windows) you need to pass the location to cmake:

```
cmake -Bbuild -DCMAKE_PREFIX_PATH=wherever_mavsdk_is_locally_installed
cmake -B build -DCMAKE_PREFIX_PATH=wherever_mavsdk_is_locally_installed
```
:::

Expand Down
4 changes: 2 additions & 2 deletions docs/en/cpp/examples/transition_vtol_fixed_wing.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ The operation of the transition code is discussed in the guide: [Takeoff and Lan

## Source code {#source_code}

- [CMakeLists.txt](https://github.com/JoC2000/MAVSDK/blob/main/cpp/examples/vtol_transition/CMakeLists.txt)
- [transition_vtol_fixed_wing.cpp](https://github.com/JoC2000/MAVSDK/blob/main/cpp/examples/vtol_transition/vtol_transition.cpp)
- [CMakeLists.txt](https://github.com/mavlink/MAVSDK/blob/main/cpp/examples/vtol_transition/CMakeLists.txt)
- [transition_vtol_fixed_wing.cpp](https://github.com/mavlink/MAVSDK/blob/main/cpp/examples/vtol_transition/vtol_transition.cpp)
6 changes: 3 additions & 3 deletions docs/en/cpp/guide/build_dockcross.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ docker run --rm dockcross/linux-armv7 > ./dockcross-linux-armv7
chmod +x ./dockcross-linux-armv7

# Use the script to run cmake and build
./dockcross-linux-armv7 bash -c 'cmake -DCMAKE_BUILD_TYPE=Release -Bbuild -S. && cmake --build build'
./dockcross-linux-armv7 bash -c 'cmake -DCMAKE_BUILD_TYPE=Release -B build -S . && cmake --build build'
```

## Building for Android
Expand Down Expand Up @@ -77,8 +77,8 @@ cmake \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-28 \
-DCMAKE_BUILD_TYPE=Release \
-Bbuild/android \
-S.
-B build/android \
-S .

cmake --build build/android
```
Expand Down
14 changes: 7 additions & 7 deletions docs/en/cpp/guide/build_linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ cd cpp

For development, use the debug build:
```bash
cmake -DCMAKE_BUILD_TYPE=Debug -Bbuild -S.
cmake -DCMAKE_BUILD_TYPE=Debug -B build -S .
cmake --build build -j8
```

### Release Build

For production use, build with optimizations enabled:
```bash
cmake -DCMAKE_BUILD_TYPE=Release -Bbuild -S.
cmake -DCMAKE_BUILD_TYPE=Release -B build -S .
cmake --build build -j8
```

Expand All @@ -62,7 +62,7 @@ sudo ldconfig # Update linker cache
To install to a custom location, e.g. `install`

```bash
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -Bbuild -S.
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -B build -S .
cmake --build build --target install
```

Expand All @@ -75,7 +75,7 @@ For more information about the architecture, also see [how the auto-generation w
In order to include the mavsdk_server in the build, add `-DBUILD_MAVSDK_SERVER=ON`:

```bash
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=ON -Bbuild -S.
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=ON -B build -S .
cmake --build build -j8
```

Expand Down Expand Up @@ -110,18 +110,18 @@ Examples:

```bash
# Build with development dialect
cmake -DCMAKE_BUILD_TYPE=Debug -DMAVLINK_DIALECT=development -Bbuild -S.
cmake -DCMAKE_BUILD_TYPE=Debug -DMAVLINK_DIALECT=development -B build -S .

# Use a custom MAVLink repository fork
cmake -DCMAKE_BUILD_TYPE=Debug \
-DMAVLINK_URL=https://github.com/yourfork/mavlink \
-DMAVLINK_HASH=abc123def456 \
-Bbuild -S.
-B build -S .

# Use local MAVLink XML files
cmake -DCMAKE_BUILD_TYPE=Debug \
-DMAVLINK_XML_PATH=/path/to/mavlink/message_definitions/v1.0 \
-Bbuild -S.
-B build -S .
```

## Building without Superbuild
Expand Down
10 changes: 5 additions & 5 deletions docs/en/cpp/guide/build_macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ cd cpp

For development, use the debug build:
```bash
cmake -DCMAKE_BUILD_TYPE=Debug -Bbuild -S.
cmake -DCMAKE_BUILD_TYPE=Debug -B build -S .
cmake --build build -j8
```

### Release Build

For production use, build with optimizations enabled:
```bash
cmake -DCMAKE_BUILD_TYPE=Release -Bbuild -S.
cmake -DCMAKE_BUILD_TYPE=Release -B build -S .
cmake --build build -j8
```

Expand All @@ -63,7 +63,7 @@ sudo cmake --build build --target install

To install to a local folder, e.g. `install`:
```bash
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -Bbuild -S.
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -B build -S .
cmake --build build --target install
```

Expand All @@ -72,14 +72,14 @@ cmake --build build --target install
To build for real iOS devices on macOS:

```bash
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=tools/ios.toolchain.cmake -DPLATFORM=OS -Bbuild/ios -S.
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=tools/ios.toolchain.cmake -DPLATFORM=OS -B build/ios -S .
cmake --build build/ios
```

Build for the iOS simulator on macOS:

```bash
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=tools/ios.toolchain.cmake -DPLATFORM=SIMULATOR64 -Bbuild/ios_simulator -S.
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=tools/ios.toolchain.cmake -DPLATFORM=SIMULATOR64 -B build/ios_simulator -S .
```

## Build Options
Expand Down
18 changes: 9 additions & 9 deletions docs/en/cpp/guide/build_windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Make sure to run this within the Visual Studio environment to access Ninja. You

For development, use the debug build:
```bash
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -Bbuild -S.
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -B build -S .
cmake --build build --config Debug
```

Expand All @@ -65,7 +65,7 @@ cmake --build build --config Debug
For production use, build with optimizations enabled:

```bash
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -S. -Bbuild
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -S . -B build
cmake --build build --config Release
```

Expand All @@ -87,15 +87,15 @@ Note that a `mavsdk.lib` built this way does not "contain" the dependencies it w
For instance, to build the examples, it looks like this:

```bash
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DWERROR=ON -Bbuild -S.
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DWERROR=ON -B build -S .
cmake --build build --config RelWithDebInfo --target install
```

And now the examples need both dependencies: mavsdk.lib but also its transitive dependencies:

```bash
cd examples
cmake -G"Ninja" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH="../install;../build/third_party/install" -DCMAKE_INSTALL_PREFIX=install -Bbuild -S.
cmake -G"Ninja" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH="../install;../build/third_party/install" -DCMAKE_INSTALL_PREFIX=install -B build -S .
cmake --build build
```

Expand All @@ -113,7 +113,7 @@ cmake --build build --target install

To install to a custom location:
```bash
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -Bbuild -S.
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -B build -S .
cmake --build build --target install
```

Expand All @@ -126,7 +126,7 @@ For more information about the architecture, also see [how the auto-generation w
In order to include the mavsdk_server in the build, add `-DBUILD_MAVSDK_SERVER=ON`. In order to avoid a linking issue on Windows (where more than 65535 objects are present, we need to build all static libraries like so:

```bash
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_MAVSDK_SERVER=ON -Bbuild -S.
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_MAVSDK_SERVER=ON -B build -S .
cmake --build build
```

Expand Down Expand Up @@ -157,7 +157,7 @@ rm -rf build

If you don't need http/https downloads for camera definition files or other component definition files, and you're not building the MAVSDK server (`BUILD_MAVSDK_SERVER=OFF`), you can exclude CURL and OpenSSL using:
```bash
cmake -GNinja -DBUILD_WITHOUT_CURL=ON -Bbuild -S.
cmake -GNinja -DBUILD_WITHOUT_CURL=ON -B build -S .
```

This eliminates the need for Perl/OpenSSL setup.
Expand All @@ -183,10 +183,10 @@ Ensure your application build configuration matches the MAVSDK library configura
2. **When building from source**: Use the same `CMAKE_BUILD_TYPE` for both MAVSDK and your application:
```bash
# For Debug applications
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -Bbuild -S.
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -B build -S .

# For Release applications
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -Bbuild -S.
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -B build -S .
```

3. **Mixed configurations are not supported**: Never link a Debug application against a Release MAVSDK library or vice versa on Windows.
Loading
Loading