Sunday, March 31, 2013

How to know more about a phone from it's name

My Pagan beliefs about phone nomenclature:
Whenever I see an HTC phone, I believe I am looking at an HTC one. And more often than not, my belief turns out to be true. After enough ones, I thought I should visit their site and see what all names have they given to their phones. And What do I see, hordes of phones all called one. I mean, how can you have more than one one? And then there is desire. There are enough desires with HTC that I can safely believe in phone polygamy.



Onto Micromax: Choosing a micromax phone is like deciding how many naya paisas we want to shell out. I mean A116 > A 87 and so on. I believe they have a simple strategy if you want to buy a phone. Arrange all their phone models and sort them. (remember, it takes n*logn only). Then do a binary search using our maximum budget versus price of the selected median.

Next comes YOLO: or was it XOLO. I guess the two strings are too close for comfort. But if they still chose the name, I guess they might as well appeal to the YOLOs buy saying XOLO because... YOLO. XOLO goes with a prefix [A, B, Q, X]. My understanding: A for android, B for android, Q for quad core android and X for intel android. How do we choose a YOLO phone? Again put them all in a sorted fashion. Enter max price feasible and perform binary search independent of the prefixes. Why, you ask? YOLO.

But of course, our favourite Samsung needs to be in this delectable list too. Samsung: If you own a samsung phone and it dont have a galaxy substring in it, it dont have swag, dog. What suffixes do we have for our galaxy? Wait, why is it galaxy? Coz these phones work only in the milky way duhh. Sound fine. So galaxy ace, beam, chat, S followed by increasing numbers and prices + added advantage of chronological ordering(got lost, oops),  y, not(e) and wait for it: a minimal set of non-galaxy variety too: they are called wave. I guess you need to wave your hand and call out people when it doesnt pick up enough signal.

What about the android majors google? I guess most logical: start with the word nexus, add up 4, 7 or 10 according to approximate screen size.

I love Nokia's naming schemes: the windows ones are called lumia because they light up your life with their art and for people who lose their phones, niraasha ki zaroorat nahi as there always is aaasha, a phone you can buy with a student's stipend.

Apple doesnt sell phones older than 2 releases I guess: so you have iphone (insert latest number) and iphone (decrease last inserted number by one) . Simple and hassle free as that is what an iphone buyer is interested in, I believe.



Sony: it has GOT to be an Experia. and all blame on that mango juice ad that even when Katrina throws water on the phone, all I can imagine is why is a phone being shown in a mango juice drink advertisement?


Saturday, March 23, 2013

ROS tf issues

I set up a launch file following a simple map building tutorial through simulation and hooked it with a good map so that I can have interesting trials with navigation. Once I set up everything and moved the robot around, I had two main questions? Where is the map published?

I could find services using rosservice list and found a /dynamic_map which I subscribed to.

One more pre-requisite before the navigation test was the attempt to see if the transforms were available.
rosrun tf view_frames
 
would generate a pdf file in the folder giving all transforms. Any problem with naming or transforms would be clearly visible as a node not having any connections. In my case, the map was connected to odom but there was no connection between odom and base_link, preventing me from moving the robot.

Rather odom_combined was connected to base_link and renaming the out to odom_combined solved the problem.


Tuesday, March 12, 2013

My Experiments with sneezes

A weird disease hit me late December when I started working from home. Almost everyday after I went to sleep, I would get up with an extremely itchy throat and a series of unending sneezes after which I would be a victim of post-sneezatic stress and would await the return of my body to normalcy for about another hour after which I could finally rest in peace(for the day). This disturbing syndrome led to recurring visits to first an allopathy doctor who gave anti-allergy tablets, followed by sugar pills homoeopathy doctor. Stopping the anti-allergy pills would revive my sneezy syndrome and the homoeo medicines proved good only for my sweet tooth.

A two-month experiment with different foods only led to the conclusions that I could reduce my day time sneezes by reduction of citrus intake but it had no effect on my nocturnal syndrome. Lots of sleepless nights and infinite sneezes later, I finally stumbled onto something during my late night  sleepy stupor after the sneezes when I was randomly browsing when I had typed all permutations and combinations of the words 'allergy', 'sneeze', 'after sleep' for the past sixty days, I finally found an answer.

The liver. One of the few organs I never knew much about. The liver is one of the prime organs of the body and contributes to filtering about everything. My liver was acting against me and releasing histamines. It said the liver tries to cleanse itself around 1-3 AM and it was just a comment on some post(link, search for comment by Madhavi). I just hoped that this find would be true and that I could conclude my experiment. So, I went on a strict fast of only fruits( including citrus ones) to see if I would get my nocturnal sneezy stuff.

Lo and behold!! I stand cured. My experiments are as a curious and a concerned patient and have been rewarded but I advise that this be taken only as advise and should not be understood as equivalent to a certified medial practitioner's opinion.

