Greetings. I have an object file which was generated outside the scope of Ardupilot (it’s generated object code from Simulink) that I would like to add to the list of objects which create my ArduCopter image.
That is, this object file was compiled somewhere else and I want to somehow tell waf that I want it included in the linker step which creates my ArduCopter image. How might I (easily or otherwise) do that? I am not seeing a command line argument to waf which allows me to do that and, oddly, if I manhandle the waf python scripts, I get compile errors on otherwise perfectly good code (and the “-v” output from waf shows the exact same compile command both for successful compilations and failed compilations)!
one can add the name(s) of external object files to the very end of Tools/ardupilot/chibios.py (assuming one is using ChiBios) with bld.env.LINKFLAGS += [ ‘nameOfObjectFile’ ]
Note that when waf links everything together to create the final .apj image, nameOfObjectFile will be the first name in the link list…so you want that file to actually be an object file. If you specify a library (aka an archive), no bits from it will be used as no unresolved references to its contents will as yet exist in the linking phase.
@bobobobo I am finishing up on my GSOC project where we generate controller code from Simulink and compile it into Arducopter. It will be available to see in a few days. At the start of my GSOC project I also looked into adding object file, but I found generating and integrating the code into ardupilot easier than I expected.
Can you give more details about what you are trying to achieve?
Emre - I am doing just what you are doing: creating a simulink model, running embedded coder against it, and using the generated code from within Ardupilot. Please do send me a link to your work when it’s available…sounds perfect for my needs. Thanks!