Need to use 4.09 plane firmware in SITL

Hello friends,

Does anyone know how to use the plane firmware 4.09 in SITL?

Whenever I try to load my parameters using the current SITL firmware, I notice that some of my parameters that are normally present when using the hardware (pixhawk 2.4.8) are missing in SITL and that some other parameters are present when they should not be there. This has led me to believe that SITL is not using the latest stable plane firmware version for whatever reason…

Thanks,

Shef

1 Like

You will need to select the correct SITL (4.0.9) to get 4.0.9.

Or you can do it like I do it, compile it yourself, after checking out the correct git label. Works like a charm :slight_smile:

If you’re using SITL though Mission Planner, I would suggest updating to the latest beta version. There is a new option to skip downloading the master build from firmware.ardupilot.org (specifically here). Now getting the elf file of the vehicle and version that you want to use and placing it in the correct directory is an extra step. Getting the correct elf file to use with Mission Planner means that you need to install and compile it yourself. Which at that point I recommend using WSL for SITL.

Hello again Lucas!

Select SITL 4.09? I can’t see an option for that in mission planner…currently I’m trying tunalobster’s suggestion for downloading the beta updates for mission planner however I keep getting “update failed The request was aborted: The request was canceled” after it makes some progress then gets stuck…

How do you checkout the correct git label? Could you walk me through it?

Thanks,

Shef

Hello again Charlie!

I took you up on your suggestion to update mission planner (i am using mission planner btw) to the beta version however as I said in the above post, I keep getting “update failed The request was aborted: The request was canceled” after it makes some progress then gets stuck.

Is that normal?

Is this elf file thing an alternative method or is this something you have to do in conjunction with using the beta version of mission planner?

Thanks,

Shef

You’ll have to leave skip download unchecked the first time to have a cygwin elf file to run.

Currently there is not a cache of previous versions of the cygwin builds that Mission Planner needs to run. It’s been a requested feature, but it’s not a high priority since there are other parts that a GCS needs to do.

If you can run WSL I would suggest that route. Other wise you’ll need to work out how to build the Mission Planner elf file in cygwing. Setting up the WSL to SITL route starts here, then here, and finally here. That documentation should get you up and running whatever version of ArduPilot you want.

Wow, I’m just…a tad confused…

Well, i can’t seem to update mission planner with any beta features, i think because my internet download speed is so pitiful at the moment. So I’ll be needing to do this “git checkout” thing everyone seems to know, could you explain to me how to do it? If you could be specific too, I’m still quite new to mission planner and ardupilot in general.

Much appreaciated,

Shef

The basics of git that you need to know to work with the code are here in documentation. There is a ton more information in the docs that might help you. Learning the lingo for git might be a little difficult. If you have questions about the code you can ask in the Discord server or on the forums.

https://ardupilot.org/dev/docs/where-to-get-the-code.html

Thanks Tuna I’ll check it out.

Shef

Hey Tuna, consider signing my petition so nobody has to go through all this work!

https://discuss.ardupilot.org/t/petition-for-us-to-choose-sitl-firmware-version/71778

Hey Amil, wouldn’t it be great if we could choose which SITL firmware version we wanted with a touch of a button?

Check out my petition-

https://discuss.ardupilot.org/t/petition-for-us-to-choose-sitl-firmware-version/71778

Dear all,

I approach this topic, since, perhaps, I am running into the same trouble as the original author of the current thread…

Currently, I am performing SITL (Software in the Loop) simulations with conventional fixed wing aircraft (no VTOL/STOL). I connect a 6DOF (degrees of freedom) aircraft physical model ( developed in SIMULINK ) with Mission Planner and with autopilot firmware (ArduPlane.exe). In general, this executable can be downloaded from the Simulation tab in the Mission Planner, after selecting the desired “Model” and “Firmware” types.

My ultimate goal is to tune the PID gains of the autopilot control system so that the aircraft flies well. However, here I must emphasize that I am interested in the autopilot control system ( schematics at the end ) from releases 4.0.9 , 4.0.8, etc … (prior to the 4.1.0 build)

Following the discussion here, my understanding is that, unfortunately, it is not possible to download the 4.0.9 build from the Simulation tab in Mission Planner. It seems that for some reason it only downloads the new build 4.1.0, or I am wrong?

So, I hope that it should be fine to attempt to compile the 4.0.9 ArduPlane.exe for myself. However, I do not have a clue exactly which files I need to download from ?here? so that I can do the compilation.

Thank you very much for the attention and help, in advance!

All the best!

