Siddhant Shrivastava
June 24, 2015
Filed under “GSoC”
Hi all! If you’ve been following my previous posts, you’d have known that the Telerobotics module has been simmering for a couple of weeks. I’m happy to announce that it is almost complete and would hopefully be integrated with Vito’s Bodytracking module.
The last week (week four and five) were the busiest weeks of GSoC for me.
Learning Experience
- I learnt A LOT about Python Software Development
- Different types of software architectures,
- The development process of Python by one of the members of the Italian Mars Society who has been the reason I’m able to write more Pythonic code - Ezio Melotti
- PyTango Development
- ipython and how helpful it can be for Tango applications
- Message queues - Both ROS and Tango utilize ZeroMQ - which makes integration of ROS and Tango much scalable
- SIFT in Python - I will be working with my mentor Fabio Nigi on this very soon
- Making my own stereo camera
Deliverables
- A ROS node which collects information from all interesting topics from the Husky robot. This can be found here
- A Tango Server which integrates with ROS to provide diagnostic information from the robot (Battery Status, Temperature Levels, Current Draw, Voltate, Error Conditions )
- A simulated version of the Tango server for the Planning and Scheduling application that Shridhar is working on. These can be accessed here
- Soft Real-time network streaming FFMPEG server and Blender Client for a single camera video stream. This can be found here
Under heavy Development
- Integration of Bodytracking with Telerobotics. The following message format has been decided upon by the mentors and students:
# Attribute definitions for various diagnostic messages
moves = attribute(label="Linear and angular displacement", dtype = (float,),
display_level = DispLevel.EXPERT,
access = AttrWriteType.READ,
unit = "(meters, radians)",
fget="getMoves", polling_period = POLLING,
max_dim_x = 2, max_dim_y = 1,
doc="An attribute for Linear and angular displacements")
Vito’s Bodytracker would publish events in the form of Tango events. The associated data would be a float tuple of dimensions 2,1 (2 columns, 1 row). Such a tuple, like (3.4, 1.2) would specify a relative linear and angular displacement of the astronaut. My Telerobotics module would subscribe to this Tango event and transform this data to a Twist message that the Husky can understand.
- Extension of Camera Streaming to a dual camera setup. I am extending the streaming capabilty for a stereo camera.
Mid-term evaluations start tomorrow! Eagerly looking forward to them. It has been an eventful and productive half summer of code. I hope the next half is even more exciting and challenging as the one that passed.
Ciao
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.
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 Vim and Sublime Text environments to support intelli-sense, code completion, block syntax completion, etc. I also added a dual monitor setup with the unused LCD television at my home to make for an efficient programming ambience.
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 -
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!