How to backport a git master feature to a git stable branch

Hello,

A few weeks ago I got started with experimenting with the build myself and followed the instructions on the dev guide to fork the repository and get it to compile on my machine. I built a firmware that had some features I wanted to experiment with for our project, but then I realized it was a development version of the firmware. I was trying to figure out how to just modify the latest stable version of Copter to achieve what I want, but when I got the code for this branch, I realized it didn’t contain a lot of the stuff I was actually working with (AP_Generator files). I found that this stuff is all in AP_Periph.

My question is: What is the difference between the AP_Periph and the Copter stable releases?

Is using the code from AP_Periph stable release kind of equivalent to using the code from Copter stable release?

My goal is just to take the latest stable branch for Copter and get some stuff working that seems to be contained only in AP_Periph. Any advice on how to proceed?

Thanks

ArduPilot peripheral device is based on the existing autopilot code, It takperipheral device driver libraries of ArduPilot and adapts them to run on stand-alone peripheral devices, which communicate to the main autopilot via CAN protocol.

Thanks for the reply.

I see…so not really the branch I want to use then.

What would be the best way to integrate the AP_Generator module into the Copter stable branch for my build? Do I need to cherry pick the files from the other project and integrate them all manually?

Basically, I want to use the latest stable build, but add a tiny feature that I have only found in the AP_Periph or master/dev branch.

Well, modify the code require experience…time and many tests.

it requires

  1. checking out copter-4.0 branch.
  2. create a new feature branch
  3. git cherry-pick the commits that introduced that feature into master while solving possible git merge conflicts.
  4. compile it,
  5. fix possible compiler errors by git cherry-picking some more commits from master branch, go back to 3 until it compiles
  6. test it.

I did this two days ago to bring rotoye bms support to copter-4.0 stable branch. It is possible, and easy, if you know the steps.

well … now you do know them.

1 Like

Tbh, I am also looking to somehow backport GSF yaw feature from master to on some latest stable branch of ArduCopter, but I can see there are around 100 of commits related to GSF yaw for copter in master, also I am not even sure if there are some commits which I can miss out while using git cherrypick and probably end up breaking something while backporting, I also suspect there might need to backport some other commits other than GSF yaw feature which probably have some dependencies attached to this feature, is there any safe way to know that I don’t miss out on any commits for this feature

Nope, something complex like GSF is not easy to backport.