After rebase of my formerly OK checked branch I’m running into an error, based on MAV_GENERATOR_…
The GitHub checks say “MAV_GENERATOR_STATUS_FLAG_WARMING_UP is missing”
and if I try to build the code I also run into an Errror:
[152/722] Compiling libraries/AP_GPS/AP_GPS_SBP2.cpp
[153/722] Compiling libraries/AP_GPS/AP_GPS_SIRF.cpp
[154/722] Compiling libraries/AP_Generator/AP_Generator_RichenPower.cpp
[155/722] Compiling libraries/AP_Gripper/AP_Gripper_Backend.cpp
[156/722] Compiling libraries/AP_Gripper/AP_Gripper_Servo.cpp
…/…/libraries/AP_Generator/AP_Generator_RichenPower.cpp: In member function ‘void AP_Generator_RichenPower::send_generator_status(const GCS_MAVLINK&)’:
…/…/libraries/AP_Generator/AP_Generator_RichenPower.cpp:437:27: error: ‘MAV_GENERATOR_STATUS_FLAG_WARMING_UP’ was not declared in this scope; did you mean ‘MAV_GENERATOR_STATUS_FLAG_CHARGING’?
437 | status |= MAV_GENERATOR_STATUS_FLAG_WARMING_UP;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| MAV_GENERATOR_STATUS_FLAG_CHARGING
compilation terminated due to -Wfatal-errors.
Waf: Leaving directory `/cygdrive/c/Users/Willy/Documents/GitHub/ardupilot/build/sitl’
Build failed
→ task in ‘objs/AP_Generator’ failed (exit status 1):
{task 123145240536200: cxx AP_Generator_RichenPower.cpp → AP_Generator_RichenPower.cpp.0.o}
(run with -v to display more information)
“c:/cygwin64/bin/python2.7 waf plane” terminated with exit code 1. Build might be incomplete.
So I understand that It’s OK to have that errors in the moment and I just have to wait until 15404 is merged.
After it’s merged I have to rebase again and all should be OK.
Since six weeks I’m not able to build without that error. So it’s hard to believe that it’s a general problem and every developer is not able to build since then.
I guess and hope that there’s a workaround till MavLink is up to date?
Could anybody give a hint how to deal with that?
@QuaxwillyI think the problem here is that you’re referencing a mavlink commit for your changes which doesn’t contain the new generator message stuff.
You’ll need to rebase your mavlink-change-containing-branch on top of ardupilot’s master branch, and then reference the newly created commit hash in your ardupilot repository.
Thank you @peterbarker, I will try that as soon as I understand what I’m doing. Sorry, I’m not so familiar with GitHub and repos and in the past I have learned that It’s better not to hurry here.
So could you give me a little deeper explanation of your last recommended doing, please.
Thank you @peterbarker, I will try that as soon as I understand what I¢m doing. Sorry, I¢m not so familiar with GitHub and repos and in the past I have
learned that It¢s better not to hurry here.
So one trick is to make it really, really easy to take backups. I use two
scripts, one to make a backup of a branch and one to take a backup of my
entire ArduPilot repo. The former takes milliseconds to run, the latter a
minute or so.
pbarker@bluebottle:~/rc$ ls -l which date-branchwhich date-tarball
-rwxrwxr-x 1 pbarker pbarker 142 Apr 17 2018
/home/pbarker/bin/date-branch
-rwxrwxr-x 1 pbarker pbarker 291 Mar 22 2017
/home/pbarker/bin/date-tarball
pbarker@bluebottle:~/rc$ ls ardupilot*tar
ardupilot-201901180845.tar ardupilot-202012081408.tar
ardupilot-202010011011.tar
pbarker@bluebottle:~/rc$ cd ardupilot
pbarker@bluebottle:~/rc/ardupilot((HEAD detached at
rmackay9/lthall-scurve4))$ git branch | grep backup/ | head -2
backup/AP_MAX_LOG_FILES-20200910135046
backup/DEBUG/f35-spi-20200409102304
pbarker@bluebottle:~/rc/ardupilot((HEAD detached at
rmackay9/lthall-scurve4))$
So could you give me a little deeper explanation of your last recommended doing, please.
Today I worked through that, but with no success - same error as before.
Maybe we missunderstood - I never changed anything in MavLink.
So I replaced
“git checkout pr/my-branch-which-contains-custom-mavlink” by “git checkout MisRelSep”
“git push -f github pr/my-branch-which-contains-custom-mavlink” by “git push -f origin MisRelSep” and also
“git push -f github pr/my-branch-which-used-custom-mavlink” by “git push -f origin MisRelSep”.
I get an error Failed to merge submodule modules/mavlink (commits don’t follow merge-base)
after the first few commands and don’t have an idea how to solve that:
@peterbarker: I don’t understand what
pr/my-branch-which-contains-custom-mavlink
and
pr/my-branch-which-used-custom-mavlink
should say.
In the moment I have one branch MisRelSep with one PR based on it (https://github.com/ArduPilot/ardupilot/pull/14663)
So is it necesary to create a help/interim branch? And if yes, where?
Btw I never changed anything in MavLink.
After four months I thought it’s a good idea to rebase, to be prepared when the PR will be reviewed.
So I did a rebase
After the rebase the PR run into an error (see first post) and naturally also the build run into an error (in libraries/AP_Generator/AP_Generator_RichenPower.cpp the defines MAV_GENERATOR_STATUS_FLAG_… are used, but there is no declaration for them)
In the meantime I found that in common.xml of the new mavlink-submodule (that is the base for common.h) that declarations are done.
Now all I need is the actual mavlink-code in my repo, because thats necessary for the new master-code.
I thougt, that a “git submodule update --init --recursive” will do that, but it seems that’s not the case.
In former times a copy and paste of that code had been the sufficient solution, but in a version-control system that should not be a good idea.
In the meantime I tried different things and looked at the PR - and I’m very sure that my mavlink-problem is not a problem, but the result of a horrible mistake I did at rebase on Oct 17
Don’t know how that happened, but it seems to be horrible.
So could an experienced developer give me a briefing or a hint how to proceed, please?
I safed all my files and I could do a complete restart - but in a version-control system there should be a smarter solution.
Is it possible to rollback to the former state and restart here e.g.?
I already tried
$ git checkout -b MisRel_Test d34d5c2
and that MisRel_Test branch is buildable without error.
I would appreciate that very much - thank you Amilcar - and no need to hurry.
It would also be great if you could describe how you have done that. So I’am able to understand and learn.
I have done a PR to your repo now, the trick is to not commit any changes to the gbenckmark or mavlink repos. I re-formated your commits to match Ardupilot guidelines
Many thanks Amilcar!
As you know I’m an experienced developer but dont have experience with git, I’m very uncertain what I have to do next - I don’t want to nearly kill my repo again.