Hi Ben,<div><br></div><div>I have not tried implement a master node like this, but I can help with #5.</div><div><br></div><div><meta charset="utf-8"><p style="margin-left: 21pt; "><span style="font-size: 12pt; "><span>5.<span style="font: normal normal normal 7pt/normal 'Times New Roman'; ">      </span></span></span><span style="font-size: 12pt; ">What would I need to do to load a package into my manifest at runtime?  Do the dependencies in a manifest simply get turned into paths in the PYTHONPATH?</span></p>
</div><div><br></div><div>If you look at roslib.load_manifest, it finds all the pkg directories in your manifest and adds it to your sys.path.   You can simply do that yourself using the standard roslib functions to find the path and then append it to the sys.path list.  </div>
<div><br></div><div>In the past, I have simply used roslib.load_manifest for any additional pkgs that I want to use.  It increases the size of the sys.path, but there does not seem to be any problem for the small number of additional search paths.</div>
<div><br></div><div>To then publish or subscribe to the messages in that pkg, use something like :</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>
module = __import__( module_name +'.msg')</div><div><div>msg_module = getattr(module, 'msg')</div></div><div><div>msg = getattr(msg_module, msg_name)</div></div></blockquote><div><br></div><div><br></div><div>
Regards,</div><div>Adam</div><div><br><div class="gmail_quote">On Wed, Nov 17, 2010 at 5:04 PM, Axelrod, Benjamin <span dir="ltr"><<a href="mailto:baxelrod@irobot.com">baxelrod@irobot.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">









<div lang="EN-US" link="blue" vlink="purple">

<div>

<p class="MsoNormal"><span style="font-size:12.0pt">I have a large system with
many nodes for specific purposes.  At any given time, many nodes do not
need to be running.  I would like to be able to start a node from my
master rospy code when it determines it needs that node up.  I think
actually launching the node is as easy as an os.system call.  However, I would
like to interface with the newly started node, and would like it if I did not
have to list every package in the master’s manifest.  Basically, I
would like to take a string names for a package / node / etc., then at runtime
load it into my manifest, then be able to set up a publisher and subscriber to
it.</span></p>

<p class="MsoNormal"><span style="font-size:12.0pt"> </span></p>

<p class="MsoNormal"><span style="font-size:12.0pt">Here are some questions.</span></p>

<p style="margin-left:21.0pt"><span style="font-size:12.0pt"><span>1.<span style="font:7.0pt "Times New Roman"">     
</span></span></span><span style="font-size:12.0pt">Has anyone done
this type of thing before?</span></p>

<p style="margin-left:21.0pt"><span style="font-size:12.0pt"><span>2.<span style="font:7.0pt "Times New Roman"">     
</span></span></span><span style="font-size:12.0pt">Do you have any
input on best practices?</span></p>

<p style="margin-left:21.0pt"><span style="font-size:12.0pt"><span>3.<span style="font:7.0pt "Times New Roman"">     
</span></span></span><span style="font-size:12.0pt">It seems like
part of the answer is some sort of standard interface (or a standard interface
to determine what the actual interface to that node is).  Any ideas on
this?</span></p>

<p style="margin-left:21.0pt"><span style="font-size:12.0pt"><span>4.<span style="font:7.0pt "Times New Roman"">     
</span></span></span><span style="font-size:12.0pt">Is there anything
more elegant that a bunch of eval() statements (to turn string names into
message types)?</span></p>

<p style="margin-left:21.0pt"><span style="font-size:12.0pt"><span>5.<span style="font:7.0pt "Times New Roman"">     
</span></span></span><span style="font-size:12.0pt">What would I need
to do to load a package into my manifest at runtime?  Do the dependencies
in a manifest simply get turned into paths in the PYTHONPATH?</span></p>

<p class="MsoNormal"><span style="font-size:12.0pt"> </span></p>

<p class="MsoNormal"><span style="font-size:12.0pt">Thanks,</span></p>

<p class="MsoNormal"><span style="font-size:12.0pt">-Ben</span></p>

<p class="MsoNormal"><span style="font-size:12.0pt"> </span></p>

<p class="MsoNormal"><span style="font-size:12.0pt">Ben Axelrod</span><span style="font-size:12.0pt"></span></p>

<p class="MsoNormal"><span style="font-size:12.0pt">Research Scientist</span><span style="font-size:12.0pt"></span></p>

<p class="MsoNormal"><span style="font-size:12.0pt">iRobot Corporation</span><span style="font-size:12.0pt"></span></p>

<p class="MsoNormal"><span style="font-size:12.0pt">8 Crosby Drive, Mail Stop 8-1</span><span style="font-size:12.0pt"></span></p>

<p class="MsoNormal"><span style="font-size:12.0pt">Bedford, MA 01730</span><span style="font-size:12.0pt"></span></p>

<p class="MsoNormal"><span style="font-size:12.0pt">(781) 430-3315 (Tel)</span></p>

<p class="MsoNormal"><span style="font-size:12.0pt">(781) 960-2628 (Fax)</span><span style="font-size:12.0pt"></span></p>

<p class="MsoNormal"><span style="font-size:12.0pt"><a href="mailto:ofitch@irobot.com" target="_blank"><span style="color:windowtext">baxelrod@irobot.com</span></a></span><span style="font-size:12.0pt"></span></p>

<p class="MsoNormal"> </p>

</div>

</div>


<br>_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
<br></blockquote></div><br></div>