
Previous chapter, [ Could not open serial port '/dev/ttyUSB0' ] in "serial_node.py" code for custom serial communication node
So, I changed to some codes
Recommend edit the 'serial_node.py'
nano ~/ros2_ws/src/serial_communication/serial_communication/serial_node.py
self.serial_port = '/dev/ttyACM0'
self.baud_rate = 115200

because, ttyUSB0 is already on rplidar a1
and ttyUSB1 isn't exist (maybe)
and ESP32 is showed on 'USB CDC(Communication Device Class)' so, shange the port name to
'/dev/ttyACM0'
cd ~/ros2_ws
colcon build --packages-select serial_communication
source install/setup.bash
ros2 run serial_communication serial_node

[INFO] [timestamp] [serial_communication_node]: Serial port /dev/ttyACM0 opened
Open new terminal, sourcing workspace
source ~/ros2_ws/install/setup.bash
ros2 topic pub /motor_commands std_msgs/String "data: 'forward'"
Node output result below
[INFO] [timestamp] [serial_communication_node]: Sent to ESP32: forward

work well!