The methods stated above are still valid. There is one more option available now and that is building the SITL binaries that Mission Planner uses yourself using the Cygwin environment. https://ardupilot.org/dev/docs/building-setup-windows-cygwin.html#build-sitl-binaries-for-windows There is a checkbox in Mission Planner to skip the SITL download that you can check after starting SITL once. Then you can compile, move files, and use whatever version of ArduPilot you want to.

TunaLobster, hello

Many thanks for your reply, it is much appreciated!

I think I have a rough idea about what I need to do, in order to get the 4.0.9 version running in SITL. However, I have a few questions that should clear any confusion I may have.

  1. I have got confusion about the following :
    Website says that WSL or Cygwin can be used to build the code. WSL is recommended for noobies like me, while building using Cygwin is necessary if the user wants to compile SITL binaries for Windows. Since I ultimately need the 4.0.9 ArduPlane.exe for SITL, I assume that I MUST use Cygwin, despite the fact that WSL is for novices like me?

  2. Which version of Mission Planner I have to download from here. Is it 1.3.75 or latest or stable? I ask, because, you speak of a checkbox that can be used to skip SITL download. I have never come across or used this checkbox while doing SITL…Therefore I am a bit confused… My experience shows me that SITL is only downloaded, if the user manually clicks inside the Simulation tab in Mission Planner.

  3. Could you please guide me which 4.0.9 files I need to download on my PC in order to do the build. Are they here or here ?

  4. Once I do the build (compilation) I should get the 4.0.9 ArduPlane.exe, right? I aks because, in your previous responses you mention an .elf file, which is something new to me. So far, I have been doing SITL only via ArduPlane.exe, MissionPlanner and Simulink. Never used/seen an elf file…

Thank you once again for the attention and time!

All the best!

A copy of the needed DLL files are located here. Mission Planner downloads from this directory when you click the SITL button. In the beta versions of Mission Planner there is a checkbox for skip download. I’m not sure when that feature will be shipped in a stable release. (Just confirmed it is in the 1.3.75 release) You can also run the exe independently and use a GCS like normal. Just need the DLL files. The elf file was something I was reading incorrectly since I was on Linux side of things at that time. Learning on the fly!

Cygwin has a few benefits over WSL. Higher framerates with RealFlight and making the SITL executable. Other than that, WSL is the way to go. WSL 1 for flashing firmware and USB access. WSL 2 for speed.

TunaLobster,

Once again, much appreciated !!!

A final (apologies, perhaps dum) question, just to make sure that I finally understand correctly what I need to do.
I came across these C++ files of ArduPlane 4.0.9.
I do not need these files in any way, for what I am going to do with Cygwin and eventually be able to run ArduPlane 4.0.9 in SITL?

Thank you once again!

All the best!

You will want to checkout that tag when you build the executable in Cygwin. Github creates those pages to have places to download the tag code without needing to use a CLI. See the previously linked documentation for using git.

TunaLobster,

Thank you very much!

I hope these are really my last questions…

  1. Do I really need to install a git client on my PC and work with it?

I ask, because, Download ArduPilot Source says that I can enter commands directly in Cygwin and be able to clone the repository. If I am not mistaken this is what a git client does, but since the above hyperlink explains that Cygwin can do the same thing, maybe I do not need a git client (and GUI tools such as GitHUB Desktop).

  1. Here website says that MavProxy is required if the user wants to run SITL. Since I aim to compile (i.e build) the ArduPlane executable for SITL, I guess I do have to install MavProxy?

Maybe a foolish side thought, but since I am running SITL successfully (with the latest ArduPlane.exe), does not this mean that I already have MaxProxy installed (when Mission Planner was installed)?

Thank you once again for the attention!

All the best!

MAVProxy is not required as far as I know. I’ll update that docs page. It should say that a GCS is required. You should use git in Cygwin for this use case.

Upon further testing, it seems running SITL using Cygwin through sim_vehicle.py with the --no-mavproxy option does not work. Running the ArduPlane executable though does not require MAVProxy.

1 Like

TunaLobster,

Please, when available, may you have a look at this error that I get.

Today, as first trial check, I attempted to compile the master repository of ardupilot. Just to make sure that compilation runs well.

Firstly, according to the instructions, I cloned the repository by typing in Cygwin:

git clone GitHub - ArduPilot/ardupilot: ArduPlane, ArduCopter, ArduRover, ArduSub source
cd ardupilot
git submodule update --init --recursive

Then performed configuration for SITL board:

./waf --board sitl configure

Finally, started the build, but at some point this error appears. (Tried to change the file path, since this could be a possible reason for the compilation failure, but without success…)

Thank you in advance!