-
Notifications
You must be signed in to change notification settings - Fork 127
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
Folder structure to use micro_ros_arduino with dependency #664
Comments
Hello @OtaviodaCruz, AFAIK in Arduino IDE you don't have control on the include folders so all the micro-ROS headers should be in the folder reachable by the compiler as an include path. It is discussed for example here. Regarding keeping track of the latest commit of the micro-ROS library, it is not straightforward in the current folder architecture. Have you thought about using Platform.IO? I'm not an expert in it but it seems to have better library management than Arduino IDE. |
Hello @pablogs9, thanks for the reply. I didn't think about using Platform.IO, but I'll try it out. As for folder architecture, do you suggest something to me? The best possibilities I think are:
I must admit that both of them don't seem interesting to me, but that's what I see as a possible solution. As for tracking the last commit of the micro-ROS library (and even the others), I was thinking of making a github action that more or less followed these steps:
I can do this once a day maybe. Sound like a good approach? If yes, do you suggest any workflow for the action? This is my first "big project" so these conceptual questions I imagine. |
(...) Perhaps these questions can help beginners who use micro_ros_arduino to create the structure of their projects, serving as a reference for use. |
You have an action that makes something similar here: https://github.com/micro-ROS/micro_ros_arduino/blob/galactic/.github/workflows/library_generation.yml. It just downloads the repo, makes some modifications (in this case running a docker command) and creates a PR with the changes. Regarding the folder structure, please keep us updated with your best choice. |
Okay. Thanks for the help @pablogs9. |
Hi, update on my decision:
I already have a part of the project in this structure and, until then, I intend to keep it there. |
Setup description:
Introduction
I'm working on a project as discussed here. For that, I'm using micro-ros-arduino.
My idea was to have the following file/folder structure:
.scicobot_hardware
├── _include
│ ├── micro_ros_arduino project
│ └── motor_control project
│ └── (...)
├── _docs
├── _calibration
├── _(...)
├── _src
│ └── scicobot_hardware.h
│ └── scicobot_hardware.cpp
See here.
However, this setup doesn't seem to work, I got the following error when trying to add scicobot_hardware.h to arduino:
As far as I understand, the compiler must be looking elsewhere for the transport.h file, because of the use of "<>". MAYBE this could be resolved by switching to something like:
#include "uxr/client/transport.h"
But it seems to me a less than optimal solution, first because I didn't want to change the file and second because it might be necessary to change other include directives.
The most attractive solution I see would be to take the files from "micro_ros_arduino/src" and put them in "scicobot_hardware/src". But I don't really like this form of organization.
Considering that I adopt this last solution, I would have to find a way to update the files automatically, as soon as "micro_ros_arduino" does some push (new commit in github). As I understand it, you have a similar process, for example, "src/rclc/client.h" does not seem to be an original file from the micro_ros_arduino project, it seems to me that it comes from here.
Questions
And finally... .
So, do you have any suggestions on how to insert micro_ros_arduino as a library in my project? How was the file architecture you thought to use the library?
Also, if you decide to insert the files from micro_ros_arduino/src into "scicobot_hardware/src", how could I automatically track updates from "micro_ros_arduino"? I saw about github actions (I even took a look at library_generation.yml file, but I couldn't deduce where UNBUILT libraries are updated, like src/rclc/client.h in this pull request. I also looked at git submodules, but it seems to me that then I would have to use the whole project, as I am doing now.
The text was updated successfully, but these errors were encountered: