Multi-Neato and Integration
The goal of the Multi Neato subteam was to learn how to launch and control two Neatos on the same device, and to set up the publishers that would allow multiple files to interact with the Neatos. We began work early, and about halfway through the project we were able to dissolve to support the other two subteams.
We began by altering a simple, one Neato teleop code to control two Neatos. In order to successfully control two Neatos from one computer, each neato needs a specific namespace, which is used in all of the publishers to that Neato.
For example, in our teleop code we changed:
self.vel_pub = self.create_publisher(Twist, ‘cmd_vel', 10)
to:
self.vel_pub1 = self.create_publisher(Twist, 'namespace1\cmd_vel', 10)
self.vel_pub2 = self.create_publisher(Twist, ‘namespace2\cmd_vel', 10)
Similarly, To subscribe to information from a specific Neato, such as camera or lidar data, you need to use that Neato’s namespace as well.
Once we had successfully set up multi-Neato teleop, we began working with the localization and machine vision teams to adapt their code for multiple Neatos.
In our final code, the controls of the two Neatos swap when one tags the other. We achieved this by changing which namespace each control file (chase_logic.py and teleop.py) publishes to when the bump sensor is detected.