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

The "inside" function does not work as it should. #602

Closed
OpenUAS opened this issue Dec 28, 2013 · 1 comment
Closed

The "inside" function does not work as it should. #602

OpenUAS opened this issue Dec 28, 2013 · 1 comment
Milestone

Comments

@OpenUAS
Copy link
Contributor

OpenUAS commented Dec 28, 2013

The "inside" function does not work as it should. It does in v4.2.2 but not in v5.0 and 5.1_dev

It is a crucial function IMHO and should be on top of the issue list. I nearly lost aircraft because of this, actually I did notice some weird behavior but thought it was some other mistake I've made myself in my flightplan exceptions.

Step to Reproduce:

Run default microjet with flightplan versatile, launch it, let it take off to standby, the click on flightplan "Stay inside Square"
In v4.2 correct behavior, in v5.x not flips back an forth go WP1 an is inside.

I've also tested with all own flightplans using this function, same issue.

CORRECT:
correctv4 22behaviour

INCORRECT:
not_okv51dev

The generated code however is the same!

v4.2.2

static inline bool_t InsideSquare(float _x, float _y) {
if (_y <= 200.0) {
if (_y <= 0.0) {
return FALSE;
} else {
return (-100.0<= _x && _x <= 100.0);
}
} else {
return FALSE;
}
}

v5.1_dev_xyz

static inline bool_t InsideSquare(float _x, float _y) {
if (_y <= 200.0) {
if (_y <= 0.0) {
return FALSE;
} else {
return (-100.0<= _x && _x <= 100.0);
}
} else {
return FALSE;
}
}

@OpenUAS
Copy link
Contributor Author

OpenUAS commented Dec 29, 2013

You are the PPRZ Hero of the day, thanks for the fix, really appreciated.

gautierhattenberger added a commit that referenced this issue Mar 4, 2014
allows to use the macro with sectors detection

fix #602
flixr added a commit that referenced this issue Mar 5, 2014
- fix perl script compile_all_test_targets
- add pcre lib to jsbsim, cleanup shell commands
- fix InsideX for sectors (GetPosX and GetPosY in nav.h (FW) are in local coordinates)
  #[602]  (#602)
- stm32: enable correct error interrupts for i2c2 and i2c3
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

No branches or pull requests

1 participant