|
1 | 1 | <?xml version="1.0" encoding="utf-8"?>
|
2 |
| -<feed xmlns="http://www.w3.org/2005/Atom"><title>All Day I Dream About Science</title><link href="http://siddhantsci.org/" rel="alternate"></link><link href="/atom.xml" rel="self"></link><id>http://siddhantsci.org/</id><updated>2015-06-12T19:53:52+00:00</updated><entry><title>All for Docker; Docker for all!</title><link href="http://siddhantsci.org/blog/2015/06/12/all-for-docker-docker-for-all/" rel="alternate"></link><updated>2015-06-12T19:53:52+00:00</updated><author><name>Siddhant Shrivastava</name></author><id>tag:siddhantsci.org,2015-06-12:blog/2015/06/12/all-for-docker-docker-for-all/</id><summary type="html"><p>Hi! This is going to be a short post about my developments in the Week 3 of my GSoC project. Since my <a href="http://siddhantsci.org/blog/2015/06/08/tango-ing-with-ros-week-2/">last post</a>, I have had the chance to work with some exciting state-of-the-art technologies which allow easy distribution and scalability. These are -</p> |
| 2 | +<feed xmlns="http://www.w3.org/2005/Atom"><title>All Day I Dream About Science</title><link href="http://siddhantsci.org/" rel="alternate"></link><link href="/atom.xml" rel="self"></link><id>http://siddhantsci.org/</id><updated>2015-06-18T19:53:52+00:00</updated><entry><title>When two Distributed Systems meet!</title><link href="http://siddhantsci.org/blog/2015/06/18/when-two-distributed-systems-meet/" rel="alternate"></link><updated>2015-06-18T19:53:52+00:00</updated><author><name>Siddhant Shrivastava</name></author><id>tag:siddhantsci.org,2015-06-18:blog/2015/06/18/when-two-distributed-systems-meet/</id><summary type="html"><p>Hi! This post is meant to be an insight into the experience and progress of the third and fourth weeks of my (a)vocation with the Google Summer of Code Program. Things got much pacier and smooth in the past two weeks. I've been able to get a stable codebase up and running with respect to the aims discussed in the timeline.</p> |
| 3 | +<p><a href="http://siddhantsci.org/images/workspace2.png">Sublime Text Workspace</a>) |
| 4 | +<the usual rant> I had to totally restructure my programming workspace for the second time to support Intelligent IDE like features since the Python packages I am working with (ROS and Tango) have a fair number of modules whose documentation I need to read on the fly while coding away. Thus I set up both my <strong>Vim and Sublime Text</strong> environments to support <em>intelli-sense</em>, <em>code completion</em>, <em>block syntax completion</em>, etc. I also added a dual monitor setup with the unused LCD television at my home to make for an efficient programming ambience. |
| 5 | +<usual rant></p> |
| 6 | +<h2>Telerobotics Code Pushed</h2> |
| 7 | +<p>As I mentioned in my <a href="http://siddhantsci.org/blog/2015/04/29/gsoc-2015-with-the-italian-mars-society/">first post</a>, the contributors of the <strong>Italian Mars Society</strong> are given <em>write access</em> to the online Bitbucket repository. This is a tremendous responsibility to ensure that the updates don't disturb the stability of the project. To work with this, I follow the simple and effective advice of my mentors -</p> |
| 8 | +<div class="highlight"><pre><span class="n">hg</span> <span class="n">pull</span> |
| 9 | +<span class="n">hg</span> <span class="n">update</span> |
| 10 | +<span class="n">hg</span> <span class="n">add</span> <span class="p">.</span> |
| 11 | +<span class="n">hg</span> <span class="n">commit</span> <span class="o">-</span><span class="n">m</span> <span class="s">&quot;My awesome Commit Message&quot;</span> |
| 12 | +<span class="n">hg</span> <span class="n">push</span> |
| 13 | +</pre></div> |
| 14 | + |
| 15 | + |
| 16 | +<p>This simple algorithm ensures that all students can work at their pace without breaking the system. <a href="http://hginit.com/">This simple tutorial</a> can help the uninitiated to understand what I just said.</p> |
| 17 | +<p>So while working with Tango servers for my project, I had to constantly use the bundled GUI - <strong>Jive</strong> which works as a one-stop solution for <a href="http://www.esrf.eu/computing/cs/tango/tango_doc/kernel_doc/pytango/latest/quicktour.html">Device Servers</a>. But my primordial hacker instincts prompted me to write a <a href="https://en.wikipedia.org/wiki/Command-line_interface">CLI</a> solution to add and remove device servers using the amazing <a href="http://www.esrf.eu/computing/cs/tango/tango_doc/kernel_doc/pytango/latest/#">PyTango API</a>. Thanks to Ezio's excellent comments on my commits, I've been able to contribute a Pythonic solution for working with Device Servers in a jiffy. The script can be found <a href="https://bitbucket.org/italianmarssociety/eras/src/2da8222593354228a1eb426bef556654e794365c/servers/telerobotics/utility/setup-device.py?at=default">here</a>. It has a nice UI to help the user figure out what he/she needs to enter. I have yet to correct some formatting errors to make it more consistent with PEP8 and the <a href="http://docs.python.org//glossary.html#term-eafp">EAFP</a> idiom. The current stage of argument validation is more like LBYL (Look Before You Leap) which is slow for the script's use-case.</p> |
| 18 | +<p><strong>The second module</strong> I pushed is the <strong>Husky Test</strong> script to ensure if the Husky installation works or not on a particular setup. The <a href="https://bitbucket.org/italianmarssociety/eras/src/2da8222593354228a1eb426bef556654e794365c/servers/telerobotics/utility/test_husky.py?at=default">test script</a> which allows a Husky to move with a particular linear and angular velocity. The <a href="https://bitbucket.org/italianmarssociety/eras/src/2da8222593354228a1eb426bef556654e794365c/servers/telerobotics/doc/sad.rst?at=default">Software Architecture Document</a> was also updated to account for the new changes in the ROS-Tango interface architecture. A better understanding of the SAD can be had in <a href="http://siddhantsci.org/blog/2015/05/29/software-architecture-document-for-telerobotics/">an earlier post</a>.</p> |
| 19 | +<h2>Docker</h2> |
| 20 | +<p>I explained the Docker setup and distribution in a <a href="http://siddhantsci.org/blog/2015/06/12/all-for-docker-docker-for-all/">quick mini-post</a>. I tested that the X-errors don't impede with the scripts that I have been developing since ROS topics can be accessed from the command line as well. This is a good thing. The Docker repository for my workspace can be found <a href="https://registry.hub.docker.com/u/sidcode/ros-eras/">here</a>.</p> |
| 21 | +<h2>Python Reading</h2> |
| 22 | +<p>I have been voraciously consulting the following sources for getting the knack of Python and PyTango programming -</p> |
| 23 | +<ul> |
| 24 | +<li>Python Docs for <a href="http://docs.python.org/2/">Python 2</a> and <a href="http://docs.python.org/3/">Python 3</a></li> |
| 25 | +<li><a href="http://shop.oreilly.com/product/0636920027072.do">Python Cookbook</a> by O'Reilly Publishers</li> |
| 26 | +<li><a href="http://shop.oreilly.com/product/0636920032519.do">Fluent Python</a> (early access) again by O'Reilly Publishers</li> |
| 27 | +<li><a href="http://www.esrf.eu/computing/cs/tango/tango_doc/kernel_doc/pytango/latest/index.html">PyTango documentation</a></li> |
| 28 | +</ul> |
| 29 | +<p>The happiest point of all this reading kicked in when I could help Vito to reduce <strong>fifty lines of code to just two</strong> with the use of the <code>exec</code> construct in Python. In case you're wondering, this is the <a href="https://bitbucket.org/italianmarssociety/eras/commits/2da8222593354228a1eb426bef556654e794365c#Lservers/body_tracker/tracker/tracker.pyT40">code written by Vito</a> -</p> |
| 30 | +<div class="highlight"><pre> <span class="nt">joints</span> <span class="o">=</span> <span class="cp">[</span> |
| 31 | + <span class="s1">&#39;skeleton_head&#39;</span><span class="p">,</span> |
| 32 | + <span class="s1">&#39;skeleton_neck&#39;</span><span class="p">,</span> |
| 33 | + <span class="s1">&#39;skeleton_left_shoulder&#39;</span><span class="p">,</span> |
| 34 | + <span class="s1">&#39;skeleton_right_shoulder&#39;</span><span class="p">,</span> |
| 35 | + <span class="s1">&#39;skeleton_left_elbow&#39;</span><span class="p">,</span> |
| 36 | + <span class="s1">&#39;skeleton_right_elbow&#39;</span><span class="p">,</span> |
| 37 | + <span class="s1">&#39;skeleton_left_hand&#39;</span><span class="p">,</span> |
| 38 | + <span class="s1">&#39;skeleton_right_hand&#39;</span><span class="p">,</span> |
| 39 | + <span class="s1">&#39;skeleton_torso&#39;</span><span class="p">,</span> |
| 40 | + <span class="s1">&#39;skeleton_left_hip&#39;</span><span class="p">,</span> |
| 41 | + <span class="s1">&#39;skeleton_right_hip&#39;</span><span class="p">,</span> |
| 42 | + <span class="s1">&#39;skeleton_left_knee&#39;</span><span class="p">,</span> |
| 43 | + <span class="s1">&#39;skeleton_right_knee&#39;</span><span class="p">,</span> |
| 44 | + <span class="s1">&#39;skeleton_left_foot&#39;</span><span class="p">,</span> |
| 45 | + <span class="s1">&#39;skeleton_right_foot&#39;</span> |
| 46 | + <span class="cp">]</span> |
| 47 | + |
| 48 | + <span class="nt">attr_init_params</span> <span class="o">=</span> <span class="nt">dict</span><span class="o">(</span> |
| 49 | + <span class="nt">dtype</span><span class="o">=(</span><span class="s1">&#39;float32&#39;</span><span class="o">,),</span> |
| 50 | + <span class="nt">unit</span><span class="o">=</span><span class="s1">&#39;m&#39;</span><span class="o">,</span> |
| 51 | + <span class="nt">max_dim_x</span><span class="o">=</span><span class="nt">3</span><span class="o">,</span> |
| 52 | + <span class="nt">polling_period</span><span class="o">=</span><span class="nt">POLLING</span> |
| 53 | + <span class="o">)</span> |
| 54 | + |
| 55 | + <span class="nt">for</span> <span class="nt">joint</span> <span class="nt">in</span> <span class="nt">joints</span><span class="o">:</span> |
| 56 | + <span class="nt">exec</span> <span class="s2">&quot;%s = attribute(**attr_init_params)&quot;</span> <span class="o">%</span> <span class="nt">joint</span> |
| 57 | +</pre></div> |
| 58 | + |
| 59 | + |
| 60 | +<p>Note that without the <code>exec</code> usage, each line would've to be manually written for each of the joint that we see in the <code>joints</code> list.</p> |
| 61 | +<h2>Ongoing Stuff</h2> |
| 62 | +<p>There are certain deliverables in the pipeline currently waiting to be pushed to the online repository over the course of the next week. I have been working on -</p> |
| 63 | +<ul> |
| 64 | +<li>ROS-feedback Aggregator Device Server for Tango</li> |
| 65 | +<li>ROS Commander Node for the Husky</li> |
| 66 | +<li>Tango Client to understand Husky status (battery levels, sensor monitor, etc.)</li> |
| 67 | +<li>Mathematical Transformations and Named Tuples for different structures that Telerobotics requires.</li> |
| 68 | +</ul> |
| 69 | +<p>GSoC with PSF and Italian Mars Society is turning out to be fun-and-challenging. Midterm Evaluations start in a week. Lots of work to do. I strongly hope my next post will be a celebratory one highlighting the pushed code I described in <em>Ongoing Stuff</em>.</p> |
| 70 | +<p>Until then, Ciao!</p></summary><category term="GSoC"></category><category term="Python"></category><category term="PSF"></category><category term="computers"></category><category term="science"></category><category term="exploration"></category><category term="space"></category><category term="mars"></category><category term="IMS"></category><category term="Italian Mars Society"></category></entry><entry><title>All for Docker; Docker for all!</title><link href="http://siddhantsci.org/blog/2015/06/12/all-for-docker-docker-for-all/" rel="alternate"></link><updated>2015-06-12T19:53:52+00:00</updated><author><name>Siddhant Shrivastava</name></author><id>tag:siddhantsci.org,2015-06-12:blog/2015/06/12/all-for-docker-docker-for-all/</id><summary type="html"><p>Hi! This is going to be a short post about my developments in the Week 3 of my GSoC project. Since my <a href="http://siddhantsci.org/blog/2015/06/08/tango-ing-with-ros-week-2/">last post</a>, I have had the chance to work with some exciting state-of-the-art technologies which allow easy distribution and scalability. These are -</p> |
3 | 71 | <ol>
|
4 | 72 | <li>Docker
|
5 | 73 | <img alt="Docker Logo" src="http://siddhantsci.org/images/docker-logo.png" /></li>
|
|
0 commit comments