Hello,
I am pretty new to paparazzi and I am about to build my first own code. I tried to build a code for a Y4-Copter which is supposed to get a tilting coaxial front engine later. The Code is mostly the basics I found on the homepage with some inspiration from the old quadshot file. As Flight Plan, Settings, Radio and Telemetry files I just used the dummy.xml file. I tried to build it with the Target set as sim and as ap, but neither of them worked. I always get the following message: - - - - - RUN 'make -C /home/kevin/paparazzi -f Makefile.ac AIRCRAFT=Tiltrotor PRINT_CONFIG=1 sim.compile ' make: Entering directory `/home/kevin/paparazzi' ####################################### # BUILD AIRCRAFT=Tiltrotor, TARGET sim ####################################### Fatal error: exception Xml.Error(_) make: *** [sim.ac_h] Error 2 make: Leaving directory `/home/kevin/paparazzi' FAILED 'make -C /home/kevin/paparazzi -f Makefile.ac AIRCRAFT=Tiltrotor PRINT_CONFIG=1 sim.compile' with code 2 - - - - - I could not find a easy way to attach my aircraft file, so I will just post it here: <!DOCTYPE airframe SYSTEM "../airframe.dtd"> <airframe name="Tiltrotor"> <firmware name="rotorcraft"> <target name="nps" board="pc"> <subsystem name="fdm" type="jsbsim"/> </target> <target name="ap" board="lisa_mx_2.1"/> <subsystem name="imu" type="aspirin_v2.1"/> <subsystem name="ahrs" type="int_cmpl_euler"/> <subsystem name="radio_control" type="ppm"> <define name="RADIO_MODE" value="RADIO_AUX1"/> <subsystem name="telemetry" type="xbee_api"/> <subsystem name="actuators" type="pwm"> <define name="SERVO_HZ" value="400"/> <subsystem name="stabilization" type="int_euler"/> <subsystem name="ins"/> </firmware> <servos driver="Pwm"> <servo name="FT" no="0" min="1000" neutral="1050" max="2000"/> <servo name="FB" no="1" min="1000" neutral="1050" max="2000"/> <servo name="BL" no="2" min="1000" neutral="1050" max="2000"/> <servo name="BR" no="3" min="1000" neutral="1050" max="2000"/> <servo name="ELEVON_LEFT" no="4" min="1000" neutral="1500" max="2000"/> <servo name="ELEVON_RIGHT" no="5" min="1000" neutral="1500" max="2000"/> <servo name="TILT" no="6" min="1000" neutral="1500" max="2000"/> </servos> <commands> <axis name="PITCH" failsafe_value="0"/> <axis name="ROLL" failsafe_value="0"/> <axis name="YAW" failsafe_value="0"/> <axis name="THRUST" failsafe_value="0"/> </commands> <command_laws> <call fun="motor_mixing_run(autopilot_motors_on,FALSE,values)"/> <set servo="FT" value="motor_mixing.commands[0]"/> <set servo="FB" value="motor_mixing.commands[1]"/> <set servo="BL" value="motor_mixing.commands[2]"/> <set servo="BR" value="motor_mixing.commands[3]"/> <let var="hover_left" value="0"/> <let var="hover_right" value="0"/> <let var="flight_left" value="0"/> <let var="fight_right" value="0"/> <set servo="ELEVON_LEFT" value="AP_MODE == AP_MODE_RC_DIRECT ? $hover_left : $flight_left" /> <set servo="ELEVON_RIGHT" value="AP_MODE == AP_MODE_RC_DIRECT ? $hover_right : $flight_right" /> </command_laws> <section name="MIXING" prefix="MOTOR_MIXING_"> <define name="TRIM_ROLL" value="0"/> <define name="TRIM_PITCH" value="0"/> <define name="TRIM_YAW" value="0"/> <define name="NB_MOTOR" value="4"/> <define name="SCALE" value="256"/> <let var="hover_pitch" value="{ 256, 256, 0, 0 }"/> <let var="hover_roll" value="{ 256, -256, -256, 256 }"/> <let var="hover_yaw" value="{ -256, 256, 0, 0 }"/> <let var="hover_thrust" value="{ 256, 256, 256, 256 }"/> <let var="flight_pitch" value="{ 0, 0, 0, 0 }"/> <let var="flight_roll" value="{ 0, 0, 0, 0 }"/> <let var="flight_yaw" value="{ 0, 0, 0, 0 }"/> <let var="flight_thrust" value="{ 256, 256, 0, 0 }"/> <define name="PITCH_COEF" value="AP_MODE == AP_MODE_RC_DIRECT ? $hover_pitch : flight_pitch"/> <define name="ROLL_COEF" value="AP_MODE == AP_MODE_RC_DIRECT ? $hover_roll : flight_roll"/> <define name="YAW_COEF" value="AP_MODE == AP_MODE_RC_DIRECT ? $hover_yaw : flight_yaw"/> <define name="THRUST_COEF" value="AP_MODE == AP_MODE_RC_DIRECT ? $hover_thrust : flight_thrust"/> </section> <section name="AUTOPILOT"> <define name="MODE_MANUAL" value="AP_MODE_KILL"/> <define name="MODE_AUTO1" value="AP_MODE_RC_DIRECT"/> <define name="MODE_AUTO2" value="AP_MODE_ATTITUDE_DIRECT"/> <define name="USE_THROTTLE_FOR_MOTOR_ARMING" value="TRUE"/> </section> <section name="GUIDANCE_V" prefix="GUIDANCE_V_"> <define name="HOVER_KP" value="150"/> <define name="HOVER_KD" value="80"/> <define name="HOVER_KI" value="20"/> </section> <section name="GUIDANCE_H" prefix="GUIDANCE_H_"> <define name="PGAIN" value="50"/> <define name="DGAIN" value="100"/> <define name="IGAIN" value="20"/> </section> <section name="STABILIZATION_ATTITUDE" prefix="STABILIZATION_ATTITUDE_"> <define name="SP_MAX_PHI" value="45." unit="deg"/> <define name="SP_MAX_THETA" value="45." unit="deg"/> <define name="SP_MAX_R" value="90." unit="deg/s"/> <define name="DEADBAND_A" value="0"/> <define name="DEADBAND_E" value="0"/> <define name="DEADBAND_R" value="250"/> <define name="REF_OMEGA_P" value="800" unit="deg/s"/> <define name="REF_ZETA_P" value="0.85"/> <define name="REF_MAX_P" value="400." unit="deg/s"/> <define name="REF_MAX_PDOT" value="RadOfDeg(8000.)"/> <define name="REF_OMEGA_Q" value="800" unit="deg/s"/> <define name="REF_ZETA_Q" value="0.85"/> <define name="REF_MAX_Q" value="400." unit="deg/s"/> <define name="REF_MAX_QDOT" value="RadOfDeg(8000.)"/> <define name="REF_OMEGA_R" value="500" unit="deg/s"/> <define name="REF_ZETA_R" value="0.85"/> <define name="REF_MAX_R" value="180." unit="deg/s"/> <define name="REF_MAX_RDOT" value="RadOfDeg(1800.)"/> <define name="PHI_PGAIN" value="1000"/> <define name="PHI_DGAIN" value="400"/> <define name="PHI_IGAIN" value="200"/> <define name="THETA_PGAIN" value="1000"/> <define name="THETA_DGAIN" value="400"/> <define name="THETA_IGAIN" value="200"/> <define name="PSI_PGAIN" value="500"/> <define name="PSI_DGAIN" value="300"/> <define name="PSI_IGAIN" value="10"/> <define name="PHI_DDGAIN" value="300"/> <define name="THETA_DDGAIN" value="300"/> <define name="PSI_DDGAIN" value="300"/> </section> </airframe> - - - - - - I really hope to get some ideas on how to solve this problem. Thanks to everyone taking out so much time of his to help me, Kevin |
Administrator
|
Hi Kevin, you didn't close some of the xml elements:<subsystem name="radio_control" type="ppm"> <define name="RADIO_MODE" value="RADIO_AUX1"/> <subsystem name="actuators" type="pwm"> <define name="SERVO_HZ" value="400"/> </subsystem> Cheers, Felix On Sun, Mar 20, 2016 at 3:16 PM, notoriou5 <[hidden email]> wrote: Hello, _______________________________________________ Paparazzi-devel mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/paparazzi-devel |
Hi Felix,
I closed those systems but it still does not work. I attached a pic of my GUI, maybe there is a mistake with the other .xml files? ![]() Thanks for your help, Kevin |
Administrator
|
Hi Kevin, you still have an XML file that doesn't conform to the DTD.On Thu, Mar 24, 2016 at 8:23 AM, notoriou5 <[hidden email]> wrote: Hi Felix, _______________________________________________ Paparazzi-devel mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/paparazzi-devel |
Hi,
I here is the linkt to the file: http://pastebin.com/fWwgJMu4 I am really looking forward to build my first paparazzi UAV :) Thanks for all the help already Kevin |
Administrator
|
Hi Kevin, declaring variables with `let` and using them with `$` is only possible in `command_laws`.On Thu, Mar 24, 2016 at 9:28 AM, notoriou5 <[hidden email]> wrote: Hi, _______________________________________________ Paparazzi-devel mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/paparazzi-devel |
This post was updated on .
Hi Felix,
thanks. I didn't know this before and just assumed it works everywhere. Well, I am trying to change my motor-mixing matrix depending on the AP_MODE I am using. I only have two different states for my vehicle, hover (AP_ATTITUDE_DIRECT) und flight. If it is not possible with the $-way, is there another way I could make it work to change the matrix? I also thought about writing it directly in the .c-file, but I think I would have to re-initialize the code to get another matrix. And that would probably cause a total crash of the airplane. I am glad for any new ideas. Kevin Edit: 1) Is it maybe possible to write a module which defines the matrix for the motor-mixing in a case structure? 2) I figured out that I couldn't build my sketch because of the id. I changed it to 21, and it worked (with a bunch of mistakes during the build). But what does the change of the id mean or is it really unimportant? 3) I played a little with the code and tried to build the simulation. I figured out some mistakes and corrected/uncommented them, but I can't figure out what is wrong with my Motor-Mixing now... here is the screenshot and the new aircraft.xml file: http://pastebin.com/USAiAn1z ![]() |
This post was updated on .
Happy Easter to everyone :),
maybe some of you guys have some time in this holiday season to help me out a bit. I tried to build a module to switch the matrix of the motor-mixing depending which flight state I am in. This is the code: (somehow the highlighting did not work....) http://pastebin.com/vsvv8YX8 Explanations: FT = FRONT_TOP FB = FRONT_BOTTOM BL = BACK_LEFT BR = BACK_RIGHT AP_MODE_TRANSITION/ AP_MODE_FORWARD: I still have to write and implement those. Example: PITCH_COEF_FT = { 256, 0 }; I know that I still have to do the following: write matrix_module.h write matrix_module.xml activate matrix_module.xml in the airframe.xml file include the matrix_module.xml in the GUI-Module section #define matrix_module.h in the motor_mixing.c My question is now, if through the periodic task matrix_periodic (void) in matrix_module.c the current values of the Matrix are given to the motor_mixing.c file? How can I ensure the current values are given to the motor_mixing? Is it enough to write #define matrix_module.h in the motor_mixing.c file or is it more complex? Thanks for your help so far and a happy Easter, Kevin |
Administrator
|
You would need to make those non static and declare them in the motor_mixing.h header file (best add them to the MotorMixing struct). Then initialize them in motor_mixing_init() instead...On Sun, Mar 27, 2016 at 3:22 PM, notoriou5 <[hidden email]> wrote: Happy Easter to everyone :), _______________________________________________ Paparazzi-devel mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/paparazzi-devel |
Hi Flixr,
I did build my code but I do not get it to work yet. Maybe you could have a look over the files? Thanks a lot in advance: matrix_module.c: http://pastebin.com/mBy91GrW matrix_module.h: http://pastebin.com/Rd1v0dW3 matrix_module.xml: http://pastebin.com/WbeYMNhn motor_mixing.c: http://pastebin.com/5PD2VWPm motor_mixing.h: http://pastebin.com/fHjqhiqM Tiltrotor.xml: http://pastebin.com/dESzELXV And this is the ERROR Screen: ![]() And what does ERROR 2 mean? Thanks a lot for all the help, Kevin |
Administrator
|
Hi Kevin, don't have time to look at this in detail right now.On Tue, Apr 5, 2016 at 1:04 PM, notoriou5 <[hidden email]> wrote: Hi Flixr, _______________________________________________ Paparazzi-devel mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/paparazzi-devel |
Right off the bat:
In matrix_module.c you have not defined a global variable for everything in your init function. int32_t pitch_coef_ft[NUMBER_OF_MATRIXSETS] = PITCH_COEF_FT; If I am not mistaken pitch_coef_ft[] (and similar) will only be defined in this function. So now your periodic function doesn't even know that this variable exists. Put everything you have inside the init function outside of it or declare the variables outside the init function and define them in the init function. In matrix_module.xml can you double check this line: <module name="matrix_module" dir="demo_module"> If you have the xml in a folder named matrix_module I don't think you need to define anything with the dir flag. regards Rijesh On Tue, Apr 5, 2016 at 6:11 AM, Felix Ruess <[hidden email]> wrote:
_______________________________________________ Paparazzi-devel mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/paparazzi-devel |
Thanks for your help Felix and Rijesh,
thanks to you guys I could figure out some more mistakes and I am getting closer to the end :D I also put the definition of the variables outside of the function. I made the following mistakes: 1) I defined main-freq="512" which belongs to GPS, but I do not include GPS yet. That's why I could not compile my Tiltrotor.xml 2) I forgot some semicolons in the matrix_module :D ups... But I have some more new questions: 1) How does it work to update to the latest master which Felix recommended? Do I have to change all the "Xml.parse_file" with "ExtXml.parse_file" by hand? 2) Everytime I close Paparazzi GUI and reopen it, all my settings for my AC are gone. I checked the conf.xml file folder and saw another file like conf.xml_2016-04-05_15:36 which is the last Save time. Is it not possible to just save it in the original conf.xml? Or am I saving in the wrong way? I always click CTRL+S before closing. 3) Some mistakes in my files are gone, but I have one which I can not figure out. Apparently I forget something before the { token, but I can not see what. I checked the airframe.h and matrix_module.c but coud not find it. Here is a pic of the error: ![]() Thanks again, wouldn't know what to do without you guys :) |
1. Assuming you are using a git repository. and have added the following remote: git remote add upstream <a href="git://github.com/paparazzi/paparazzi.git" rel="nofollow">git://github.com/paparazzi/paparazzi.git Then you can run: git pull upstream master. You may run into some commit issues if you have modified files that have already been changed. see this page for more info: 2. I always just close without saving the conf. The conf.xml is loaded on the GCS startup. If you are saving the conf.xml file it may be saving it with a timestamp? I am not sure. Just have your configuration in conf.xml. 3. In C curly braces {} indicate a block of code. [] indicate an array. So maybe you need to be using square brackets. regards Rijesh On Tue, Apr 5, 2016 at 9:53 AM, notoriou5 <[hidden email]> wrote: Thanks for your help Felix and Rijesh, _______________________________________________ Paparazzi-devel mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/paparazzi-devel |
Administrator
|
Hi, See also https://wiki.paparazziuav.org/wiki/Installation#Software_Updates for howto update your repo.1) 2) 3) On Tue, Apr 5, 2016 at 8:25 PM, Rijesh Augustine <[hidden email]> wrote:
_______________________________________________ Paparazzi-devel mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/paparazzi-devel |
Good Morning everyone,
I updated to the newest Version yesterday and tried to compile the same files but a new error popped up. Something to do with my flight_plan.xml. It is error2 again, so I think there is something wrong with the syntax of the file. I checked but I could not see anything. Could anyone maybe recheck? Maybe this is also a common problem after updating? Here is the file: http://pastebin.com/ksSK2Zfh And the Error Message: ####################################### # BUILD AIRCRAFT=Tiltrotor, TARGET ap ####################################### Info: settings '/home/kevin/paparazzi/conf/settings/setup_actuators.xml' unloaded for target 'ap' Info: module '/home/kevin/paparazzi/conf/../conf/modules/matrix_module.xml' unloaded for target 'ap' make[1]: Entering directory `/home/kevin/paparazzi' GENERATE /home/kevin/paparazzi/var/aircrafts/Tiltrotor/ap/generated/airframe.h from airframes/FHAachen/Tiltrotor.xml GENERATE /home/kevin/paparazzi/var/aircrafts/Tiltrotor/flight_plan.xml from Fatal error: exception Sys_error("Is a directory") make[1]: *** [/home/kevin/paparazzi/var/aircrafts/Tiltrotor/flight_plan.xml] Error 2 make[1]: Leaving directory `/home/kevin/paparazzi' make: *** [ap.ac_h] Error 2 make: Leaving directory `/home/kevin/paparazzi' FAILED 'make -C /home/kevin/paparazzi -f Makefile.ac AIRCRAFT=Tiltrotor ap.compile' with code 2 And to the answer 3) from Felix: Do you mean these lines: "pitch_coef = {pitch_coef_ft[0], pitch_coef_fb[0], pitch_coef_bl[0], pitch_coef_br[0]};" |
This post was updated on .
Okay, just a noobie mistake. I did not rebuild the code after downloading ;-)
But I still do not see the mistake with the curly brackets... Well, I try to write it directly in the matrix_module instead of taking it from the airframe.xml file. Maybe it works this way. Happy coding, Kevin Edit: I tried to put in the numbers directly, but somehow there is still something missing. I really do not get it... ![]() Edit 2: I replaced "pitch_coef" with "pitch_coef [4]" in the .h and .c file of the matrix_module. I thought maybe I did not declare the array right, but I still get the same error "expected expression before '{' token" |
Good News,
I figured a way out to solve the problem. I rewrote the matrix_module in the most simple way. Now I don't take my values from the airframe.xml file and I don't habe arrays, but it compiles :D For those who are interested, here is the code: http://pastebin.com/nkWBQN7t Now it seems like I only have one error left before it compiles successfully: ![]() Some implicit declaration of "motor_mixing_run", but I didn't even touch this block of code. Anyone any suggestions? Thanks, Kevin |
The error is due to sw/airborne/firmwares/rotorcraft/main.c not including motor_mixing.h If you look in the main.c file you can see:#if USE_MOTOR_MIXING #include "subsystems/actuators/motor_mixing.h" #endif On Wed, Apr 6, 2016 at 7:14 AM, notoriou5 <[hidden email]> wrote: Good News, _______________________________________________ Paparazzi-devel mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/paparazzi-devel |
I think you are missing the motor_mixing subsystem. <subsystem name="motor_mixing"/> disclaimer: I have no experience using rotorcraft with paparazzi On Wed, Apr 6, 2016 at 12:05 PM, Rijesh Augustine <[hidden email]> wrote:
_______________________________________________ Paparazzi-devel mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/paparazzi-devel |
Free forum by Nabble | Edit this page |