Closed sugithub7 closed 1 year ago
I suspect that the characters are not being displayed correctly because they are overlapping with the communication information between the micro-ROS and the PC.
Exactly, you need to use a different serial port to send debug messages.
Also, are you building with multithread support enabled?
Dear Acuadros95, thank you very much for your advice regarding serial print.
I usually work on developing PC software, and this is my first time implementing a program on an ESP32. I am using Arduino IDE 1.8.19, but I couldn't find any information on how to configure the multi-threading support. I apologize for the inconvenience, but could you please guide me on how to set it up properly?
I apologize if this deviates from the main topic of my question, but I am also trying to subscribe to UInt8MultiArray messages in another program. When I published the message from my PC, the micro-ROS callback did not function. However, when I changed the message type to String and tested the subscription, it worked. I thought there might be a mistake in the way I allocated memory for the UInt8MultiArray messages, so I tried various methods while researching, but I have not been successful. I am sorry for being presumptuous, but could you please show me the correct way to allocate memory for UInt8MultiArray messages?
Here is a tutorial on how to enable the multi thread support: tutorial
UCLIENT_PROFILE_MULTITHREAD
flag on the colcon.meta file and rebuild the library (detail)As for the message memory issues, check this tutorial on message memory management: tutorial. Pay special attention to the sequence types.
Anyway, if you are using an ESP32, I encourage you to check the micro-ROS component for ESP-IDF. It even include a multithread publisher example.
Dear Acuadros95,
I truly appreciate your thoughtful and thorough responses to my questions. I will continue to learn and gain experience with micro-ROS, striving to create something useful for others.
Thank you very much for your help.
Hardware description: ESP32 RTOS: Yes Installation type: Arduino IDE Version or commit hash: Humble Framework: Arduino
I am working on creating a program that can communicate with ROS2 Humble using micro-ROS. I am using an ESP32 device and connecting it to a computer via USB.
I am trying to display information using serial print for debugging the program, but the characters are getting cut off, garbled, and the debugging messages are not being utilized effectively. I suspect that the characters are not being displayed correctly because they are overlapping with the communication information between the micro-ROS and the PC.
I will attach sample programs and images of the serial monitor, so could you please advise me on how to efficiently debug this issue?
Steps to reproduce the issue Please flash this program onto the ESP32 and run it.
Actual behavior
Additional information I cannot share the details of the program I recently created here, but compared to this sample, the processing is more complex and the number of characters output is much larger, making the issue more serious.
Thank you for your assistance.