ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

uROS Teensy Service issue

asked 2022-10-07 15:07:45 -0500

PointCloud gravatar image

updated 2022-10-07 16:26:25 -0500

Hi all,

I'm working on porting more examples into the

micro-ROS/micro_ros_platformio

repository. I'm trying to use Teensy 4.1 with microROS, (uROS) under PlatformIO on Ubuntu 22.04.1 and ROS2 Humble

Currently the examples for micro_ros_platformio are limited to the

micro-ros_publisher

And I plan on expanding the repository with the work I'm preparing here. So be clear to understand this is not only for personal experience, but also to give back to the community.

However, I'm facing some challenges. I'm trying to change the arduino example step by step for teensy in platformIO

micro-ros_addtwoints_service

From

micro_ros_arduino/examples/

After this is successfull and I understand how to get it working I will merge it back and work also on the following.

micro-ros_subscriber
micro-ros_subscriber_twist
micro-ros_tf_publisher

So far I have spent 2 entire weekends researching and trying things on my own, but I can't figure it out. And before I burn more time on this I would kindly ask you for assistance. Please help me with the issue below to get me started and across my initial hurdle.

FIRST PROBLEM

in the below code it fails and shows red underline squiggles for the following line of code:

#include <example_interfaces/srv/add_two_ints.h>

FIRST PROBLEM FIX

was adding the proper include path for intelliSense. -> edit includepath setting-> added /opt/ros/humble/include/** to the bottom of the list

SECOND PROBLEM

void setup() { set_microros_transports(); delay(1000);

Inside the setup() it dowsn't know "set_microros_transports(); and also delay() is not known and it complains about it.

SECOND PROBLEM SOLUTION

As per the micro_ros_platformio documentation, I ensured the proper transports protocol is selected in platformio.ini

and under setup() I have added the following:

Serial.begin(115200);
set_microros_serial_transports(Serial);

The of course the compiler complained about Serial. being unknown. So I knew I forgot to

#include <Arduino.h>

PROBLEM THREE

When compiling / building the entire project following the documentation with the PlatformIO workflow:

pio lib install # Install dependencies
pio run # Build the firmware
pio run --target upload # Flash the firmware

I'm getting build errors and the compilation fails: Here the output:

administrator@dev01:~/Documents/gitclones/AutoBot_uros$ pio lib install

WARNING: This command is deprecated and will be removed in the next releases. 
Please use `pio pkg install` instead.

Resolving teensy41 dependencies...
Library Manager: Installing git+https://github.com/micro-ROS/micro_ros_platformio
git version 2.34.1
Cloning into '/home/administrator/.platformio/.cache/tmp/pkg-installing-7zkg7pja'...
remote: Enumerating objects: 67, done.
remote: Counting objects: 100% (67/67), done.
remote: Compressing objects: 100% (52/52), done.
remote: Total 67 (delta 10), reused 44 (delta 4), pack-reused 0
Receiving objects: 100% (67/67), 125.47 KiB | 1.04 MiB/s, done.
Resolving deltas: 100% (10/10), done.
Library Manager: micro_ros_platformio@0.0.1+sha.22cf9b6 has been installed!
administrator@dev01:~/Documents/gitclones/AutoBot_uros$ pio run 
Processing teensy41 (platform: teensy; board: teensy41; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy41.html ...
(more)
edit retag flag offensive close merge delete

Comments

1

This question may be related to #q407573 and #q407572

ravijoshi gravatar image ravijoshi  ( 2022-10-07 22:35:44 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-10-10 00:52:33 -0500

Pablogs gravatar image

Answers here: https://github.com/micro-ROS/micro_ro... I guess...

Please do not duplicate this in Github + Answers + ROS discourse. GitHub is enough for technical issues. If you need to ping us, the micro-ROS maintainer's mails are public and we have a Slack community that you can find here: https://micro.ros.org/

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-10-07 15:07:45 -0500

Seen: 216 times

Last updated: Oct 10 '22