And that is the story of how I have been doing well since the last three days, by limiting my diets to foods that can go easy so that I give time to my liver to detoxify.

Saturday, March 09, 2013

Finding the loop starter of a linked list with a loop


A very popular problem is finding whether a linked list has a loop. The solution basically uses two pointers, one at normal pace and one at 2x pace. Let us assume two people are running a race. The race starts from a starting point, say my home. Then, both runners reach a park and do some laps around the park. Slow guy - S and Fast Guy - F. Fast guy goes at twice the speed of slow guy, reaches the park and keeps doing laps when finally both slow and fast guy meet at some point. Let us try to model this mathematically. When the slow guy enters the park, assume he would have covered C nodes. The faster guy, F, would have done 2*C. Let us now add another variable k, which is the distance of F from the loop start. And another variable, the loop size, let us call it n. Now, let us imagine when both runners meet. By the time S covers half a loop(n/2), F covers n and has a headstart of k, so he would have covered n + k. By the time S covers a distance of n - k, F covers a distance of 2*( n - k). Given the headstart of F, he would be at 2*(n - k) +k = 2*n - k. Since n is a circular loop, this translates to position n - k. So, both S and F meet at n - k. Now, Let us send F back to the start and ask him to do this slowly while we keep S walking at normal pace. When F would have covered C (yeah! our first variable from the start to the mouth of the loop), S would have walked C too. Now, going back to some interesting stuff about C. When S covered C, F covered 2*C. that means from the mouth of the loop, it have moved C nodes. That means C = b*n + k. so, when F covers C he will be at the mouth of the loop, but when S covers C from our earlier meeting position, that is n - k, he would have covered: n - k + b*n +k = (b+1)*n, i.e. he too would be at the mouth of the loop. This took me some real time to understand, so I am adding pictures to help.

Here is the main resource that led me towards the solution and has put up wonderful illustrations to understand: http://umairsaeed.com/2011/06/23/finding-the-start-of-a-loop-in-a-circular-linked-list/

Wednesday, March 06, 2013

Navigation in ROS

I would like to check the ability of the turtlebot to navigate from one point to another on a built map using SLAM. I believe these are the sub modules that need to be taken care of:

1. build a map using gmapping or some laser map.

2. Whenever the map is used on the robot, make sure to localize using amcl.

3. Get coordinate of target point on map with respect to map coordinates.  (My last post on ROS should do the job, although I am yet to verify it )

4. Give the coordinates in the form of simple navigation goals following the simple tutorial at ros.

Primitive but necessary work, and in fact, one of the building blocks that will be re-used almost for everything to be built, I guess.

Lie Detection

So, I was reviewing an episode from Lie to me and then went to Paul Eckman's site and looked up the resources on lie detection. I wanted to know if there were any softwares which would attempt to detect lies from facial microexpressions on the basis of extensive training using machine learning. The catch is first convincing yourself that you can get a 100% accuracy and then convincing the world with a proof that we can crack the liars. Seems quite the dream, but I would love to work towards it. From the perspective of a first time plan, I believe we can divide the job pretty easily.


Get datasets of all facial expressions.

train system on all expressions.

Run system on suspect while asking questions and see results of different micro-expressions made by the accused.

The challenge: Are the features of micro-expressions which are the basis for emotion detection reliably trackable?

Here are some relevant products I could find :
http://www.noldus.com/human-behavior-research/products/facereader
http://www.affectiva.com/affdex/#pane_overview
http://nviso.ch/technology.html


And here seems to be a relevant paper.

I will go through related materials and get some more content into this post in the weekend.

Tuesday, March 05, 2013

ROS


Currently, perhaps the most popular software for robotics, ROS(Robotics Operating System) has been one of the long pending to-do items. Finally, the time and the task
came together in the form of PR2. 


A brief visit to the Tata Elxsi campus in Bangalore gave me a very clear understanding of the task at hand and the related challenges. The first module was to help the robot move from one point to another. To get map coordinates on to the robot, I wrote a small code with some opencv to intercept clicks and with help from Karthik Desingh's code for conversions. I believe we are good to go. A map server is first switched on to provide a static map which has been developed by gmapping earlier. Then our program is run which uses the service provided by the map server to get map data onto a Mat data type of opencv. Then, I resize the mat as the image was larger than my screen resolution and then finally load it up onto the screen. A click on the screen causes a callback which calls a converter method which finally prints out what we want. Here are some screenshots:
Might require close observation , but the second screenshot is where I click and a grey point is visible where I clicked.

On the shell, I print the info I need about the robot's pose in the context of the built map:


Here is the link to my small ROS repo: git@github.com:gururajkosuru/ros.git



And some resources from the ROS home page which I feel are good to start off with :
http://www.ros.org/wiki/Events
https://www.youtube.com/user/WillowGaragevideo
http://www.ros.org/wiki/Courses
http://www.ros.org/wiki/Papers