Closed pkowalsk1 closed 1 year ago
I addressed this issue within the context of the provided pull request. It appears that a pivotal step was the removal of the board_microros_transport = serial
line from the platformio.ini
file.
I successfully leveraged GP12
and GP13
as the RX
and TX
pins, achieving this by employing the gpio_set_function()
prior to invoking the begin()
method of my UART class object.
Steps to reproduce the issue
I have a Raspberry Pi 4B and an RPi Pico, and I want to utilize Serial1 (GPIO 0 and 1) for serial communication. When using USB communication and
Serial
, everything works fine. However, when attempting to useSerial1
and GPIO pins, I encounter the following problem:include <rcl/rcl.h>
include <rclc/executor.h>
include <rclc/rclc.h>
...
void setup() { pinMode(LED_BUILTIN, OUTPUT);
Serial1.begin(576000); while (!Serial1) ;
set_microros_serial_transports(Serial1); delay(2000);
// Rest of uRos entities (pubs, subs) ...
digitalWrite(LED_BUILTIN, HIGH); delay(100); }
void loop() { RCSOFTCHECK(rclc_executor_spin_some(&executor, RCL_MS_TO_NS(10))); }
Actual behavior
set_microros_serial_transports
orrmw_uros_set_custom_transport
functions fail and myerror_loop
starts executing.Logs from microros-agent container:
Additional information
I have also tried using other pins such as 12, 13, 17, and 15 for Serial1, but the problem persists. (
arduino::UART MySerial(12, 13, NC, NC);
orgpio_set_function(xx, GPIO_FUNC_UART);
)The issue with Serial1 is further manifested by the fact that I cannot use Serial1.println("hello") without including a delay(1) function in between.
You can find my attempts here, especially regarding the transport configuration.