Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ mavlink-headers


# vitepress - Docs guide
docs/node_modules/
docs/.vitepress/cache/
docs/.vitepress/dist/
cpp/docs/node_modules/
cpp/docs/.vitepress/cache/
cpp/docs/.vitepress/dist/

# Fuzzing
fuzz_corpus
4 changes: 2 additions & 2 deletions cpp/docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export default defineConfig({
pattern: ({ filePath, frontmatter }) => {
if (frontmatter.newEditLink) {
//newEditLink defines a frontmatter key you can use to append a path to main
return `https://github.com/mavlink/MAVSDK/edit/main/docs/${frontmatter.newEditLink}`;
return `https://github.com/mavlink/MAVSDK/edit/main/cpp/docs/${frontmatter.newEditLink}`;
} else {
return `https://github.com/mavlink/MAVSDK/edit/main/docs/${filePath}`;
return `https://github.com/mavlink/MAVSDK/edit/main/cpp/docs/${filePath}`;
}
},
text: "Edit on GitHub",
Expand Down
4 changes: 2 additions & 2 deletions cpp/docs/en/cpp/contributing/autogen.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The main parts are:

* [`protoc-gen-mavsdk`](https://github.com/mavlink/MAVSDK-Proto/tree/main/pb_plugins), which is a `protoc` custom plugin generating MAVSDK's code.
* [The API definition](https://github.com/mavlink/MAVSDK-Proto/tree/main/protos), in the form of proto files.
* Template files (per language, see e.g. the [Python templates](https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py) or the [C++ templates](https://github.com/mavlink/MAVSDK/tree/main/templates)).
* Template files (per language, see e.g. the [Python templates](https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py) or the [C++ templates](https://github.com/mavlink/MAVSDK/tree/main/cpp/templates)).


`protoc` takes the custom plugin (`protoc-gen-mavsdk`) and the template files as inputs, and generate source code out of it.
Expand All @@ -50,7 +50,7 @@ In some languages (typically C++), we need to generate multiple source files out

All the MAVSDK repositories contain some kind of `generate_from_proto.sh` file, and a `templates/` directory:

* MAVSDK-C++: [script](https://github.com/mavlink/MAVSDK/blob/main/tools/generate_from_protos.sh), [templates](https://github.com/mavlink/MAVSDK/tree/main/templates)
* MAVSDK-C++: [script](https://github.com/mavlink/MAVSDK/blob/main/cpp/tools/generate_from_protos.sh), [templates](https://github.com/mavlink/MAVSDK/tree/main/cpp/templates)
* MAVSDK-Python: [script](https://github.com/mavlink/MAVSDK-Python/blob/main/other/tools/run_protoc.sh), [templates](https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py)
* MAVSDK-Swift: [script](https://github.com/mavlink/MAVSDK-Swift/blob/main/Sources/Mavsdk/tools/generate_from_protos.bash), [templates](https://github.com/mavlink/MAVSDK-Swift/tree/main/Sources/Mavsdk/templates)
* MAVSDK-Java: [script](https://github.com/mavlink/MAVSDK-Java/blob/983b361aa42b9088abbf17037d762ac174b44308/sdk/build.gradle#L54-L73), [templates](https://github.com/mavlink/MAVSDK-Java/tree/main/sdk/templates)
Expand Down
2 changes: 1 addition & 1 deletion cpp/docs/en/cpp/contributing/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ You can extract the documentation to markdown files (one per class) on macOS or

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/index.md](https://github.com/mavlink/MAVSDK-docs/blob/main/en/cpp/api_reference/index.md).
- *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).
6 changes: 3 additions & 3 deletions cpp/docs/en/cpp/contributing/plugins.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Writing Plugins

MAVSDK-C++ is split into a [core](https://github.com/mavlink/MAVSDK/tree/main/src/core) and multiple independent [plugins](https://github.com/mavlink/MAVSDK/tree/main/src/mavsdk/plugins).
MAVSDK-C++ is split into a [core](https://github.com/mavlink/MAVSDK/tree/main/cpp/src/mavsdk/core) and multiple independent [plugins](https://github.com/mavlink/MAVSDK/tree/main/cpp/src/mavsdk/plugins).

Plugins that are located in the *correct location* (a subfolder of **/plugins**) and have the *correct structure* are built at compile time.
The [CMakeLists.txt](https://github.com/mavlink/MAVSDK/blob/main/CMakeLists.txt) takes care of including the plugin folders.
The [CMakeLists.txt](https://github.com/mavlink/MAVSDK/blob/main/cpp/CMakeLists.txt) takes care of including the plugin folders.

## Plugin Architecture

Expand Down Expand Up @@ -211,7 +211,7 @@ All implementation goes into the files `my_new_plugin_impl.h` and `my_new_plugin

You can also add unit tests with `unittest_source_files`, as [discussed below](#adding_unit_tests).

The [standard plugins](https://github.com/mavlink/MAVSDK/tree/main/src/plugins) can be reviewed for guidance on
The [standard plugins](https://github.com/mavlink/MAVSDK/tree/main/cpp/src/mavsdk/plugins) can be reviewed for guidance on
how to write plugin code, including how to send and process MAVLink messages.

## Plugin Code
Expand Down
6 changes: 3 additions & 3 deletions cpp/docs/en/cpp/examples/autopilot_server.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example: Autopilot Server

The [Autopilot Server](https://github.com/mavlink/MAVSDK/tree/main/examples/autopilot_server) example creates two instances of MAVSDK, representing a client (GCS) and a server (Vehicle).
The [Autopilot Server](https://github.com/mavlink/MAVSDK/tree/main/cpp/examples/autopilot_server) example creates two instances of MAVSDK, representing a client (GCS) and a server (Vehicle).
The MAVSDK instances communicates with each other via UDP transmitting telemetry, publishing parameters, missions and takeoff commands.

::: info
Expand Down Expand Up @@ -256,5 +256,5 @@ system, without the need for a separate external autopilot.

## Source code {#source_code}

- [CMakeLists.txt](https://github.com/mavlink/MAVSDK/blob/main/examples/autopilot_server/CMakeLists.txt)
- [autopilot_server.cpp](https://github.com/mavlink/MAVSDK/blob/main/examples/autopilot_server/autopilot_server.cpp)
- [CMakeLists.txt](https://github.com/mavlink/MAVSDK/blob/main/cpp/examples/autopilot_server/CMakeLists.txt)
- [autopilot_server.cpp](https://github.com/mavlink/MAVSDK/blob/main/cpp/examples/autopilot_server/autopilot_server.cpp)
6 changes: 3 additions & 3 deletions cpp/docs/en/cpp/examples/fly_mission.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example: Fly Mission

The [Fly Mission](https://github.com/mavlink/MAVSDK/tree/main/examples/fly_mission) example shows how to create, upload, and run, pause, and restart missions using the SDK.
The [Fly Mission](https://github.com/mavlink/MAVSDK/tree/main/cpp/examples/fly_mission) example shows how to create, upload, and run, pause, and restart missions using the SDK.

![Fly Mission QGC Screenshot](../../../assets/examples/fly_mission/fly_mission_example_qgc.jpg)

Expand Down Expand Up @@ -99,5 +99,5 @@ The operation of most of this code is discussed in the guide: [Missions](../guid

## Source code {#source_code}

- [CMakeLists.txt](https://github.com/mavlink/MAVSDK/blob/main/examples/fly_mission/CMakeLists.txt)
- [fly_mission.cpp](https://github.com/mavlink/MAVSDK/blob/main/examples/fly_mission/fly_mission.cpp)
- [CMakeLists.txt](https://github.com/mavlink/MAVSDK/blob/main/cpp/examples/fly_mission/CMakeLists.txt)
- [fly_mission.cpp](https://github.com/mavlink/MAVSDK/blob/main/cpp/examples/fly_mission/fly_mission.cpp)
6 changes: 3 additions & 3 deletions cpp/docs/en/cpp/examples/follow_me.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Special notes for this example:
sudo apt-get install libboost-all-dev
```
* To use *QGroundControl* with this example you **must** ensure that *GSC Position Streaming* is disabled (otherwise QGC and the SDK will both send position updates and they will conflict).
To do this use the latest *QGC Daily Build* and ensure that the **[Application Setting > General](https://docs.qgroundcontrol.com/en/SettingsView/General.html) > Miscellaneous > Stream GCS Position** is set to *Never*.
To do this use the latest *QGC Daily Build* and ensure that the **[Application Setting > General](https://docs.qgroundcontrol.com/Stable_V5.0/en/qgc-user-guide/settings_view/general.html) > Miscellaneous > Stream GCS Position** is set to *Never*.

Otherwise the example is built and run in the normal way ([as described here](../examples/index.md#trying_the_examples)).

Expand Down Expand Up @@ -114,5 +114,5 @@ The operation of the "SDK-specific" part of this code is discussed in the guide:

## Source code {#source_code}

- [CMakeLists.txt](https://github.com/mavlink/MAVSDK/blob/main/examples/follow_me/CMakeLists.txt)
- [follow_me.cpp](https://github.com/mavlink/MAVSDK/blob/main/examples/follow_me/CMakeLists.txt)
- [CMakeLists.txt](https://github.com/mavlink/MAVSDK/blob/main/cpp/examples/follow_me/CMakeLists.txt)
- [follow_me.cpp](https://github.com/mavlink/MAVSDK/blob/main/cpp/examples/follow_me/CMakeLists.txt)
34 changes: 17 additions & 17 deletions cpp/docs/en/cpp/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ This section contains examples showing how to use MAVSDK.

Example | Description
--- | ---
[Battery](https://github.com/mavlink/MAVSDK/tree/main/examples/battery) | Simple example to demonstrate how to imitate a smart battery.
[Calibrate](https://github.com/mavlink/MAVSDK/tree/main/examples/calibrate) | Simple example showing how to initiate calibration of gyro, accelerometer, magnetometer.
[Battery](https://github.com/mavlink/MAVSDK/tree/main/cpp/examples/battery) | Simple example to demonstrate how to imitate a smart battery.
[Calibrate](https://github.com/mavlink/MAVSDK/tree/main/cpp/examples/calibrate) | Simple example showing how to initiate calibration of gyro, accelerometer, magnetometer.
[Fly Mission](../examples/fly_mission.md) | Shows how to create, upload, and run missions.
[Fly Multiple Drones](https://github.com/mavlink/MAVSDK/tree/main/examples/fly_multiple_drones) | Example to connect multiple vehicles and make them follow their own separate plan file. Also saves the telemetry information to CSV files.
[Fly Multiple Drones](https://github.com/mavlink/MAVSDK/tree/main/cpp/examples/fly_multiple_drones) | Example to connect multiple vehicles and make them follow their own separate plan file. Also saves the telemetry information to CSV files.
[Follow Me Mode](../examples/follow_me.md) | Demonstrates how to put vehicle in [Follow Me Mode](../guide/follow_me.md) and set the current target position and relative position of the drone.
[GeoFence Inclusion](https://github.com/mavlink/MAVSDK/tree/main/examples/geofence_inclusion) | Demonstrates how to define and upload a simple polygonal inclusion GeoFence.
[MAVShell](https://github.com/mavlink/MAVSDK/tree/main/examples/mavshell) | Creates and starts an interactive shell session.
[MAVLink FTP Client](https://github.com/mavlink/MAVSDK/tree/main/examples/ftp_client) | Demonstrates how to create/use a [MAVLink FTP client](https://mavlink.io/en/services/ftp.html).
[MAVLink FTP Server](https://github.com/mavlink/MAVSDK/tree/main/examples/ftp_server) | Demonstrates how to start/set up a [MAVLink FTP server](https://mavlink.io/en/services/ftp.html).
[Multiple Drones](https://github.com/mavlink/MAVSDK/tree/main/examples/multiple_drones) | Example to connect multiple vehicles and make them take off and land in parallel.
[GeoFence Inclusion](https://github.com/mavlink/MAVSDK/tree/main/cpp/examples/geofence) | Demonstrates how to define and upload a simple polygonal inclusion GeoFence.
[MAVShell](https://github.com/mavlink/MAVSDK/tree/main/cpp/examples/mavshell) | Creates and starts an interactive shell session.
[MAVLink FTP Client](https://github.com/mavlink/MAVSDK/tree/main/cpp/examples/ftp_client) | Demonstrates how to create/use a [MAVLink FTP client](https://mavlink.io/en/services/ftp.html).
[MAVLink FTP Server](https://github.com/mavlink/MAVSDK/tree/main/cpp/examples/ftp_server) | Demonstrates how to start/set up a [MAVLink FTP server](https://mavlink.io/en/services/ftp.html).
[Multiple Drones](https://github.com/mavlink/MAVSDK/tree/main/cpp/examples/multiple_drones) | Example to connect multiple vehicles and make them take off and land in parallel.
[Offboard Velocity Control](../examples/offboard_velocity.md) | Demonstrates how to control a vehicle in Offboard mode using velocity commands (in both the NED and body frames).
[Takeoff and Land](../examples/takeoff_and_land.md) | Shows basic usage of the SDK (connect to port, detect system (vehicle), arm, takeoff, land, get telemetry)
[VTOL Transitions](../examples/transition_vtol_fixed_wing.md) | Shows how to transition a VTOL vehicle between copter and fixed-wing modes.
[Tune](https://github.com/mavlink/MAVSDK/tree/main/examples/tune) | Shows how to construct and play a tune.
[Tune](https://github.com/mavlink/MAVSDK/tree/main/cpp/examples/tune) | Shows how to construct and play a tune.

The examples are "largely" built and run in the same way, as described in the following section (any exceptions are covered in the page for the associated example).

Expand All @@ -32,7 +32,7 @@ Care should be taken if using them on a real vehicle.

## Trying the Examples {#trying_the_examples}

The easiest way to test the examples is to use a [simulated PX4 vehicle](https://docs.px4.io/master/en/simulation/) that is running on the same computer.
The easiest way to test the examples is to use a [simulated PX4 vehicle](https://docs.px4.io/main/en/simulation/) that is running on the same computer.
First start PX4 in SITL (Simulation), optionally start *QGroundControl* to observe the vehicle, then build and run the example code.

::: info
Expand All @@ -43,26 +43,26 @@ The examples connect to this port using either [add_any_connection()](../api_ref

### Setting up a Simulator

PX4 supports a [number of simulators](https://docs.px4.io/master/en/simulation/).
In order to set up the [jMAVSim](https://docs.px4.io/master/en/simulation/jmavsim.html) or [Gazebo](https://docs.px4.io/master/en/simulation/gazebo.html) simulator, you can simply follow the standard PX4 toolchain setup instructions for [macOS](https://docs.px4.io/master/en/dev_setup/dev_env_mac.html) or [Ubuntu Linux](https://docs.px4.io/master/en/dev_setup/dev_env_linux_ubuntu.html).
PX4 supports a [number of simulators](https://docs.px4.io/main/en/simulation/).
In order to set up the [jMAVSim](https://docs.px4.io/main/en/sim_jmavsim/) or [Gazebo](https://docs.px4.io/main/en/sim_gazebo_gz/) simulator, you can simply follow the standard PX4 toolchain setup instructions for [macOS](https://docs.px4.io/main/en/dev_setup/dev_env_mac.html) or [Ubuntu Linux](https://docs.px4.io/main/en/dev_setup/dev_env_linux_ubuntu.html).

::: info
JMAVSim can only be used to simulate multicopters.
Gazebo additionally supports a number of [other vehicles](https://docs.px4.io/master/en/simulation/gazebo.html#html#running-the-simulation) (e.g. VTOL, Rovers, fixed-wing etc.).
Gazebo additionally supports a number of [other vehicles](https://docs.px4.io/main/en/sim_gazebo_gz/#running-the-simulation) (e.g. VTOL, Rovers, fixed-wing etc.).
:::

After running a standard installation, a simulation can be started from the PX4 **/Firmware** directory using the command:
* Multicopter (jMAVSim): `make px4_sitl jmavsim`
* Multicopter (Gazebo): `make px4_sitl gazebo`
* VTOL (Gazebo): `make px4_sitl gazebo_standard_vtol`
* Multicopter (Gazebo): `make px4_sitl gz_x500`
* VTOL (Gazebo): `make px4_sitl gz_standard_vtol`


### Using QGroundControl

You can use *QGroundControl* to connect to PX4 and observe vehicle movement and behaviour while the examples are running.
*QGroundControl* will automatically connect to the PX4 simulation as soon as it is started.

See [QGroundControl > Download and Install](https://docs.qgroundcontrol.com/en/getting_started/download_and_install.html) for information about setting up *QGroundControl* on your platform.
See [QGroundControl > Download and Install](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/getting_started/download_and_install.html) for information about setting up *QGroundControl* on your platform.


### Building the Examples {#build_examples}
Expand All @@ -74,7 +74,7 @@ See [installation guide](../guide/installation.md) if that is not already the ca

Then build the example:
```sh
cd examples/takeoff_and_land/
cd cpp/examples/takeoff_and_land/
cmake -Bbuild -S.
cmake --build build -j4
```
Expand Down
4 changes: 2 additions & 2 deletions cpp/docs/en/cpp/examples/offboard_velocity.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ The operation of most of this code is discussed in the guide: [Offboard Control]

## Source code {#source_code}

- [CMakeLists.txt](https://github.com/mavlink/MAVSDK/blob/main/examples/offboard/CMakeLists.txt)
- [offboard_velocity.cpp](https://github.com/mavlink/MAVSDK/blob/main/examples/offboard/offboard.cpp)
- [CMakeLists.txt](https://github.com/mavlink/MAVSDK/blob/main/cpp/examples/offboard/CMakeLists.txt)
- [offboard_velocity.cpp](https://github.com/mavlink/MAVSDK/blob/main/cpp/examples/offboard/offboard.cpp)
8 changes: 4 additions & 4 deletions cpp/docs/en/cpp/examples/takeoff_and_land.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ After a short wait the vehicle lands.
While flying the vehicle receives telemetry. The example is implemented in C++ (only).

::: tip
The full source code for the example [can be found here](https://github.com/mavlink/MAVSDK/tree/main/examples/takeoff_and_land).
The full source code for the example [can be found here](https://github.com/mavlink/MAVSDK/tree/main/cpp/examples/takeoff_and_land).
:::

## Running the Example {#run_example}
Expand Down Expand Up @@ -62,8 +62,8 @@ Finished...
## Source code {#source_code}

::: tip
The full source code for the example [can be found on Github here](https://github.com/mavlink/MAVSDK/tree/main/examples/takeoff_and_land).
The full source code for the example [can be found on Github here](https://github.com/mavlink/MAVSDK/tree/main/cpp/examples/takeoff_and_land).
:::

- [CMakeLists.txt](https://github.com/mavlink/MAVSDK/blob/main/examples/takeoff_and_land/CMakeLists.txt)
- [takeoff_and_land.cpp](https://github.com/mavlink/MAVSDK/blob/main/examples/takeoff_and_land/takeoff_and_land.cpp)
- [CMakeLists.txt](https://github.com/mavlink/MAVSDK/blob/main/cpp/examples/takeoff_and_land/CMakeLists.txt)
- [takeoff_and_land.cpp](https://github.com/mavlink/MAVSDK/blob/main/cpp/examples/takeoff_and_land/takeoff_and_land.cpp)
6 changes: 3 additions & 3 deletions cpp/docs/en/cpp/examples/transition_vtol_fixed_wing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The example must be run against a VTOL aircraft (simulated or otherwise).
Otherwise the example is built and run [in the standard way](../examples/index.md#trying_the_examples).

::: tip
Instructions for running the Gazebo simulator for a standard VTOL can be found here: [PX4 Development Guide > Gazebo Simulation](https://docs.px4.io/master/en/simulation/gazebo.html#standard-vtol).
Instructions for running the Gazebo simulator for a standard VTOL can be found here: [PX4 Development Guide > Gazebo Simulation](https://docs.px4.io/main/en/sim_gazebo_gz/vehicles#standard-vtol).
jMAVSim does not support VTOL simulation.
:::

Expand Down 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/mavlink/MAVSDK/blob/main/examples/transition_vtol_fixed_wing/CMakeLists.txt)
- [transition_vtol_fixed_wing.cpp](https://github.com/mavlink/MAVSDK/blob/main/examples/transition_vtol_fixed_wing/transition_vtol_fixed_wing.cpp)
- [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)
Loading
Loading