Robotics StackExchange | Archived questions

Creating a publisher to a Serial Port

Hello, I was wondering if it would be possible to create a publisher node that will send coordinates to a serial port (which is connected to a Teensy 4.0 board) without the usage of Micro-ROS or anything of the like. (i.e. just import serial in the node and proceed as usual)

Asked by RH1622 on 2023-07-03 15:48:07 UTC

Comments

Answers

Yes, as long as you know what to send to the serial port. The C++ serial library is not migrated over to ROS2 officially (last I checked), so you will have to install the colcon-enabled branch of serial manually and import it in your code (I used the ros2 branch of this repo )

Then wherever in your code you just use Serial::serial controller; and then controller.write(); to send messages over the serial port.

Asked by chased11 on 2023-07-04 22:34:09 UTC

Comments