2014年9月14日 星期日

How about Holography + HUD (Head Up Display) ?

How about Holography + HUD (Head Up Display) ?

Now HUD is more and more popular! Not just for military but also applied to mobile car, such as HUDWAY (apps), Garmin HUD and etc. I think this kind of products are great and valuable. When I drive a car, I don't wanna look down to check my velocity、gasoline or something. It is annoying. So I will make some experiments for my HUD. This might combined with the holography, trying to make everything in 3D. The two videos below are just for finding a idea what to do and how to do. If you have any idea of my new project, if you would like, please let me know. And maybe we could collaborate for a totally new and amazing HUD :)







2014年9月3日 星期三

Cross Compiler for Raspberry Pi

Speaking to embedded system, you have to know about cross compiler, toolchain and CMake. Cross Compiler is a compiler which could create the executable code for a platform other than the one which the compiler is running. You don't want to compile your huge source code on the embedded system where maybe took lots of time. In order to set up the environment, toolchain consisting of a compiler and linker could transform the source code into a executable program, libraries to provide interfaces to the operating system and a debugger. In this case, CMake will help you figure out the environment of the platform via toolchain. Basically, you could compile your source code to executabl program which could execute on the Raspberry Pi by these three main tools. It will save your lots of time and more convenient for further processing. Let's see how it works.

Before the beginning of the process, make sure that you have install CMake, git, rsync 
(sudo apt-get install cmake git rsync)

Install Cross Compilation toolchain
At first, you have to download a pre-built cross compilation tool chain for a slightly different version of gcc and libc :




And install the toolchain by adding the environment variable. 
sudo nano ~/.bashrc  and add below line at the end of file.
export PATH=$PATH:/home/gtossk2/Desktop/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin










(After that, you enter "ar" characters and enter tab twice. You see something like arm-linux-gnueabihf-gcc which means successfully intallation.)


Make Raspberry Pi development files (header files, libraries) available on the host
mkdir mnt_rpi and cd mnt_rpi    Now tell rsync to copy the entirely of the /usr and /lib directories of the Raspberry Pi file system into the newly created folder on your computer.






After that, there is a important thing to be done. The files /usr/lib/arm-linux-gnueabihf/libc.so and /usr/lib/arm-linux-gnueabihf/libpthread.so are actually linker scripts refer to absolute paths, which are incorrect when cross compiling. Please remove the absolute path from linker script.

For example :
Becomes :





Make a cmake toolchain file for cross compilation
Now create a toolchain for cmake to set up the environment. Name it as Toolchain-RaspberryPi.cmake in path/rpi

For example :















Cross compile on Ubuntu
Now you can use Toolchain-RaspberryPi.cmake for cross-compiling.
For example :

Note : you have to set CMAKE_EXE_LINKER_FLAGS cause arm-linux-gnueabihf-ld could not recognize the sysroot. You have to set --sysroot=/home/gtossk2/Desktop/rpi/mnt_rpi for CMAKE_EXE_LINKER_FLAGS


Or you will get some linker errors :


Run on the Raspberry Pi
Using scp to transfer the executable file to Raspberry Pi and execute it on Raspberry Pi. See how it works. 






Reference:



2014年9月2日 星期二

Setting DHCP Server for Raspberry Pi

DHCP stands for Dynamic Host Configuration Protocol. That is an standardized networking protocol used on Internet Protocol (IP) networks for dynamically distributing network configuration parameters, such as IP address for interfaces and services. There are  two general purposes for

  • Automatically distributing IP address to users from local area network or ISP
  • A centralized management for all computers within local area network
In order to control my humanoid robot remotely, DHCP sounds a great idea. I could set up the DHCP server on raspberry pi and plugin RJ45 on both computers. It allows to remote command-line login via SSH (Secure Shell) and transfer a file via SCP (Secure Copy). It is very helpful for program and debug.
So let's see how to make it out !!

A popular DHCP server for Raspberry Pi is ISC's dhcpd. You can install the package in a normal way using apt-get (Before it, make sure to update the local package cache using apt-get update)


The DHCP server requires a static IP address and by default, the Pi will have a DHCP one.  Edit /etc/network/interfaces


And modify the records that pertain to eth0 using the network parameters for your network


Edit /etc/dhcp/dhcpd.conf 
The configuration file to suit your requirements. All of the main configuration items are commented out and this is why the startup failed previously.




Edit /etc/default/isc-dhcp-server and uncomment the following records, inserts your network interface name as appreciate and changing the file path if you have chosen to put the file somewhere.


Finally, restart the DHCP daemon process using service command (Make sure to plugin the RJ45 before restart DHCP daemon)



Reference :


2014年8月28日 星期四

The Way To A Humanoid Robot (2)

Yesterday I had finished the heart of the humanoid robot. So now I am about to assemble the robot with my dirty hand...I really enjoy it :)
Due to the bad design that I didn't consider the assembling process, it is very hard to tight the screw. Poor me. I will think about everything twice before sending the blue print to the factory next time. I am just too careless :P There is one thing important before assembling the robot. That is you need to calibrate every servo to be center. It is very important, or you will get.....a poorly discipline robot. Be careful !!!
Let's see today's result !! Pretty cool !! I love it !!
Yup I don't have too much time to finish its head and arms. I will finish them next two day!!



2014年8月26日 星期二

The Way To A Humanoid Robot (1)

Well I got some free time while I finish my obligation….for army. Yup it is a totally new start for my life. I can start to think what should I suppose to do for next step. Before I make a decision, I will finish my previous job…. a humanoid robot. Yes, I got all aluminum frame of the humanoid robot. However there are many mistakes I made, such as difficult to assemble, no space for the wire and the dimension of the humanoid robot. Well…it’s my first to design it. That means there is still lots of room need to improve. It is a little off topic. Let’s back to the topic.


Today I will integrate Raspberry Pi, MPU-6050 and Atmel-based controller. The idea is that RBpi is in charge of the image processing, MPU-6050 for detecting the status of the robot including gyroscope and accelerator and Atmel-based controller for managing 20 servos. As you see in the picture, I made a tiny PCB board to put MPU-6050 connect to GPIO of the RBpi. I also made two 5v power suppliers and a TTL port for communicating with controller.


Now I put everything in the body frame of the robot in below picture. It looks not bad. And my robot finally won’t fall down…I hope :p So let’s test the MPU-6050 demo. Check out the youtube below. As you see, I make a mistake which is that the direction of the pitch is opposite. I will fix it next day.