Robotics StackExchange | Archived questions

how to make multiple topics with nmea_navsat_driver

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

Asked by SupermanPrime01 on 2017-04-25 17:34:00 UTC

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?

Asked by gvdhoorn on 2017-04-26 02:19:19 UTC

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

Asked by SupermanPrime01 on 2017-04-26 18:28:55 UTC

"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.

Asked by SupermanPrime01 on 2017-04-26 18:31:32 UTC

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.

Asked by gvdhoorn on 2017-04-27 09:21:35 UTC

Answers