BLUF: I am unable to use Teensy with Micro-ROS in any version of Arduino (1.8.x or 2.x) due to errors with libraries that I do not know how to resolve
What I am using:
Hi, I'm a novice user, but have been using a Teensy 3.2 to control some serial devices with json messaging from a Python script. I am now trying to improve the system by incorporating Micro-ROS and controlling the device with ROS messaging. I have followed a handful of guides but have found these two to be the most comprehensive and have followed them as best I can:
When using the Micro-ROS Tutorial, I have failed to successfully compile the "micro_ros_publisher.ino" file:
I have had some success with the tutorial in both Arduino 1.8.x and Arduino 2.x. In both, I have gotten the Teensy working with Arduino for all programs not incorporating Micro-ROS. Upon incorporating Micro-ROS, however, I am stuck. When compiling the example code from the tutorial, "micro_ros_publisher.ino", I am met with the same error in both Arduino versions (I have replaced "/home/username" with "~" for anonymity):
I have found the libraries online, but do not know how to take this source code and place it in the Arduino library correctly:
When attempting to follow the Micro-ROS GitHub's README instructions, I am unable to complete the How to build the precompiled library step:
This walk-through uses docker to build the precompiled libraries, but the commands listed cause issues when I run them in terminal:
I apologize if this is insufficient information provided, but I greatly appreciate any and all help you can provide! Thank you for your time.
What I am using:
- Ubuntu 22.04
- Teensy 3.2
- Arduino 1.8.19 & Arduino 2.1.1
- ROS Humble
Hi, I'm a novice user, but have been using a Teensy 3.2 to control some serial devices with json messaging from a Python script. I am now trying to improve the system by incorporating Micro-ROS and controlling the device with ROS messaging. I have followed a handful of guides but have found these two to be the most comprehensive and have followed them as best I can:
When using the Micro-ROS Tutorial, I have failed to successfully compile the "micro_ros_publisher.ino" file:
I have had some success with the tutorial in both Arduino 1.8.x and Arduino 2.x. In both, I have gotten the Teensy working with Arduino for all programs not incorporating Micro-ROS. Upon incorporating Micro-ROS, however, I am stuck. When compiling the example code from the tutorial, "micro_ros_publisher.ino", I am met with the same error in both Arduino versions (I have replaced "/home/username" with "~" for anonymity):
Code:
WARNING: library micro_ros_arduino claims to run on stm32, OpenCR, Teensyduino, samd, sam, mbed, esp32, mbed_portenta architecture(s) and may be incompatible with your current board which runs on avr architecture(s).
Library micro_ros_arduino has been declared precompiled:
Using precompiled library in ~/Arduino/libraries/micro_ros_arduino-2.0.7-humble/src/mk20dx256
The platform does not support 'compiler.libraries.ldflags' for precompiled libraries.
~/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /tmp/arduino/sketches/86D3DC662F02BE1363BEFA39A70A0B11/sketch/micro_ros_publisher.ino.cpp.o: in function `timer_callback(rcl_timer_s*, long long)':
~/Arduino/micro_ros_publisher/micro_ros_publisher.ino:36: undefined reference to `rcl_publish'
~/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /tmp/arduino/sketches/86D3DC662F02BE1363BEFA39A70A0B11/sketch/micro_ros_publisher.ino.cpp.o: in function `setup':
~/Arduino/libraries/micro_ros_arduino-2.0.7-humble/src/micro_ros_arduino.h:33: undefined reference to `rmw_uros_set_custom_transport'
~/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /tmp/arduino/sketches/86D3DC662F02BE1363BEFA39A70A0B11/sketch/micro_ros_publisher.ino.cpp.o: in function `setup':
~/Arduino/micro_ros_publisher/micro_ros_publisher.ino:49: undefined reference to `rcutils_get_default_allocator'
~/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: ~/Arduino/micro_ros_publisher/micro_ros_publisher.ino:52: undefined reference to `rclc_support_init'
~/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: ~/Arduino/micro_ros_publisher/micro_ros_publisher.ino:55: undefined reference to `rclc_node_init_default'
~/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: ~/Arduino/micro_ros_publisher/micro_ros_publisher.ino:58: undefined reference to `rosidl_typesupport_c__get_message_type_support_handle__std_msgs__msg__Int32'
~/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: ~/Arduino/micro_ros_publisher/micro_ros_publisher.ino:58: undefined reference to `rclc_publisher_init_default'
~/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: ~/Arduino/micro_ros_publisher/micro_ros_publisher.ino:66: undefined reference to `rclc_timer_init_default'
~/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: ~/Arduino/micro_ros_publisher/micro_ros_publisher.ino:73: undefined reference to `rclc_executor_init'
~/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: ~/Arduino/micro_ros_publisher/micro_ros_publisher.ino:74: undefined reference to `rclc_executor_add_timer'
~/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /tmp/arduino/sketches/86D3DC662F02BE1363BEFA39A70A0B11/sketch/micro_ros_publisher.ino.cpp.o: in function `loop':
~/Arduino/micro_ros_publisher/micro_ros_publisher.ino:81: undefined reference to `rclc_executor_spin_some'
collect2: error: ld returned 1 exit status
exit status 1
Compilation error: exit status 1
I have found the libraries online, but do not know how to take this source code and place it in the Arduino library correctly:
When attempting to follow the Micro-ROS GitHub's README instructions, I am unable to complete the How to build the precompiled library step:
This walk-through uses docker to build the precompiled libraries, but the commands listed cause issues when I run them in terminal:
Code:
$ docker run -it --rm -v $(pwd):/project --env MICROROS_LIBRARY_FOLDER=extras microros/micro_ros_static_library_builder:humble
dos2unix: /project/extras/library_generation/library_generation.sh: No such file or directory
dos2unix: Skipping /project/extras/library_generation/library_generation.sh, not a regular file.
I apologize if this is insufficient information provided, but I greatly appreciate any and all help you can provide! Thank you for your time.