How to roslaunch a rostopic echo to text file.
I would like to do something like this from a launch file:
rostopic echo -p /mytopic > outputfile.txt
I wrote this in the launch file:
<node name="pioneer3at" pkg="rostopic" type="rostopic" output="screen" args="echo -p /tf_P3AT > outputfile.txt">
</node>
However, it doesn't work and I received an error like this:
Usage: rostopic echo [options] /topic
rostopic: error: you may only specify one input topic
[pioneer3at-1] process has died [pid 3482, exit code 2, cmd /opt/ros/indigo/lib/rostopic/rostopic echo -p /tf_P3AT > outputfile.txt __name:=pioneer3at __log:=/home/danieladmin/.ros/log/873003e4c-9bb4-11e4-8a96-08002709c13/pioneer3at-1*.log].
log file: /home/user/.ros/log/edae921e-f970-11e2-be82-14feb5b7467c/output_topic1-8*.log
Similar to as listed in this question:
http://answers.ros.org/question/70009...
If I delete the part that saves to file, specifically:
> outputfile.txt
I am able to print the args to screen. Does xml have another command that I may use for > to save to file? Else do I need some other work around?
Also, I prefer not to use a bag file in this instance for my workflow.
Why the option parameter
-p
? I cannot find it in theecho
man page-p Displays messages in a matlab/octave-friendly plotting format. Cannot be used with -c. Check here: link text