The CPU skyrockets when i launch a node.
Hello wise people of the Ros Answers realm,
I have a node that performs a random walk.In order to get the information i need(pose,laser readings etc) and keep my code somewhat clean, i created 2 classes which, i instanciate passing as an argument the namespace of the robot(robot_1,robot_2 etc). In the init function of the first class i start an odom subscriber and a cmd_vel publisher while in the other class i just subscribe to the /namespace/laser_scan topic.
I launch the said node for 4-5 robots in the stage simulator and everything seem to work fine.The node is runing correctly but the cpu usage skyrockets at 100% on all cores.This happens only when i launch this node for multiple robots. Why is this happening?Im sure that i am missing something but i cant figure out what it is. Thanks in advance.
The links to the node and classes.
Hi Nick_JR would you be able to give more details on your hardware setup otherwise it’s hard to say. There are many factors your memory, if you have a GPU and your simulation is using it. Each robot is like opening a new session of the simulator -not quite but the simulator has to run all processes for each robot simultaneously