paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] Module using external package (bheliom)


From: Felix Ruess
Subject: Re: [Paparazzi-devel] Module using external package (bheliom)
Date: Fri, 16 Aug 2013 15:36:43 +0200

Hi Waldemar,

This really depends a lot on what exactly you want to simulate... how deep down do you want/need to go?
There are different options: http://paparazzi.enac.fr/wiki/Simulation#Available_Simulators

I gather you want to simulate a fixedwing and do estimation/control? Or just "higher" level navigation?

NPS would probably be the best choice for estimation/control as it allows you to define sensor models (noise, drift, delay, etc..)
But if you want to use this for fixedwings, NPS is not quite ready... we did some work in the nps_fixedwing branch and the basics work, but it's not quite finished.
See also https://github.com/paparazzi/paparazzi/issues/198

And first of all you need a proper FDM of your aircraft, without that it's quite useless...

Cheers, Felix


On Fri, Aug 16, 2013 at 3:27 PM, Waldemar Franczak <address@hidden> wrote:
Hi Felix,

Simulation is certainly a sufficient option for me to start with, however I'd need some hints what I have to take care of to make this work. For now when I switched to simulation and modified my module xml accordingly I get:
...
BUILD autopilot.so
LD /home/bheliom/develop/paparazzi/var/Bixler/sim/simsitl
File "/home/bheliom/develop/paparazzi/var/Bixler/sim/simsitl.ml", line 1,characters 0-1:
Error: Error on dynamically loaded library: /home/bheliom/develop/paparazzi/var/Bixler/sim/autopilot.so: /home/bheliom/develop/paparazzi/var/Bixler/sim/autopilot.so: undefined symbol: AddIpoptNumOption
make[1]: *** [/home/bheliom/develop/paparazzi/var/Bixler/sim/simsitl] Error 2
make[1]: Leaving directory `/home/bheliom/develop/paparazzi/sw/airborne'
make: *** [sim.compile] Error 2
...

So I guess I need to modify the simulator part somehow. I'd appreciate if you could just point me the right direction, as you might noticed I'm confusing lot of stuff.

Thanks,
Waldemar
 
Error on dynamically loaded library


On Fri, Aug 16, 2013 at 2:50 PM, Felix Ruess <address@hidden> wrote:
Hi Waldemar,

You could play with it in simulation or use a board which has more computing power and actually runs linux (e.g. Gumstix, BeagleBoneBlack, ...).
Both options would involve a little bit of work... but definitely do-able.

Cheers, Felix


On Fri, Aug 16, 2013 at 2:42 PM, Waldemar <address@hidden> wrote:
Thank you all for quick help guys! 

Since my whole code that I want to implement is based on IPOPT I'll have to figure out what to do next... If I'll find a smart solution I'll post here.

Thanks once again.

Waldemar


On Fri, Aug 16, 2013 at 2:25 PM, Hector Garcia de Marina <address@hidden> wrote:
Indeed Gautier is right. 

For mathematical stuff you have basically two preferable options:

1. To write explicitly your algorithms from scratch or using the already math stuff in the code (such as matrices operations).
2. To use libraries that allow static allocation at compile-time, my favorite is Eigen ( http://eigen.tuxfamily.org/ ) in C++. Furthermore, this library is only composed of headers, so you do not have to worry about the architecture of your target.

I would say that Lapack and Blas have such option as well (static allocation) and I guess they have ARM versions as well. But I have not tested them in that sense.


On Fri, Aug 16, 2013 at 2:12 PM, Felix Ruess <address@hidden> wrote:
Yes, Gautier points out the obvious thing...
When you asked the initial question, I assumed you were talking about static libs already compiled for the ARM architecture and missed that in my previous reply...


On Fri, Aug 16, 2013 at 2:07 PM, Gautier Hattenberger <address@hidden> wrote:
Hi,

The airborne code is not using an operating system like Linux capable of loading shared libraries (*.so files). Si you have to (cross-)compile your external library as a static one (.a file). And if your library do some system calls, it might be a problem also.

Gautier

Le 16/08/2013 13:55, Waldemar a écrit :
I changed the toolchain and the 'raw' section:

..
<raw>
     ap.CFLAGS += "-I/home/bheliom/develop/CoinIpopt/build/include/coin/" 
     ap.LDFLAGS += "-L/home/bheliom/develop/CoinIpopt/build/lib" -lipopt -llapack -lcoinhsl -lblas -lm -ldl -lstdc++ -lm 
</raw>
..

Including all necessary libraries(according to the makefile I use to build the code without paparazzi). Now I get:
...
CC /home/bheliom/develop/paparazzi/var/Bixler/ap/modules/hs_module/hs071_c.o
LD /home/bheliom/develop/paparazzi/var/Bixler/ap/ap.elf
/home/bheliom/develop/CoinIpopt/build/lib/libipopt.so: file not recognized: File format not recognized
...


On Fri, Aug 16, 2013 at 12:59 AM, Felix Ruess <address@hidden> wrote:
You added the libary and include paths, but not the actual lib...

If you use v5.0 or master I would also recommend to use the https://launchpad.net/gcc-arm-embedded/ toolchain, just drop it in your PATH and it will be used.


On Fri, Aug 16, 2013 at 12:06 AM, m <address@hidden> wrote:
Hi,
Thanks for the answer! I tried already to play a bit with raw section but I didn't manage to make it work. Here is my module xml file:

<!DOCTYPE module SYSTEM "module.dtd">

<module name="hs_module">
  <doc>
    <description>Ipopt demo module</description>
  </doc>
  
  <header>
   <file name="hs071_c.h"/>
  </header>
  
  <init fun="ipopt_init()"/>
  
  <makefile target="ap">
  
  <file name="hs071_c.c"/>
    <raw>
     ap.CFLAGS += "-I/home/bheliom/develop/CoinIpopt/build/include/coin/"
     ap.LDFLAGS += "-L/home/bheliom/develop/CoinIpopt/build/lib/"
    </raw>
  </makefile>
  
</module>

And a bit more output, maybe I do something else wrong...

.
.
.
CC /home/bheliom/develop/paparazzi/var/Bixler/ap/subsystems/navigation/nav_survey_rectangle.o
CC /home/bheliom/develop/paparazzi/var/Bixler/ap/subsystems/navigation/nav_line.o
CC /home/bheliom/develop/paparazzi/var/Bixler/ap/modules/hs_module/hs071_c.o
LD /home/bheliom/develop/paparazzi/var/Bixler/ap/ap.elf
/home/bheliom/develop/paparazzi/var/Bixler/ap/modules/hs_module/hs071_c.o: In function `ipopt_init':
/home/bheliom/develop/paparazzi/sw/airborne/modules/hs_module/hs071_c.c:75: undefined reference to `CreateIpoptProblem'
/home/bheliom/develop/paparazzi/sw/airborne/modules/hs_module/hs071_c.c:89: undefined reference to `AddIpoptStrOption'
/home/bheliom/develop/paparazzi/sw/airborne/modules/hs_module/hs071_c.c:90: undefined reference to `AddIpoptStrOption'
/home/bheliom/develop/paparazzi/sw/airborne/modules/hs_module/hs071_c.c:91: undefined reference to `AddIpoptNumOption'
/home/bheliom/develop/paparazzi/sw/airborne/modules/hs_module/hs071_c.c:114: undefined reference to `IpoptSolve'
/home/bheliom/develop/paparazzi/sw/airborne/modules/hs_module/hs071_c.c:149: undefined reference to `AddIpoptStrOption'
/home/bheliom/develop/paparazzi/sw/airborne/modules/hs_module/hs071_c.c:152: undefined reference to `AddIpoptNumOption'
/home/bheliom/develop/paparazzi/sw/airborne/modules/hs_module/hs071_c.c:153: undefined reference to `AddIpoptNumOption'
/home/bheliom/develop/paparazzi/sw/airborne/modules/hs_module/hs071_c.c:154: undefined reference to `IpoptSolve'
/home/bheliom/develop/paparazzi/sw/airborne/modules/hs_module/hs071_c.c:183: undefined reference to `FreeIpoptProblem'
/opt/paparazzi/arm-multilib/lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/thumb2/libc.a(lib_a-fstatr.o): In function `_fstat_r':
/build/buildd/paparazzi-arm-multilib-1.2.3/build/gcc/arm-none-eabi/thumb2/newlib/libc/reent/../../../../../../../src/gcc-linaro-4.6-2011.09-1/newlib/libc/reent/fstatr.c:62: undefined reference to `_fstat'
/opt/paparazzi/arm-multilib/lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/thumb2/libc.a(lib_a-isattyr.o): In function `_isatty_r':
/build/buildd/paparazzi-arm-multilib-1.2.3/build/gcc/arm-none-eabi/thumb2/newlib/libc/reent/../../../../../../../src/gcc-linaro-4.6-2011.09-1/newlib/libc/reent/isattyr.c:58: undefined reference to `_isatty'
collect2: ld returned 1 exit status
make[1]: *** [/home/bheliom/develop/paparazzi/var/Bixler/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/bheliom/develop/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/bheliom/develop/paparazzi'

FAILED 'make -C /home/bheliom/develop/paparazzi -f Makefile.ac AIRCRAFT=Bixler ap.compile' with code 2

Thanks for help!

On Thu, Aug 15, 2013 at 7:09 PM, address@hidden wrote:
Send Paparazzi-devel mailing list submissions to address@hidden To subscribe or unsubscribe via the World Wide Web, visit https://lists.nongnu.org/mailman/listinfo/paparazzi-devel or, via email, send a message with subject or body 'help' to address@hidden You can reach the person managing the list at address@hidden When replying, please edit your Subject line so it is more specific than "Re: Contents of Paparazzi-devel digest..." Today's Topics: 1. rotorcraft firmware compile errors (Chris) 2. Re: rotorcraft firmware compile errors (Felix Ruess) 3. Re: Module using external package (Felix Ruess) 4. Re: how to use 2 GPS simultaneously? (Prof. Dr.-Ing. Heinrich Warmers) ---------------------------------------------------------------------- Message: 1 Date: Thu, 15 Aug 2013 19:32:10 +0300 From: Chris <address@hidden> To: address@hidden Subject: [Paparazzi-devel] rotorcraft firmware compile errors Message-ID: <address@hidden> Content-Type: text/plain; charset=ISO-8859-1; format=flowed I am trying to compile a rotorcraft firmware with the latest master (just updated and recompiled the code) but i get the following errors when i use the below settings (telemetry file = default_rotorcraft.xml) : <subsystem name="stabilization" type="float_quat"/> <subsystem name="ahrs" type="float_cmpl_rmat"/> with the below settings it compiles fine <subsystem name="ahrs" type="int_cmpl_quat"/> <subsystem name="stabilization" type="int_quat"/> Btw after reading some benchmarks about the stm32f4 i think that using floats is much faster than using integers, am i wrong? Here is the output: GCC version: arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.7.3 20130312 (release) [ARM/embedded-4_7-branch revision 196615] CC /home/hendrix/paparazzi/var/f550/ap/mcu.o CC /home/hendrix/paparazzi/var/f550/ap/state.o CC /home/hendrix/paparazzi/var/f550/ap/firmwares/rotorcraft/main.o firmwares/rotorcraft/main.c: In function 'telemetry_periodic': firmwares/rotorcraft/main.c:212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:212:1: error: invalid operands to binary >> (have 'float' and 'int') make[1]: *** [/home/hendrix/paparazzi/var/f550/ap/firmwares/rotorcraft/main.o] Error 1 make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne' make: *** [ap.compile] Error 2 make: Leaving directory `/home/hendrix/paparazzi' Here is the relevant airframe file <firmware name="rotorcraft"> <target name="ap" board="krooz_sd"/> <target name="nps" board="pc"> <subsystem name="fdm" type="jsbsim"/> <subsystem name="radio_control" type="ppm"/> </target> <subsystem name="radio_control" type="ppm"/> <subsystem name="telemetry" type="transparent"/> <subsystem name="motor_mixing"/> <subsystem name="actuators" type="pwm"> </subsystem> <subsystem name="gps" type="ublox"/> <subsystem name="imu" type="krooz_sd"> <define name="IMU_KROOZ_SD" value="1"/> </subsystem> <subsystem name="stabilization" type="float_quat"/> <subsystem name="ahrs" type="float_cmpl_rmat"/> <!-- <subsystem name="ahrs" type="int_cmpl_quat"/> <subsystem name="stabilization" type="int_quat"/> --> <subsystem name="ins" type="hff"/> <define name="NO_RC_THRUST_LIMIT"/> <define name="USE_RC_FP_BLOCK_SWITCHING"/> <define name="USE_ATTITUDE_REF" value="0"/> <define name="FAILSAFE_GROUND_DETECT" value="1"/> <define name="USE_GPS_ACC4R" value="1"/> </firmware> <!-- Using Geo Mag module --> <modules main_freq="512"> <!--<load name="gps_ubx_ucenter.xml"/> --> </modules> ------------------------------ Message: 2 Date: Thu, 15 Aug 2013 18:55:46 +0200 From: Felix Ruess <address@hidden> To: Paparazzi devel list <address@hidden> Subject: Re: [Paparazzi-devel] rotorcraft firmware compile errors Message-ID: <address@hidden> Content-Type: text/plain; charset="utf-8" Hi Chris, thx! Should be fixed in master now. You might also want to test the Kalman filter ahrs: float_mlkf It currently doesn't have as many options, e.g. you have to use the mag and you can't configure the noise yet... Also it uses the mag measurements to update all axes and not only yaw. But if your mag is properly calibrated you should get better results than with the complementary filter. Cheers, Felix On Thu, Aug 15, 2013 at 6:32 PM, Chris <address@hidden> wrote:
I am trying to compile a rotorcraft firmware with the latest master (just updated and recompiled the code) but i get the following errors when i use the below settings (telemetry file = default_rotorcraft.xml) : <subsystem name="stabilization" type="float_quat"/> <subsystem name="ahrs" type="float_cmpl_rmat"/> with the below settings it compiles fine <subsystem name="ahrs" type="int_cmpl_quat"/> <subsystem name="stabilization" type="int_quat"/> Btw after reading some benchmarks about the stm32f4 i think that using floats is much faster than using integers, am i wrong? Here is the output: GCC version: arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.7.3 20130312 (release) [ARM/embedded-4_7-branch revision 196615] CC /home/hendrix/paparazzi/var/**f550/ap/mcu.o CC /home/hendrix/paparazzi/var/**f550/ap/state.o CC /home/hendrix/paparazzi/var/**f550/ap/firmwares/rotorcraft/**main.o firmwares/rotorcraft/main.c: In function 'telemetry_periodic': firmwares/rotorcraft/main.c:**212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:**212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:**212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:**212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:**212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:**212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:**212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:**212:1: error: invalid operands to binary >> (have 'float' and 'int') firmwares/rotorcraft/main.c:**212:1: error: invalid operands to binary >> (have 'float' and 'int') make[1]: *** [/home/hendrix/paparazzi/var/**f550/ap/firmwares/rotorcraft/* *main.o] Error 1 make[1]: Leaving directory `/home/hendrix/paparazzi/sw/**airborne' make: *** [ap.compile] Error 2 make: Leaving directory `/home/hendrix/paparazzi' Here is the relevant airframe file <firmware name="rotorcraft"> <target name="ap" board="krooz_sd"/> <target name="nps" board="pc"> <subsystem name="fdm" type="jsbsim"/> <subsystem name="radio_control" type="ppm"/> </target> <subsystem name="radio_control" type="ppm"/> <subsystem name="telemetry" type="transparent"/> <subsystem name="motor_mixing"/> <subsystem name="actuators" type="pwm"> </subsystem> <subsystem name="gps" type="ublox"/> <subsystem name="imu" type="krooz_sd"> <define name="IMU_KROOZ_SD" value="1"/> </subsystem> <subsystem name="stabilization" type="float_quat"/> <subsystem name="ahrs" type="float_cmpl_rmat"/> <!-- <subsystem name="ahrs" type="int_cmpl_quat"/> <subsystem name="stabilization" type="int_quat"/> --> <subsystem name="ins" type="hff"/> <define name="NO_RC_THRUST_LIMIT"/> <define name="USE_RC_FP_BLOCK_**SWITCHING"/> <define name="USE_ATTITUDE_REF" value="0"/> <define name="FAILSAFE_GROUND_DETECT" value="1"/> <define name="USE_GPS_ACC4R" value="1"/> </firmware> <!-- Using Geo Mag module --> <modules main_freq="512"> <!--<load name="gps_ubx_ucenter.xml"/> --> </modules> ______________________________**_________________ Paparazzi-devel mailing list address@hidden https://lists.nongnu.org/**mailman/listinfo/paparazzi-**devel<https://lists.nongnu.org/mailman/listinfo/paparazzi-devel>
-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.nongnu.org/archive/html/paparazzi-devel/attachments/20130815/5d18db71/attachment.html> ------------------------------ Message: 3 Date: Thu, 15 Aug 2013 19:04:34 +0200 From: Felix Ruess <address@hidden> To: Paparazzi devel list <address@hidden> Subject: Re: [Paparazzi-devel] Module using external package Message-ID: <CAEc+GFdpp5Yn0Qvs2adP1mJzn18BiBB-bEVE_rFbCTD=address@hidden> Content-Type: text/plain; charset="utf-8" Hi, although I never tried it, there should not be any limitation (in principle) using external libraries in modules. You however need to add a raw makefile section to your module.xml and add your library there. Something like: <module name="foo" dir="bar"> <doc> <description>my awsome module</description> </doc> <makefile target="ap"> <file name="my_source.c"/> <raw>ap.CFLAGS += -lmylib</raw> </makefile> </module> Can you please post your module xml file? Cheers, Felix On Thu, Aug 15, 2013 at 4:59 PM, m <address@hidden> wrote:
Hello all, I wanted to create a module in which I use external package(IPOPT) for some computation. Since I'm quite new to paparazzi I'm not sure how that can be done... I used simple example code from the IPOPT package and modified it into a module and first I want to compile it with paparazzi however when I try to do that with target 'ap'(with simulation I get similar results) it seems like object file created can not find libraries: . . /home/bheliom/develop/paparazzi/var/Bixler/ap/modules/hs_module/hs071_c.o: In function `ipopt_init': /home/bheliom/develop/paparazzi/sw/airborne/modules/hs_module/hs071_c.c:75: undefined reference to `CreateIpoptProblem' /home/bheliom/develop/paparazzi/sw/airborne/modules/hs_module/hs071_c.c:89: undefined reference to `AddIpoptStrOption' . . Undefined references are of course IPOPT functions. When I use makefile in my module folder just to check whether the code is working with IPOPT, it works so include directories are well defined. Can I even use external package like this ? Or I have to somehow implement it into paparazzi ? I tried changing makefile options in my module xml but without any good result. _______________________________________________ Paparazzi-devel mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.nongnu.org/archive/html/paparazzi-devel/attachments/20130815/12d8979d/attachment.html> ------------------------------ Message: 4 Date: Thu, 15 Aug 2013 19:02:35 +0200 From: "Prof. Dr.-Ing. Heinrich Warmers" <address@hidden> To: address@hidden Subject: Re: [Paparazzi-devel] how to use 2 GPS simultaneously? Message-ID: <address@hidden> Content-Type: text/plain; charset="iso-8859-9"; Format="flowed" Hi Refik, you can use multi norm receivers for GPS and GOLNASS etc. http://www.nvs-gnss.com/products/receivers/item/2-nv08c-csm.html Three is a module for 45 Euro available. You have to add the antenna and to wrote a new driver for paparazzi. My smart phone has also the same chip set. Usually i receive 17-19 satellites. Heinrich Refik Sever schrieb:
Dear all, Yesterday, our GPS was lost for 2 seconds and our plane went to failsafe. We were lucky and it did not crash. I want to add a second GPS for reliability. Is there anyone implemented it already? Regards, Refik ------------------------------------------------------------------------ _______________________________________________ Paparazzi-devel mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.nongnu.org/archive/html/paparazzi-devel/attachments/20130815/d1337585/attachment.html> ------------------------------ _______________________________________________ Paparazzi-devel mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/paparazzi-devel End of Paparazzi-devel Digest, Vol 113, Issue 39 ************************************************

_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel




_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel


_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel




--

_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]