-
Notifications
You must be signed in to change notification settings - Fork 117
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 support for Arduino Due and Arduino Zero #34
Conversation
@@ -46,3 +47,4 @@ jobs: | |||
arduino-cli compile --fqbn OpenCR:OpenCR:OpenCR /github/home/Arduino/libraries/micro_ros_arduino-0.0.1/examples/micro-ros_publisher -v | |||
arduino-cli compile --fqbn teensy:avr:teensy31 /github/home/Arduino/libraries/micro_ros_arduino-0.0.1/examples/micro-ros_publisher -v | |||
arduino-cli compile --fqbn teensy:avr:teensy41 /github/home/Arduino/libraries/micro_ros_arduino-0.0.1/examples/micro-ros_publisher -v | |||
arduino-cli compile --fqbn arduino:samd:arduino_zero_native /github/home/Arduino/libraries/micro_ros_arduino-0.0.1/examples/micro-ros_publisher -v |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI tests are missing here as the upstream version of Arduino Due core doesn't support static libraries. Here is a relevant PR:
arduino/ArduinoCore-sam#115
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'm curious to know why they allow precompiled linking and dont have to support in their own boards
@@ -0,0 +1,50 @@ | |||
#include <Arduino.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to be able to change the transport in the project instead of the library. MCUs usually have multiple UARTs that users may switch to, or to other protocols, SPI, I2C, and CAN. Also, we can benefit from Arduino's libraries to interact with those protocols. Defining transport in the project would be super handy.
However, in that case, we need to include the same transport file in all examples which is not the best solution. Let me know if you have any suggestions.
&& rm -rf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 gcc-arm-none-eabi-5_4-2016q3/share/doc \ | ||
&& wget https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2 \ | ||
&& tar -xvf gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2 \ | ||
&& rm -rf gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2 gcc-arm-none-eabi-4_8-2014q1/share/doc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't test, but probably we can recycle the same compiler for multiple platforms. I picked a safe route and took the same compiler that Arduino uses for the corresponding cores.
"-DRMW_UXRCE_MAX_PUBLISHERS=2", | ||
"-DRMW_UXRCE_MAX_SUBSCRIPTIONS=1", | ||
"-DRMW_UXRCE_MAX_SERVICES=0", | ||
"-DRMW_UXRCE_MAX_CLIENTS=1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without these changes, I wasn't able to fit the library into Arduino Zero. Ideally, we would also be able to change these parameters from an Arduino project (without changing and recompiling the library), but I didn't know how to solve it.
@@ -5,11 +5,8 @@ | |||
#include "teensy_transports.c.in" | |||
#elif defined(ARDUINO_ARCH_OPENCR) | |||
#include "opencr_transports.c.in" | |||
#else | |||
#error micro-ROS Library not supported for this platform | |||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The transport is defined in the Arduino project and we don't need these files here. Should we move the OpenCR and Teensy transport files?
@pablogs9 I was indecisive about a few things, so let me hear your thoughts and we can fix CI. |
Hello @lukicdarkoo, your comments are really interesting. I'm answering here:
|
Ok, I'm going to add a commit to this with:
|
Hey @lukicdarkoo, I have merged and integrated all your contributions. Check release v0.0.4. Thanks a lot for this. If you keep working on this and improving the micro-ROS for Arduino we are super happy to receive your PR. |
Thanks for this!
This sounds like a very good solution.
I was thinking about this, but, unfortunately, I cannot think of any good alternative. However, I believe there is a huge need to solve this, so we should keep thinking about possible solutions. |
i'm not the person who would be able to answer this but I feel like there is a possibility that the RMW that my friend @schilasky is working on over at this repo rmw_ecal might be able to help with? it uses ecal as its middleware...which might help with memory management. @schilasky is much more knowledgeable though. there is also rmw_iceoryx which might also be a viable solution? again....i dont really know what im talking about here so i might be completely off that either of these can actually help. |
This PR adds support for Arduino Due and Arduino Zero.