How can I build ArduCopter v3.1 (inside ArduPlane-v2.75 folder) for pixhawk?
If I use the github.com/dijdrones/ardupilot/ArduCopter I have version 3.2, but I want version 3.1 of ArduCopter.
But if I replace the ArduCopter v3.2 in the original zipfile from github with the ArduCopter v3.1 it will not build for px4 (with 'make px4' etc...).
Can anyone explain how to do this?
You'll likely need to use the code from the ArduCopter-3.1.1 or ArduCopter-3.1.2 branches inside of GitHub. You also need to be sure to use the correct version of the PX4Firmware and PX4NuttX repositories. There should be tags (aka "releases") that correspond to the arducopter version in those repositories.
Could you elaborate a bit more? I'm not so familiar with GitHub and repositories and their implications to a correct build.... are you saying that the ArduCopter-3.1 version is in the PX4Firmware repository?
I followed these instructions: http://dev.ardupilot.com/wiki/building-px4-with-make/ using these three repositories: https://github.com/diydrones/ardupilot; https://github.com/diydrones/PX4Firmware; https://github.com/diydrones/PX4NuttX. But as I said in the first message, in the ardupilot repository there is only a ArduCopter 3.2 version and I want to build and upload the original 3.1 version...
This is the answer: You can get older versions (a.k.a. releases a.k.a. tags in github) by checking out these 3 links:
Always use matching versions of these three directories, if you don't chances are it won't compile (correctly). Indeed, as you can see not all ardupilot release come with a maching PX4Firmware and PX4NuttX release, so possibly not all ardupilot versions can be build for Pixhawk. (Correct me if I'm wrong).
If you use this guide http://dev.ardupilot.com/wiki/where-to-get-the-code/ or http://dev.ardupilot.com/wiki/building-px4-with-make/ and the links in there, you'll have the latest (developer) version, this might not be what you want. You for instance might want the latest stable release that MissionPlanner flashes to your Pixhawk when you select ArduCopter, -Plane, -Rover there. Checkout the version number of this stable release in MissionPlanner and look for this version in the three links above.
So I've been able to compile different versions of ArduCopter because I'm able to download the same release of the PX4Firmware and PX4Nuttx repositories. For ArduPlane, I don't see any PX4Firmware and PX4Nuttx releases that say ArduPlane in their listing. So how do you get the proper source code for the ArduPlane stable releases. I'm looking to compile the most recent ArduPlane firmware so I can do HIL with mission planner.
Please let me know how to find the correct PX4Firmware and PX4Nuttx files for the ArduPlane stable version.
If you look in the dataflash logs you should see somewhere near the top-ish it has a list of git has tags for ardupilot, PX4Firmware and PX4NuttX. the tags are shorter than normal but still, if you do a "git checkout <tag>" then it should get the exact version used.
I'm more copter than plane so I don't know much more than that but perhaps Grant or Tridge can help if you email email@example.com.
Thanks for the prompt response. Where would I find the dataflash logs? do you mean a download from the pixhawk. They are typically named like <date>.bin.log. The one I looked at had the following info in it
MSG, ArduPlane V3.2.0 (b88e6b63)
MSG, PX4: 45694507 NuttX: 2d09d16d
MSG, PX4v2 00380029 3233470E 31363032
There were no tags in the PX4Firmware or PX4Nuttx repositories that had the ArduPlane V3.2.0 tag
Just wanted to let you know that I was able to figure it out. Your feedback was spot on. I just didn't realize that the 8 character code was the tag and refers to the last commit in the repository that was used to make the firmware. However I think there is a problem with the Arduplane 3.2.0 tags for PX4 and Nuttx repositories. when I tried to check out those tags, it told me that those tags did not exist in the repository. So I went back to ArduPlane 3.1.1. Those tags worked and I was able to build the ArduPlane 3.1.1 firmware. Is it possible that the tags were copied incorrectly into those messages or is that all automated?
Thanks again for the help!!!
Happy to help.
Those git hashtags are all automatically copied so they should always be fine. We occasionally need to do a forced update to git to bring in all the changes from the px4 guys but my understanding is that that does not affect existing git hashtags. I don't know about the release tags though (like "ArduPlane-3.1.1") it may blast those which would explain what you're seeing.