MuSHR main loopFebruary 1, 2021 at 6:57am
Hi! I'm student that study MuSHR, ROS. I'm curious about main loop in MuSHR or ROS I think that MuSHR doesn't have main loop but nodes have main loop. So, nodes contain separate logic roles and are running by connecting from master. Is it right?? And, Does ROS have main loop? Please tell me anything you know...
February 1, 2021 at 1:32pm
Hi! yeah so you are correct that each ros node has a main thread and they communicate over various topics. ROS has some internal timing loops running in ROS master but for most purposes you can ignore that. A good resource to get a basic understanding of topics/services/master here sections 1 & 2.
So for MuSHR this means that the simulator has a main loop responsible for updating the sim with new information, and the controller that steers the car has a separate main loop that takes information from the simulator (e.g. sensors) and computes controls. There are more components to MuSHR each running a separate loop, but the idea for why we do this is that these tasks need to run at different rates and potentially on different computers. For example, we can run the sim on a desktop computer at a high rate to make sure the visualization is really clear. Our controller then could be run on the jetson nano computer to test the speed of our controller and will likely run at a slightly different rate. We don't want the controller being slow to slow down the sim from rendering otherwise this causes some painful visualizations so separate loops prevents this.