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

ogma-core: Map float and double to the same types in C++. Refs #138. #142

Merged
merged 4 commits into from
May 22, 2024

Conversation

ivanperez-keera
Copy link
Member

Modify the ROS backend to map the input types float and double to the same types in the generated C++ ROS nodes, as prescribed in the solution proposed for #138.

The ROS backend is, by default, assuming that the data carried by
std_msgs::msg::Float32 is of type float32, when it appears to be just a
float. The same is happening for Float64, float64 and double. The code
currently produced for those cases does not compile.

The type mappings are described in
http://docs.ros.org/en/humble/Concepts/Basic/About-Interfaces.html,
which states that, in C++, float and double should be used.

This commit modifies the ROS backend so that it expects global variables
of input types `float` and `double` in the variable DB to have the types
`float` and `double`, respectively, in the generated C++ code.
…#138.

This commit modifies an example to use also an input variable of type
float and one of type double, both of which were failing in the ROS
backend.

The example in question is currently being used by a CI script to test
the ROS backend, making the new example serve as a regression test.
@ivanperez-keera ivanperez-keera changed the title ogma-core: Map float and double to the same types in C++. Refs #138. ogma-core: Map float and double to the same types in C++. Refs #138. May 22, 2024
@ivanperez-keera
Copy link
Member Author

Change Manager: Verified that:

@ivanperez-keera ivanperez-keera merged commit 5070d63 into develop May 22, 2024
4 checks passed
@ivanperez-keera ivanperez-keera deleted the develop-ros-float branch May 22, 2024 07:15
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.

1 participant