-
-
Notifications
You must be signed in to change notification settings - Fork 33
Where does nunavut generated files get copied to ? #72
Comments
Hi 👋 ☕ < #include <uavcan/node/Health_1_0.h>
< #include <uavcan/node/Mode_1_0.h>
---
> #include "Health_1_0.h"
> #include "Mode_1_0.h" However, a short lookup unearthed arduino/arduino-cli#502 - which - if it is merged should allow you to specify additional include paths. |
I think this is a bit too far to support the out of box functionality. The same solution could be done with
|
Yes, not yet. It might be in the future. However, I do believe that it makes sense to store both generated C headers and handcoded wrappers both in the same repository so that the user does not have to work with the nunavut generated headers at all (as it currently is with all types provided by 107-Arduino-UAVCAN). If you think about it: Why would you store the wrappers that refer to and depend an the generated header files but not store the header files themselves? And if the DSDL changes it's as simple as creating a new library version of 107-Arduino-UAVCAN and distribute it via the library manager system. (Storing all generated C header files + Arduino wrappers is currently discussed here: #65) |
If the DSDL's are edited, there is a manual process to copy and paste them. Keeping the wrapper and the DSDLs separate creates a lot more clarity in the developing environment IMHO. There isn't a need to copy store another script to rename the header files or copy the nunavut files to another location if they are separate. Imagine if there are few tens to 100s of DSDL files that need to be copied. Arduino, from what I understand, is primarily a good stepping stone for someone starting to use a new architecture/framework. However, if that stepping stone is paving the way to two different implementation approaches, it may result in hobbyist, companies following these practices moving forward including shipping beta products with them(I know I have done that. ) ? It is a step that may be retracted, but is there a value from providing conflicting implementation habits ? |
@aentinger I understand that the suggestion mentioned is a bit different from the previous convention, but could we adopt the new convention? |
Hi 👋 I'm still not quite sure what you are advocating for - maybe you can clarify? As I wrote above too, I don't see any sense in checking in wrappers while simultaneously not checking in the header files those wrappers are referring too. I agree with the opinion voiced by Scott over here. As a consequence I'd provide at least the already defined and released uavcan data types within this library. As reg/drone will only be extended (but not changed anymore) those types could be provided in a similar way. Certainly beats the approach that every user has to rewrite his wrappers from scratch. As an Arduino library I'm obliged to make thinks simple and not, as Scott put it, take software best practice approaches into account. |
I am not against storing the header files. Here are the suggestions in short:
I think this adds zero complexity to a new user while providing the right structure to take the next step. |
Thank you for clarifying your message, I do believe I understand now what you are talking about and I feel our opinions are quite (although not completely) overlapping already. Here's what I propose (also see this branch):
107-Arduino-UAVCAN/src/types$ tree reg/
reg/
└── drone
├── physics
│ └── electricity
│ ├── Power_0_1.h
│ ├── PowerTs_0_1.h
│ ├── Source_0_1.h
│ ├── SourceTs_0_1.h
│ └── SourceTs_0_1.hpp
└── service
├── battery
│ ├── Error_0_1.h
│ ├── Parameters_0_1.h
│ ├── Parameters_0_1.hpp
│ ├── Status_0_1.h
│ ├── Status_0_1.hpp
│ └── Technology_0_1.h
└── common
├── Heartbeat_0_1.h
└── Readiness_0_1.h
namespace reg {
namespace drone {
namespace service {
namespace battery {
template <CanardPortID ID>
class Parameters_0_1
#include "types/reg/drone/physics/electricity/SourceTs_0_1.hpp"
#include "types/reg/drone/service/battery/Parameters_0_1.hpp"
#include "types/reg/drone/service/battery/Status_0_1.hpp" However, what I will not be able to do is to support the 0.2 version of battery message types which currently only exists in your fork. I will limit support and inclusion into 107-Arduino-UAVCAN only to those types pushed upstream into https://github.com/UAVCAN/public_regulated_data_types. |
What is the downside of keeping two duplicate folder structures. types/reg/
└── drone
├── physics
│ └── electricity
│ ├── Power_0_1.h
│ ├── PowerTs_0_1.h
│ ├── Source_0_1.h
│ ├── SourceTs_0_1.h
└── service
├── battery
│ ├── Error_0_1.h
│ ├── Parameters_0_1.h
│ ├── Status_0_1.h
│ └── Technology_0_1.h
└── common
├── Heartbeat_0_1.h
└── Readiness_0_1.h and another wrappers/reg/
└── drone
├── physics
│ └── electricity
│ └── SourceTs_0_1.hpp
└── service
├── battery
│ ├── Parameters_0_1.hpp
│ ├── Status_0_1.hpp
└── common This helps with
Isn't creating a duplicate folder structure (not files) providing so much more clarity than the extra space overhead it creates ?
This has made it to master branch with a PR |
I'll think over your suggestion re folder structure. As your PR made it to master there's nothing standing in the way of supporting that too. We could then also include your BMS example sketch here. |
I've mediated on your desire for a duplicate folder structure and came to the conclusion that the advantages outweigh the benefits. Now you could go ahead and add support for version 0.2 of the battery messages. |
very cool! |
There is a src folder where the
-types
--uavcan
-utility
....
is present I see that the automatically generated header files are all edited to account for the fact that Arduino cannot be given an additional -I flag to include the "types" folder. This would mean that all the autogenerated files are manually edited.
Is this right ?
The text was updated successfully, but these errors were encountered: