rostopic pub does not allow carriage return or line feed in the string
Am am trying to send a string like
AT\r\n
to a modem through a String topic in ROS
I am able to do it in code but I can not do it in a terminal window
rostopic pub /my_topic std_msgs/String "data: 'AT\r\n'"
Is there a way to do this?
I have one terminal opened with
$ rostopic echo /foo
and another where I do$ rostopic pub /foo std_msgs/String 'AT\r\n'
. The first one receives, as expected:The same output can be achieved with
$ rostopic pub /banana std_msgs/String "{data: AT\r\n}"
which is more similar to your syntax.This to say I don't think your issue is clear. Is it that you don't want the double backslash? Or you want the
\r
and\n
to be interpreted as carriage return?Yes I want the \r and \n to be interpreted as CR and LF