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

ArduPilot interface: generated code contains double data types #5

Open
ybeyer opened this issue May 9, 2022 · 1 comment
Open

ArduPilot interface: generated code contains double data types #5

ybeyer opened this issue May 9, 2022 · 1 comment

Comments

@ybeyer
Copy link
Contributor

ybeyer commented May 9, 2022

We updated the ArduPilot interface so that the default data type should be single and that no single data types need to be specified in the code itself.
However, at least double parameters from the workspace are generated as doubles in the C++ code in rtwtypes (real_T double ...).
As a workaround, the user can manually change "double" to "float" in the generated code if doubles are not desired.

@EikeBremers
Copy link

The proposed solution to use the Single Precision Converter does not seem to work.
Since the Converter seem to be incompatible with custom simulink library functions.

As a possible solution any constants constants in functions might be initialized by using the superiorfloat function.
e.g. x = zeros(size_x,superiorfloat(input_arg)).
And thus setting the data type depending on the fuction input (input_arg).

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

2 participants