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

Inverting the Signal #53

Open
jonas-frei opened this issue May 27, 2022 · 0 comments
Open

Inverting the Signal #53

jonas-frei opened this issue May 27, 2022 · 0 comments

Comments

@jonas-frei
Copy link
Contributor

There is an example on the wiki about inverting the signal: https://wiki.eeros.org/eeros_architecture/hal/scaling_multi

Using this inv stage does not result in an inversion but some really strange behaviour (output goes to max value and remains there). I assume that there is a bug in the JsonPaser::calcScale function (https://github.com/eeros-project/eeros-framework/blob/6fcc962cfdb4e6042cf93f5dc00996a6de4ca210/src/hal/JsonParser.cpp line 193).

If I use

{"id" : "inv",
  "scale": -1.0, "offset": 0.0 }

instead of

{"id" : "inv",
  "minIn":   -1.0, "maxIn":  1.0,
  "minOut":  1.0, "maxOut": -1.0 }

as suggested by the wiki, then it works. So the problem is most likely somewhere on the lines 283-289.

Sidenote: using

{"id" : "inv",
  "scale": -1.0 }

works as well, since the hal does not check if the offset parameter is given and then just assumes that it is 0. This might be a feature or an additional bug.

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