0
$\begingroup$

Rosanswers logo

Hi,

I've been looking at ways to publish keyboard commands to a UART serial port and the top result keeps pointing me to rosserial, but I'm not entirely sure this exactly fits my needs. Ideally, I want to be able to send keyboard events to my flight controller through PPM signals because I already have the hardware that would send signals from a serial port to my flight controller. This is how I envision it would go from all the materials I have:

KEYPRESS (Twist message) ==> UART SERIAL PORT (probably ttyS1) ==> PPM ENCODER (not an Arduino) ==> FLIGHT CONTROLLER

I found that I can publish Twist messages using either the key_teleop module or teleop_twist_keyboard, but I'm stuck as to how to send this to a serial port (i.e. ttyS1). Would I simply need to write my own ROS node and use pyserial (since I would be writing in python) to open the port and pass the message in? Or can I use rosserial somehow to pass in Twist messages?

Thank you in advance and please excuse me for asking a noob question.

Trixie


Originally posted by trixr4kdz on ROS Answers with karma: 45 on 2018-03-13

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

rosserial will assume control over your serial port, so if that port is being used by something else -- and that 'something' is not a rosserial client -- that is probably not what you want.

Would I simply need to write my own ROS node and use pyserial (since I would be writing in python) to open the port and pass the message in?

If you're basically trying to convert ROS geometry_msgs/Twist msgs into something your remote system can use, then yes, you'll probably have to write a node that does this for you.

Please take the time to first search for an existing solution / implementation though, as it's likely someone (or multiple someones) has (have) already done this.


Originally posted by gvdhoorn with karma: 86574 on 2018-03-14

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.