To expand on the answer of #q216036 : you can use rostopic
in your launch file exactly like you are using it in command line. You just need to set the attributes pkg
and type
to rostopic
, then you can use the attribute args
to pub/echo/info/list etc..with the propper arguments corresponding.
For example you can do :
<node pkg="rostopic" type="rostopic" name="name" args="list" output="screen"/>
This will simply output the result of rostopic list
.
If you want to echo
a topic, the template would be :
<arg name="topic_name" default="A_TOPIC_NAME"/>
<node pkg="rostopic" type="rostopic" name="name"
args="echo $(arg topic_name)" output="screen"/>
Like that you can call your launch file and specify the topic in command line :
roslaunch YOUR_PACKAGE YOUR_LAUNCH_FILE topic_name:=YOUR_TOPIC
Is #q216036 what you are looking for ?
I have read this answer but I don't understand what I should put in args=" /pkg_topic pkg_executable_file/message". My topic is /GPS/Data, my message type is wmcs_lib/GPSData with fields: float64 UTCTime wmcs_lib/LLD Position uint8 Fix float32 HDOP. I would like to print on one of these fileds.
how i can put multi or many publisher in the same file launch, this tuto explain only on waya https://www.youtube.com/watch?v=K3hQe...
thanks