ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

encryptedmaniac's profile - activity

2012-09-18 03:07:19 -0500 received badge  Famous Question (source)
2012-09-18 03:07:19 -0500 received badge  Notable Question (source)
2012-03-31 20:14:13 -0500 received badge  Popular Question (source)
2011-11-17 11:01:16 -0500 marked best answer Using a python node in parallel mode

ROS_PARALLEL_JOBS isn't the right variable; that's used for rosbuild parallelism. Nothing in ROS is going to keep your node from multithreading; nodes are their own OS-level processes. Something is going wrong with your node; I would investigate to make sure you can get data into your node fast enough.

2011-07-03 10:52:55 -0500 received badge  Student (source)
2011-07-03 08:26:25 -0500 asked a question Using a python node in parallel mode

Hi, we are using ROS to simulate planes and run collision avoidance algorithms.

I wrote my collision avoidance algorithm as a python node in ROS that imports parallel python and uses parallel threading to send jobs to the 4 cores of my cpus to speed up computation. When I run this python file independent of ros all 4 cores get used as I see in my system monitor. However when I launch this node from ROS, only one cpu gets used.

This baffles me because I use the following parallel python code,

import pp
job_server = pp.Server()
print "Starting pp with", job_server.get_ncpus(), "workers"

and I get 4 workers (the number of cores my computer has) in both cases. However when I am actually running it through ROS I can clearly tell only 1 core is being used through activity monitor.

Fixing this problem is very important to me because my algorithm is very computationally expensive and I think it freezes up Ros which makes the planes miss their waypoints and run into infinite loops or crash into each other. I would like to enable multi-threading in the ros environment to improve the situation. I went through the documentation online and I could not find any parameters for launching my python node in away that Ros allows it to use all 4 cpus. Or perhaps, I tried using export ROS_PARALLEL_JOBS=-l4 , in my bashrc before doing a rosmake but that was not helpful.

Ultimately, I hope to be able to devote ros to core 0, and my algorithm to cores 1,2,3 so that my planes do not get interruptions in their commands.

Any help or suggestions would be helpful. I am using ros 1.4.8

If you need any additional info from me please let me know.

Thanks,

Waseem