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

Add missing wrappers for uavcan/si #133

Merged
merged 8 commits into from
Sep 21, 2021
Merged

Conversation

joelsa
Copy link
Contributor

@joelsa joelsa commented Sep 13, 2021

This PR is intended as a draft PR related to #98. I started with uavcan/si/sample/acceleration. I plan on creating wrappers like this for all uavcan/si data types, but I would be very grateful if you @aentinger are able to check if this is the correct approach and how you intended it to be done before I move on to the rest.

@joelsa joelsa marked this pull request as draft September 13, 2021 13:48
@joelsa joelsa changed the title Add missing warppers for uavcan/si Add missing wrappers for uavcan/si Sep 13, 2021
Copy link
Member

@aentinger aentinger left a comment

Choose a reason for hiding this comment

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

Hi @joelsa ☕ 👋

Thank you very much for your contribution. I love it, it's mostly perfect. If you fix the namespace thing then you can copy this scheme for all missing types. Also I'll fix up the CI error for you sometime today.

src/wrappers/uavcan/si/sample/acceleration/Scalar_1_0.hpp Outdated Show resolved Hide resolved
@aentinger aentinger self-requested a review September 14, 2021 06:18
Copy link
Member

@aentinger aentinger left a comment

Choose a reason for hiding this comment

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

See above comment, sorry I had mis-clicked.

@aentinger
Copy link
Member

I've fixed the broken CI build in #134. Please rebase your PR on 107-Arduino-UAVCAN:master.

@joelsa
Copy link
Contributor Author

joelsa commented Sep 14, 2021

I've fixed the broken CI build in #134. Please rebase your PR on 107-Arduino-UAVCAN:master.

Thanks! I hope rebasing and then force-pushing my forked branch is the correct way? I did not see any other way since it could not be fast-forwarded.

@aentinger
Copy link
Member

Yes, in case of such a rebase you'll need a force-push (nothing wrong with --force in this scenario). Small improvement tip for your next PR: Create a branch within your fork instead of directly committing to your forked master branch, having a separate branch makes everything a bit easier.

@107-systems 107-systems deleted a comment from github-actions bot Sep 14, 2021
@aentinger
Copy link
Member

Good morning @joelsa 👋 ☕

How do you do? Any chance you can finish the implementation of the wrappers?

Cheers, Alex

@aentinger aentinger marked this pull request as ready for review September 21, 2021 11:29
@codecov-commenter
Copy link

Codecov Report

Merging #133 (02a6793) into master (4116902) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #133   +/-   ##
=======================================
  Coverage   85.64%   85.64%           
=======================================
  Files          17       17           
  Lines         641      641           
=======================================
  Hits          549      549           
  Misses         92       92           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update afc9596...02a6793. Read the comment docs.

@107-systems 107-systems deleted a comment from github-actions bot Sep 21, 2021
@joelsa
Copy link
Contributor Author

joelsa commented Sep 21, 2021

Good morning @joelsa

How do you do? Any chance you can finish the implementation of the wrappers?

Cheers, Alex

Hi 👋
It should be finished now, all the files under wrappers/uavcan/si now have a wrapper, and I added them all to the ArduinoUAVCANTypes.h
Thanks for the heads-up and sorry it took this long, the last week was exceptionally busy.

Now it looks to me like the wrappers are almost complete, but the following five are still missing:

  • uavcan/primitive/Empty_1_0.h
  • uavcan/primitive/String_1_0.h
  • uavcan/primitive/Unstructured_1_0.h
  • reg/drone/service/Error_0_1.h
  • reg/drone/service/Technology_0_1.h

Shall I implement those too?

@aentinger
Copy link
Member

Terrific, thank you! 👍 Looks like there's an issue with all the function names for _torque which contain one _ too many from what I can see. Could you please fix that?

With regards to the still-missing-types - that would be very neat for completeness, even if those types will never be used without composition into another type. I'd suggest another PR for those though.

@joelsa
Copy link
Contributor Author

joelsa commented Sep 21, 2021

