Skip to content

Commit

Permalink
update takeoff location for SIH (PX4#3275)
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio-Chies authored Jul 9, 2024
1 parent bb904fc commit 5bc5065
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions en/sim_sih/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ To run the SIH, you will need a:
- QGroundControl for flying the vehicle via GCS.
- Development computer for visualizing the virtual vehicle (optional).

From PX4 v1.14 you can run SIH "as SITL", in which case a flight controller is not required.
From PX4 v1.14 you can run SIH as SITL, in which case a flight controller is not required.

## Setting up SIH

Expand Down Expand Up @@ -93,7 +93,7 @@ To display the simulated vehicle:
On macOS this would be `/dev/tty.usbmodem1`.
- `-b` to set the serial baud rate to `2000000`.
- `-o` to start jMAVSim in _display Only_ mode (i.e. the physical engine is turned off and jMAVSim only displays the trajectory given by the SIH in real-time).
- add a flag `-a` to display an aircraft or '-t' to display a tailsitter.
- add a flag `-a` to display an aircraft or ’-t’ to display a tailsitter.
If this flag is not present a quadrotor will be displayed by default.

1. After few seconds, _QGroundControl_ can be opened again.
Expand All @@ -105,7 +105,7 @@ The vehicle can be observed moving in jMAVSim, and on the QGC _Fly_ view.

SIH can be run as SITL (Software-In-The-Loop) from v1.14.
What this means is that the simulation code is executed on the laptop/computer, similar to Gazebo or jMAVSim.
In this case you don't need the flight controller hardware.
In this case you dont need the flight controller hardware.

To run SIH as SITL:

Expand Down Expand Up @@ -151,8 +151,24 @@ To display the vehicle in jMAVSim during SITL mode, enter the following command
The dynamic models for the various vehicles are:

- Quadrotor: [pdf report](https://github.com/PX4/PX4-user_guide/raw/main/assets/simulation/SIH_dynamic_model.pdf).
- Fixed-wing: Inspired by the PhD thesis: "Dynamics modeling of agile fixed-wing unmanned aerial vehicles." Khan, Waqas, supervised by Nahon, Meyer, McGill University, PhD thesis, 2016.
- Tailsitter: Inspired by the master's thesis: "Modeling and control of a flying wing tailsitter unmanned aerial vehicle." Chiappinelli, Romain, supervised by Nahon, Meyer, McGill University, Masters thesis, 2018.
- Fixed-wing: Inspired by the PhD thesis: “Dynamics modeling of agile fixed-wing unmanned aerial vehicles.” Khan, Waqas, supervised by Nahon, Meyer, McGill University, PhD thesis, 2016.
- Tailsitter: Inspired by the master’s thesis: “Modeling and control of a flying wing tailsitter unmanned aerial vehicle.” Chiappinelli, Romain, supervised by Nahon, Meyer, McGill University, Masters thesis, 2018.

### Set Custom Takeoff Location

The takeoff location in SIH can be set using environment variables.
This will override both the default takeoff location.

The variables to set are: `PX4_HOME_LAT`, `PX4_HOME_LON`, and `PX4_HOME_ALT`.

For example:

```sh
export PX4_HOME_LAT=28.452386
export PX4_HOME_LON=-13.867138
export PX4_HOME_ALT=28.5
make px4_sitl sihsim_quadx
```

## Video

Expand Down

0 comments on commit 5bc5065

Please sign in to comment.