how to make multiple topics with nmea_navsat_driver [closed]

asked 2017-04-25 17:34:00 -0500

SupermanPrime01 gravatar image

Hello,

I'm trying to figure out how to create 2 nodes and 2 topics for 2 GPS receivers. I'm not sure which files to adjust. Can anyone shed some light in which files I would modify to add the init_node command and publish command?

Thank you

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by SupermanPrime01
close date 2017-04-25 21:36:10.077587

Comments

Could you please tell us what you ended up doing that solved your question? That way future readers could potentially use the same appraoch.

I'm guessing you used the name attribute of the node tag in a launch file?

gvdhoorn gravatar image gvdhoorn  ( 2017-04-26 02:19:19 -0500 )edit

Sure thing. So what I did was I duplicated the file "nmea_serieal_driver" in the "nmea_navsat_driver/scripts" folder and renamed it to "nmea_serieal_driver1". Then I went into the code and changed the "rospy.init_node" name and anywhere it said "libnmea_navsat_driver.driver", I changed it to

SupermanPrime01 gravatar image SupermanPrime01  ( 2017-04-26 18:28:55 -0500 )edit

"libnmea_navsat_driver.driver1" then I went to the "nmea_navsat_driver/src/libnmea_navsat_driver.driver" folder to duplicated "driver.py" to "driver1.py" and within the document I changed the publishing topic from fix to fix1.

SupermanPrime01 gravatar image SupermanPrime01  ( 2017-04-26 18:31:32 -0500 )edit
1

Ok. So that is what you don't want to do.

Look into ROS launch files, specifically the name attribute of the node element, and perhaps the group element with the ns attribute.

That will allow you to start an 'infinite' nr of instances of the same node without editing any source code.

gvdhoorn gravatar image gvdhoorn  ( 2017-04-27 09:21:35 -0500 )edit