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

Creating a publisher to a Serial Port

asked 2023-07-03 15:48:07 -0600

RH1622 gravatar image

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)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-07-04 22:34:09 -0600

chased11 gravatar image

updated 2023-07-04 22:34:28 -0600

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-07-03 15:48:07 -0600

Seen: 335 times

Last updated: Jul 04 '23