Skip to content

Folder structure to use micro_ros_arduino with dependency #664

@OtaviodaCruz

Description

@OtaviodaCruz

Setup description:

  • ubuntu facal fossa with ROS2 foxy.

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:

/home/otavio/Arduino/libraries/scicobot_hardware/src/micro_ros_arduino/src/micro_ros_arduino.h:16:34: fatal error: uxr/client/transport.h: No such file or directory
#include <uxr/client/transport.h>

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions