When two Distributed Systems meet!
Siddhant Shrivastava
June 18, 2015
Filed under “GSoC”
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.
Telerobotics Code Pushed
As I mentioned in my first post, the contributors of the Italian Mars Society are given write access 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 -
hg pull
hg update
hg add .
hg commit -m "My awesome Commit Message"
hg push
This simple algorithm ensures that all students can work at their pace without breaking the system. This simple tutorial can help the uninitiated to understand what I just said.
So while working with Tango servers for my project, I had to constantly use the bundled GUI - Jive which works as a one-stop solution for Device Servers. But my primordial hacker instincts prompted me to write a CLI solution to add and remove device servers using the amazing PyTango API. 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 here. 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 EAFP idiom. The current stage of argument validation is more like LBYL (Look Before You Leap) which is slow for the script’s use-case.
The second module I pushed is the Husky Test script to ensure if the Husky installation works or not on a particular setup. The test script which allows a Husky to move with a particular linear and angular velocity. The Software Architecture Document 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 an earlier post.
Docker
I explained the Docker setup and distribution in a quick mini-post. 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 here.
Python Reading
I have been voraciously consulting the following sources for getting the knack of Python and PyTango programming -
- Python Docs for Python 2 and Python 3
- Python Cookbook by O’Reilly Publishers
- Fluent Python (early access) again by O’Reilly Publishers
- PyTango documentation
The happiest point of all this reading kicked in when I could help Vito to reduce fifty lines of code to just two with the use of the exec
construct in Python. In case you’re wondering, this is the code written by Vito -
joints = [
'skeleton_head',
'skeleton_neck',
'skeleton_left_shoulder',
'skeleton_right_shoulder',
'skeleton_left_elbow',
'skeleton_right_elbow',
'skeleton_left_hand',
'skeleton_right_hand',
'skeleton_torso',
'skeleton_left_hip',
'skeleton_right_hip',
'skeleton_left_knee',
'skeleton_right_knee',
'skeleton_left_foot',
'skeleton_right_foot'
]
attr_init_params = dict(
dtype=('float32',),
unit='m',
max_dim_x=3,
polling_period=POLLING
)
for joint in joints:
exec "%s = attribute(**attr_init_params)" % joint
Note that without the exec
usage, each line would’ve to be manually written for each of the joint that we see in the joints
list.
Ongoing Stuff
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 -
- ROS-feedback Aggregator Device Server for Tango
- ROS Commander Node for the Husky
- Tango Client to understand Husky status (battery levels, sensor monitor, etc.)
- Mathematical Transformations and Named Tuples for different structures that Telerobotics requires.
GSoC with PSF and Italian Mars Society is turning out to be fun-and-challenging. Mid-term 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 Ongoing Stuff.
Until then, Ciao!