There is https://github.com/107-systems/107-Arduino-UAVCAN/tree/master/src/types/uavcan/si/sample/_torque as well as https://github.com/107-systems/107-Arduino-UAVCAN/tree/master/src/types/uavcan/si/sample/torque
even though in the upstream public data types there is only https://github.com/UAVCAN/public_regulated_data_types/tree/master/uavcan/si/sample/torque

They are identical, do you want me to remove the redundant one, or is there a particular reason for the duplication?

@joelsa
Copy link
Contributor Author

joelsa commented Sep 21, 2021

I think it might have been a generation issue with Nunavut or something similar? In any case, the data types was only used in types/reg/drone/physics/dynamics/rotation/Planar_0_1.h and even though it was generated, I modified it, because I think the generation was erroneous in the first place. Please let me know if you want me to revert the commits and only remove the wrappers for this data type.

@pavel-kirienko
Copy link
Member

I think it might have been a generation issue with Nunavut or something similar?

Yes, already fixed: OpenCyphal/nunavut#188

@github-actions
Copy link

Memory usage change @ 67dceff

Board flash % RAM for global variables %
arduino:mbed_edge:edge_control 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nano33ble 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m4 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrfox1200 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrvidor4000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrzero 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp32:esp32:esp32 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
rp2040:rp2040:rpipico 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/UAVCAN-BMS-Subscribe
flash
% examples/UAVCAN-BMS-Subscribe
RAM for global variables
% examples/UAVCAN-Blink
flash
% examples/UAVCAN-Blink
RAM for global variables
% examples/UAVCAN-GNSS-Node
flash
% examples/UAVCAN-GNSS-Node
RAM for global variables
% examples/UAVCAN-Heartbeat-Publish
flash
% examples/UAVCAN-Heartbeat-Publish
RAM for global variables
% examples/UAVCAN-Heartbeat-Subscribe
flash
% examples/UAVCAN-Heartbeat-Subscribe
RAM for global variables
% examples/UAVCAN-Service-Client
flash
% examples/UAVCAN-Service-Client
RAM for global variables
% examples/UAVCAN-Service-Server
flash
% examples/UAVCAN-Service-Server
RAM for global variables
% examples/UAVCAN-ToF-Distance-Sensor-Node
flash
% examples/UAVCAN-ToF-Distance-Sensor-Node
RAM for global variables
%
arduino:mbed_edge:edge_control 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_nano:nano33ble 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_portenta:envie_m4 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_portenta:envie_m7 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkr1000 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0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0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
rp2040:rp2040:rpipico 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/UAVCAN-BMS-Subscribe<br>flash,%,examples/UAVCAN-BMS-Subscribe<br>RAM for global variables,%,examples/UAVCAN-Blink<br>flash,%,examples/UAVCAN-Blink<br>RAM for global variables,%,examples/UAVCAN-GNSS-Node<br>flash,%,examples/UAVCAN-GNSS-Node<br>RAM for global variables,%,examples/UAVCAN-Heartbeat-Publish<br>flash,%,examples/UAVCAN-Heartbeat-Publish<br>RAM for global variables,%,examples/UAVCAN-Heartbeat-Subscribe<br>flash,%,examples/UAVCAN-Heartbeat-Subscribe<br>RAM for global variables,%,examples/UAVCAN-Service-Client<br>flash,%,examples/UAVCAN-Service-Client<br>RAM for global variables,%,examples/UAVCAN-Service-Server<br>flash,%,examples/UAVCAN-Service-Server<br>RAM for global variables,%,examples/UAVCAN-ToF-Distance-Sensor-Node<br>flash,%,examples/UAVCAN-ToF-Distance-Sensor-Node<br>RAM for global variables,%
arduino:mbed_edge:edge_control,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nano:nano33ble,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_portenta:envie_m4,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,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,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrzero,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
esp32:esp32:esp32,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
rp2040:rp2040:rpipico,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0

Copy link
Member

@aentinger aentinger left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thank you very much! ❤️

@aentinger
Copy link
Member

Please let me know if you want me to revert the commits and only remove the wrappers for this data type.

You allready resolved everything in a perfect way! Thank you! In the (possibly nearer) future there shall be automatic header generation, re-running the C headers was / is on my todo-list.

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