Skip to content
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

Cyfoam, ctrl effectiveness scheduling, JSBsim #2145

Merged
merged 5 commits into from Dec 1, 2017

Conversation

EwoudSmeur
Copy link
Member

  • Added Cyfoam airframe file
  • Added control effectiveness scheduling function
  • More advanced scheduling function should be added in the future
  • Added simple JSBsim files for Cyclone for a crude simulation

g1g2[i][j] = 0.0;
} else {
g1g2[i][j] = (g1g2_hover[i][j] * (1.0 - ratio) + g1g2_forward[i][j] * ratio);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the if here? if g1g2_hover and _forward are 0. the result will be 0 anyway...

*/
extern void ctrl_eff_scheduling_periodic(void);
extern void ctrl_eff_scheduling_periodic_a(void);
extern void ctrl_eff_scheduling_periodic_b(void);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these defined anywhere, don't see it in this PR.

}
}

#if EFF_SCHED_USE_FUNCTION
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this in an ifdef? Either the module is included and running because it is included in the airframe (in which case this must be defined else pprz will not compile because the function is not defined) or its not included in the airframe and this entire file is not compiled.

@@ -17,6 +17,6 @@
<define name="MAX_FLI" value="$(TLSF_MAX_FLI)"/>
<file_arch name="tlsf_malloc_arch.c"/>
<include name="$(PAPARAZZI_SRC)/sw/ext/tlsf"/>
<file name="tlsf.c" dir="$(PAPARAZZI_SRC)/sw/ext/tlsf"/>
<file name="tlsf.c" dir="../../tlsf"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look quite right. As far as I understand it this does "work" but maybe keep the old line commented here for future people (just in case this causes issues in the future).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was working for sure, can it be related to the vpath tool (again) ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it works, it just looks really weird, I would have guessed it would be something like ../ext/tlsf but that didn't work. I am fine with it like this though. Indeed it needs to be changed due to the vpath tool.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried again with the original line, and it does continue compiling, but it gives the following error in the beginning:

../../sw/tools/find_vpaths.py arm-none-eabi-gcc /home/ewoud/paparazzi_check/var/aircrafts/CYFOAM/ap_tmp.list /home/ewoud/paparazzi_check
arm-none-eabi-gcc: error: ERROR:: No such file or directory
arm-none-eabi-gcc: error: found: No such file or directory
arm-none-eabi-gcc: error: more: No such file or directory
arm-none-eabi-gcc: error: than: No such file or directory
arm-none-eabi-gcc: error: once:: No such file or directory
arm-none-eabi-gcc: error: /home/ewoud/paparazzi_check/sw/ext/tlsf/tlsf.c/home/ewoud/paparazzi_check/sw/airborne/arch/chibios/mcu_arch.c: Not a directory

This if statement triggers 34 times for the first srcs[i]:
(line 58) if os.path.isfile(path.join(vpath, f)) :

I don't really understand what the vpath file does...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah this looks like #2182 !
Running it from the command line helped to look at the prints and errors:
python3 sw/tools/find_vpaths.py arm-none-eabi-gcc /home/ewoud/paparazzi_check/var/aircrafts/CYFOAM/ap_tmp.list

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find_vpaths again. Does it get better with the latest fix in master? (just rebase master on top this PR)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does get better! Thanks @podhrmic !

<module name="ins" type="float_invariant">
<define name="INS_PROPAGATE_FREQUENCY" value="500"/>
<define name="INS_FINV_MAG_ID" value="MAG_HMC58XX_SENDER_ID"/>
</module>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This airframe looks reversed...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not gona fix this :(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the issue here exactly ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The airframe order is reversed to the conventional order (firmware, control, sections, modes).

</firmware>

<modules main_freq="512">
<!--<module name="gps" type="ubx_ucenter"/>-->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are phasing out separate modules sections, can you move this to the firmware above (like you already did with your other modules?) additionally, I think the order the modules appear is important for how they are run so consider that, usually, the "subsystems" go first then the more mission specific modules.

STABILIZATION_INDI_G1_PITCH, STABILIZATION_INDI_G1_YAW, STABILIZATION_INDI_G1_THRUST
};

float g2_both[INDI_NUM_ACT] = STABILIZATION_INDI_G2; //scaled by INDI_G_SCALING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static?

<define name="BODY_TO_IMU_PSI" value="180." unit="deg"/>
</section>

<section name="AUTOPILOT">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is usually at the bottom of the airframe. I think we should discuss what the preferred order is for the future... I think it is beneficial to have a standard but that standard hasn't been clearly defined. @gautierhattenberger is this defined anywhere?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no definition of the order of the main nodes in airframe files at the moment. Even the DTD file is not reflecting anything in particular. Also the parser don't really care. We could edit somewhere a "recommended practice" guide. My preferred order is firmware, then "special nodes" (servos, commands, ...) and finally 'sections'.

- Added Cyfoam airframe file
- Added control effectiveness scheduling function
- More advanced scheduling function should be added in the future
- Added simple JSBsim files for Cyclone for a crude simulation
@gautierhattenberger
Copy link
Member

@EwoudSmeur @kirkscheper it looks fine now

@gautierhattenberger gautierhattenberger merged commit 95e60fe into paparazzi:master Dec 1, 2017
@EwoudSmeur EwoudSmeur deleted the cyfoam_master branch December 3, 2017 11:36
biancabndris pushed a commit to biancabndris/paparazzi that referenced this pull request Aug 29, 2018
* Cyfoam, ctrl effectiveness scheduling, JSBsim

- Added Cyfoam airframe file
- Added control effectiveness scheduling function
- More advanced scheduling function should be added in the future
- Added simple JSBsim files for Cyclone for a crude simulation

* only calculate pseudo inverse when using it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants