# Blog

InMind VR

VRSE

GermBuster

## Build a Robot From A Power Wheelchair (1/2)

I have been working on a robotic project for a while. In this project, we build a robotic wheelchair controlled by head motions.

It starts from a commercial powered wheelchair (Titan Front Wheel Drive Power Chair).

We took over the control signals, added a number of sensors and wrote some computer vision softwares. It is a lot of fun. At this time point, we can drive it with head motions, a little slow but very easy to control. A short video is posted.

Robotic Wheelchair
[KGVID width=”640″ height=”360″]http://personal.stevens.edu/~hli18/video/robot.mp4[/KGVID]

The most challenging part so far, to our surprise, is how to take over the driving signals. In fact, once the powered wheelchair can be controlled with digital signals, it is somehow a robot.

We can find quite a few posts discussing how to hack the joysticks with Arduino. If you have a VR2 joystick, it would be much easier. This post (http://myrobotnstuff.blogspot.com.au/2012/07/circuit-for-wheelchair-robot.html) explains the process well. Basically, you can reproduce the digital signals triggered by the joystick with the Arduino.

But unfortunately, the joystick with the Titan power chair is with a different design and it is much more difficult to hack.
It is Dynamic Shark controller. If your remote (joystick) looks like this one , you probably have this kind of joystick.

The difficulty in reproducing the control signals generated by this kind of joystick is that it directly outputs 25V differential signals from the remote to the power module, which is a big black box under the seat. The signals are encoded and there is probably no way to get the encoding protocol.

We did quite a few rounds of trial and error and finally figured out a plan after burning out a joystick…

This kind of joystick works in a special way. At the end of the handle of joystick, there is with a small coil. 4 small coils are on the board under it. Because of the electromagnetic induction, the coil on the handle of the joystick produces different signals at different positions in the 4 small coils under it.

Roughly speaking, the (analog) signals produced by the 4 small coils are then processed by an on-board micro-controller to produce the driving signal. Because the signals produced by the micro-controller are encoded in an unknown protocol, we choose to get in by reproducing the outputs from the 4 small coils.

If you take away all 4 small coils (DO NOT do that…), the board looks like this

After some processing circuits, finally the outputs of the 4 coils can be found as two signals passed the two resistances in the red circuits. If you use an oscilloscope to check the signals, you will find that they are sine waves!

With this observation, the plan is clear. Soldering two wires at the right end of these two resistances (be careful!), we need to use an Arduino to reproduce these two sine waves to drive the wheelchair.

One of the two sine waves is for the X-direction and the other one is controlling the driving in the Y-direction.
The phase the sine wave indicates the sign (forward in X-direction or backward in X-direction) and the amplitude indicates the speed. The two sine waves should be sort-of aligned, which means the phase difference should be either 0 or 180.

With an Arduino, we will produce these sine waves signals to the two wires.

## [Note] Saliency Detection: A Boolean Map Approach

Saliency应该是翻译为显著性。个人理解显著性检测是得到一张图片上每一个像素点的显著程度的过程。对于这个显著程度，直观的理解就是它在这张图上的重要程度。比如，这些照片里

## [Note] Learning to See by Moving

Reference:

Pulkit Agrawal, Joao Carreira, Jitendra Malik, Learning to See by Moving

## [Note] Discovering Hidden Factors of Variation in Deep Networks

$\hat{\theta}, \hat{\phi} = \arg \underset{\theta,\phi} \min \sum_{\{x,y\}\in \cal{D}} \alpha U(x,\hat{x}) + \beta S(y,\hat{y}) + \gamma C(\hat{y},z)$

## Convert the saved checkpoint of cuda-convenet to the proto of Caffe

*Credits of the scripts go to jamt9000 on github, thanks for the helpful work!

You are a deep learning consumer, you have a saved check point you trained with the cuda-convenet. You want to use Caffe to evaluate the trained neural networks on new data possiblely due to the absent of GPU. Hence you need to convert the saved checkpoint to the format compatible to Caffe.

1. check out this version of caffe: jamt9000/caffe:convert-cuda-convnet or my copy.

$git clone https://github.com/jamt9000/caffe/tree/convert-cuda-convnet convert-cuda-convnet  2. compile it following the Caffe installation instruction ## Misc. Setup$make all
$make pycaffe  3. convert the check-point with the following codesnippet import sys sys.path.append('./python/') sys.path.append('./tools/extra/') from convert_net import * if (len(sys.argv) < 2): print "Usage:- path-to-saved-convnet" sys.exit(-1) arg_convnet = sys.argv[1] output_prototxt = arg_convnet + "-prototxt" output_proto = arg_convnet + "-proto" netpt = cudaconv_to_prototxt(arg_convnet) fh=open(output_prototxt, 'w') fh.write(netpt) fh.close() print "Wrote {0}".format(output_prototxt) netpb = cudaconv_to_proto(arg_convnet) fh=open(output_proto, 'wb') fh.write(netpb.SerializeToString()) fh.close() print "Wrote {0}".format(output_proto)  $python convert-convnet2caffe.py saved-convnet-checkpoint


4. Now you should find two files: saved-convnet-checkpoint-proto and saved-convnet-checkpoint-prototxt, they are in an older format, you need some tools provided by Caffe to upgrade them.

5. checkout and compile the up-to-date (or any more recent stable) version of Caffe

6. Under build/tools/ you will find tools named upgrade_net_proto_text.bin and upgrade_net_proto_binary.bin, use them to upgrade the saved-convnet-checkpoint-proto and saved-convnet-checkpoint-prototxt accordingly.

7. Almost done, you may need to manually fix the prototext file a little bit for example, add the input layer following any example proto text files provided by the Caffe.

Good luck!

## [CV]人脸识别检测数据集

1. Labeled Faces in the Wild:

3. FDDB:
FDDB也是UMass的数据集，被用来做人脸检测(Face Detection)。这个数据集比较大，比较有挑战性。而且作者提供了程序用来评估检测结果，所以在这个数据上面比较算法也相对公平。FDDB的一个问题是它的标注是椭圆而不是一般用的长方形，这一点可以会导致检测结果评估不准确。不过因为标准统一，问题倒也不大。[广告^_^] 我们ICCV2013的文章在这个数据上面有不错的结果。

4. The Gallagher Collection Person Dataset:

5. The Annotated Faces in the Wild (AFW) testset:

6. CMU Dataset:

7. POS Labeled Faces in the Wild: