-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[modules] use VPATH to make it easier to load external modules #760
Conversation
But this still means that you need to load the module xml using a realtive path (to sw/ext), right? |
Yes, at some point you have to tell where are the module files. But with this it is possible (at least much easier) to make the module xml without global path. It is currently the case with the Mjepg vision module for instance. With this you can place the module at different places and it is in the airframe file that you give the path. Maybe it can help to distribute external modules ? |
jep, sounds good |
can I merge it ? |
Great! Thank you Gautier. How should I change the Mjpeg.xml module? load name="../sw/ext/ardrone2_vision/modules/Mjpeg.xml" and then all the relative paths in the Mjpeg.xml can be left out? |
@dewagter I can send you my example files I also would like to talk about the vision code, currently a submodule of tudelft. It is not the easiest way to add new stuff there. But I don't know what is the best actually: put all the code into paparazzi repo, split the general lib part (gstreamer, udp, jpeg, ...) and the modules, something else ? |
My module xml file: <!DOCTYPE module SYSTEM "../module.dtd">
<module name="Mjpeg">
<doc>
<description>Video ARDone 2</description>
</doc>
<header>
<file name="viewvideo.h"/>
</header>
<periodic fun="viewvideo_run()" freq="1" start="viewvideo_start()" stop="viewvideo_stop()" autorun="TRUE"/>
<makefile target="ap">
<file name="viewvideo.c" dir="modules/Mjpeg"/>
<file name="jpeg.c" dir="cv/encoding"/>
<file name="rtp.c" dir="cv/encoding"/>
<file name="socket.c" dir="lib/udp"/>
<file name="video.c" dir="lib/v4l"/>
<file name="ardrone2.c" dir="lib/v4l"/>
<define name="modules" type="include"/>
<define name="cv" type="include"/>
<define name="lib" type="include"/>
<define name="pthread" type="raw"/>
<define name="__USE_GNU"/>
<flag name="LDFLAGS" value="pthread"/>
<flag name="LDFLAGS" value="lrt"/>
<flag name="LDFLAGS" value="static"/>
</makefile>
</module> And the airframe file: <load name="modules/Mjpeg/ViewVideo.xml" dir="sw/ext/ardrone2_vision_enac">
<define name="VIDEO_SOCK_OUT_OFFSET" value="$(AC_ID)"/>
<define name="VIDEO_DOWNSIZE_FACTOR" value="4"/>
<define name="VIDEO_QUALITY_FACTOR" value="70"/>
<define name="VIDEO_FPS" value="1"/>
</load> |
merged with 50b51ce |
With the use of VPATH, external modules can more easily define the list of files to compile using the xml node rather than raw makefile section with global paths.
Also add some options to add custom compile/link flags.
This should allow to improve the use of vision modules for ardrone2 in particular.
Compilation is tested on bare metal, chibios and ardrone autopilots