Dec 19, 2020

අතීතය...

අතීත මතකන්  හොදයි කියල එවගේ ජීවත් වෙන්න තරම් ලෝභ හිතෙන්නෙ කලාතුරකින්..

එක්කො වැටෙන්නම බොන්න ඕනි.

නැති නම් ජීවිතේ එපා වෙන තරම ප්‍රශ්ණ තියෙන්න ඕනි.

ඔය හේතු දෙකම නැතිව අතීතයෙ ගිහින් ජීවත් වෙන්න කාලය ඕනි තරම් මේ 2020 අවුරුද්දෙ ලැබුන. 

අපි ගැම්මට ඉදපු කාලේ,

තනියෙන් මොනව බැරි උනත් එකතු වෙලා ඕනිම දෙයක් කරපු කාලේ, 

කටට ආපු ඕනි දෙයක් වැඩිය හිතන්නෙ නැතුව කියල දාන්න පුලුවන් කාලේ, 

ඒ නිදහස, ඒ හිනහව,

එකා අනිකා ගැන හිතපු කාලෙ !! 

කාලය මොන තරම් වෙනස් වෙලාද කියනව නම්, උන් දන්නව නම් මේ අතීත කාමය ගැන අහවි "උඹට වෙන වැඩ නැද්ද?" කියල.

ජීවිතේ දැනට දුක සැප ගෙවාගෙන කෝටත් ඉන්න උන් දන්නව නම් මේ ගැන අහවි "තමුසෙට පිස්සුද?" කියල.

ඒ කාලෙ දන්නව නම් ආයි කවදාවත් එහෙම කාලයක් එන්නෙ නෑ කියල, වෙන්වෙන්න කලින් තවත් මොහොතක් ගත කරනව.. 

ආදරෙයි ඒ මිනිස්සුන්ට සහ පරිසරයට. 

හරිම ලෝභයි ඒ මතකයන් වලට. 

කොච්චර ආදරෙයිද කියනව නම්, මම පතන්නේම උඹලා ආයි මට මේ ජීවිතේ නම් මුන ගැහෙන්න එපා කියල. 

ඕනි නෑ ඒ සුන්දර මතක උඹල නිසාම අවලංගු කර ගන්න.

උඹලා ඒ කාලේ විදිහටම අව්‍යාජව මතකයන් වලම ඒ විදිහට හිටපුවාවෙ, 

මම පුලුවන් වෙලාවක ගිහින් බලල එන්නම්.

වෙනස් වීම් හැර මේ ලෝකේ වෙන කිසිම දෙයක් වෙනස් නොවන නිසාම..!!



Aug 2, 2018

File IO Performance

[Drafted Note]

Original question was to keep one file pointer globally(1) or open/close in each call,(2)

  • Seems (1) is better: https://stackoverflow.com/questions/30255953/open-and-close-of-same-file-multiple-times-vs-opening-file-for-long-time
  • Good conversation for (1) but out of the topic https://bytes.com/topic/c-sharp/answers/575619-close-open-file-again-keep-open-log-file
  • Don't open them until you want to write to or read from them. They do NOT need to be open all the time, and in fact, this is a dangerous design flaw. https://www.codeproject.com/Questions/304287/How-do-I-keep-open-multiple-StreamWriter-handles
Additional topics:

  • http://www.cplusplus.com/forum/beginner/74630/ (yourFile.flush();?)
  • Log4net
  • http://www.acodersjourney.com/2017/08/top-20-cplusplus-multithreading-mistakes/
  • https://www.thegeekstuff.com/2015/01/c-cpp-code-optimization/

Apr 12, 2016

ඉර හඳ යට




තුති ගීතිකාවක බැතිය මවන පවනේ කිතියෙන්
මේ නෙත් උළෙලට එන්න...
ඇතුල් හිතේ තියෙන රෝස කැකුළු වර්ෂා අස්සෙන් එන්න.. එන්න..
අහසේ පැල් බැඳ සදා බලා හිඳිනා,,

මේ ඉර හඳ යටදීම, ආදරේ විඳින්න
ජීවිතේ විඳින්න//  ♪ ♪ ♪ 

ආවේ කොහෙන්ද ඉන්නේ කොතැනද
මෙහි කවුරුවත් නෑ අහන්න,
නොසිතූ මොහොතක මියයන්නට පෙර, මේ හමු වීමම කොයි තරම්ම උතුම්ද
තෙත් සමනල් පෙලපාළේ එන්න..

මේ ඉර හඳ යටදීම, ආදරේ කරන්න
ජීවිතේ දකින්න//  ♪ ♪ ♪

ආවේ තනියම, යන්නේ තනියම
එනමුදු තනි කවුරුන්ද..
සුසුමට වැඩියෙන් සමීප වන්නට, මේ ලංවීමේ වෙන් වීමක් කොහින්ද..
මේ මානව සුවඳේ පිනෙන්ම,,,

මේ ඉර හඳ යටදීම, ආදරේ කියන්න 
ජීවිතේ හොයන්න// ♪ ♪ ♪
♪ ♪ ♪♪ ♪ ♪♪ ♪ ♪♪ ♪ ♪♪ ♪ ♪♪ ♪ ♪

- This song is dedicated to all people in SL Army and to my loving Chuti

Jan 20, 2016

Stepping into 3D social networking


Hi Bloggers,

Today I experience you a special peace of 3D world which is innovated over the digital universe for years. Technically we called it as virtual worlds. 3D reproduction of real world has been engaged a lots of research studies in past years but it is commercial and end user stage now. More specialized versions of 3D worlds are famous as same as the well-known social media platforms such as Facebook, Twitter. Those social platforms are limited see news updates, voice or textual commutation, etc.  Same features are available in virtual worlds but it also allows user to become immersed in a 3D simulated world. That is the major motivation behind3D virtual worlds.
Virtual Seminar in Second Life

There are large growth of 3D virtual worlds for social networking suchas Active World, OsGrid and Second Life.Second Life is the massively growing online virtual among others. It is used as a platform forday today needs of human being. 

SL interactive environment

When comparing active user statics of second life, it has over 1 million where Facebook has over 1.8 billion users. One of biggest barrier for having such gap is that users still need more resources and specific software installation to experience virtual social networking. Usually users need a good Graphic card in computer to simulate graphics. And users are required to install 3rd party viewers like, Second Life client or Hippo OpenSim viewer. 3D scene has much data overhead than viewing a webpage so that good internet connectivity is also required. Second Life is propriety platform so that many features are on demand for payments. 

You will have your 3D representation which is called ‘Avatar’ in the simulation. Due to this fascinating interactive environment users can do their imaginary thinking. It is also created a business platform over 3D interactive virtual worlds.  

Users can dress up avatars, visiting world famous cities, do adventures, education, shopping, interacting with people from different cultures and make relationships. Therefore users are also called residence in virtual worlds. This is one of the reasons that organizations and business communities tend to recreate their business presence in Second Life.


Fantacy in SL

Usage of virtual worlds as developers

There are open source platforms for creating virtual worlds yourself and populated it online. OpenSim is the best free and open source server platform for hosting virtual worlds.If you are new to OpenSim it is better to understand the simulation process in standalone mode first. When you are using OpenSim as a simulation engine you will have a good community support with strong documentation. Meantime you can reuse huge number of virtual objects and regions which are already created by developers. Here are the steps of configure OpenSim in Windows.
                                     
First you have to solve certain dependencies which OpenSim requires. Latest .NET Framework 3.5 is required for windows.

·         Download the latest OpenSim simulator distribution.
·         Unzip the package and go to /bin.
·         In bin folder you will find OpenSim launcher.   (32-bit version of Windows: OpenSim.exe and 64-bit version of Windows: OpenSim.32BitLaunch.exe)
·         As you are running the OpenSim for first time you have to set up a region and a user account. Give the proper answerer in the command prompt. These settings are written in to /bin/Region/Reagons.ini file.
1.      New region name – This is the name for your region.
2.      Region UUID – Unique ID of your region. You can keep the default value.
3.      Region Location – This is the location of your region in the grid. You can safely leave these as the default (1000, 1000).
4.      Internal IP address / Port – IP address and Port to connect to your region.
5.      One here onwards you can leave other parameters as default. But if you are using OpenSim 0.7 or later you need to create an estate manager account. In standalone mode you will ask to create an state manage account.  Don’t forget the account of the master avatar (in 0.6.9) or the estate manager (in 0.7 and later). These user accounts allow you to configure the in-world settings for your region and you can use the account to perform your initial login test. In addition to that you can create a user with ‘create user’ command other than an estate manager.

There are many 3rd party viewers to connect with OpenSim and view your region. Install one of them on your pc and lunch the viewer program. Before connecting make sure the server ‘OpenSim.exe’ is up and running. Enter first name, last name and password of the user account.


Congratulations..!!! You just successfully log on to your own world. Now you can build up your own imaginations of your virtual arena. 

Sep 15, 2015

Sri Lanka’s Google Wi-Fi

Introduction

As a fastest growing of IT industry and IT education, Sri Lanka has considerable internet accessibility in day to day business needs and social requirements. Recently, people who tired with low quality internet accessibility due to distance and interruption has heard ever blessing headline from Google.

 “Sri Lanka is the first country in the world to have Internet access covering the whole country”- Mike Cassidy, Google Vice President and Project Leader on GoogleX Project Loon.

This is not the first time Sri Lanka is experience a new technology as the first South Asian country. It is also the first South Asian country, was imported first cellular phone in 1989, the first 3G facilitated country in 2004 and the first 4G facilitated country in 2013.

The Technology of Loon


Project Loon is a research and development project being developed by Google with the mission of providing Internet access to rural and remote areas. A network of balloons is travelling on the edge of space to provide internet access all over the country.





Loon Importance as Sri Lankans

People get internet facilitated by telecom operators and mobile operated companies. As the nature of geography and climate in Sri Lanka, they would not provide to the most remote areas in the country due to commercial non-feasibility. Mobile operators also have least consideration of uninterruptible service in outstations. They have much priority on high quality service on business centralized areas in capital Colombo, western province. Therefore, almost 6 million internet users and 2.8 millions of mobile users are facing internet access issues with low satisfaction. Loon will help fill in coverage gaps and bring people back online.

Current Status of Sri Lanka’s Google Loon

Sri Lanka’s government and Google signed an agreement to cover the Island with 3G internet under ‘Google Loon project’ on July 28, 2015. The project is handled by the Managing Director of the Information and Communication Technology Agency (ICTA), Muhunthan Canagey.

The agreement is not for testing but for live commercial deployment. Once Google is done with the successful rolling out of the 13 balloons are completed by March 2016.
Those are expected to provide connectivity across the entire country will trigger a drastic reduction in both data and voice call charges whilst Sri Lanka will benefit from a doubling of broadband speeds, where a minimum download speed of 10 Megabytes per second could be expected.

There are wake of some rumors that Sri Lanka will benefit from free wi-fi due to section of government representatives. However, the provision of wi-fi internet services through Google’s Project Loon is not going to be afforded to consumers ‘free of charge’.      

Jul 27, 2015

GIT basic commands


  • Get initial clone ->  git clone git@github.com/aporter/coursera-android.git
  • git push origin master
Git Merge
-------------
  • Do you changes in a different branch "my_dev"
  • After completing the work there commit all the changes on that branch "my_dev"
  • Checkout to master and get rebase. -> git checkout dev -> git pull --rebase dev.
  • Now rebase "my_dev" with dev -> git checkout my_dev-> git rebase  dev.
  • See for conflict
  • Checkout to master -> git checkout dev
  • Merge your branch -> git merge my_dev
  • See for conflicts, push otherwise. -> git push 

Jul 14, 2015

GIT problem again ..!..! [ git reflog and reset ]

Accidentally, I have lost my iRobot creation project changes, very important. I will show you the mistake happen and how to avoid same situations. Also best practices we can consider while working with GIT with large user contribution.

This is my old git repo.













  • What went wrong and the reason? 
I was working on my local 'dev' branch which is link with remote repo. I keep on commit my changes at a time so that I can understand RCA in case of an exception. As I have already committed my changes I checkout for 'origin/dev'. (It has happen for whatever the reason)

I noted all of my changes has been reverted. 'God, what went wrong? I totally lost.' The reason is that I have converge dev with origin/dev, which is lost my local changes even I have commited. 
  • After checkout origin/dev






  • Recovering commits with "git reflog" and reset
Thanks to "git reflog" tool, I able to recover my lost commits.















  • Retrieving a branch of an earlier state.
Now, see the history and the mistake I have done. "git reflog" gives you a good history about what has been done to head of your branches. In this case, head is reset to origin/dev at "8d29594". I need to rest head to the commit "09a3f2a" which is my last commit of the changes. 














Here we go !!!! I pointed head to the correct commit. Also note that I need checkout the branch since I am on the right branch "dev". If history shows different checkout branch, you need to checkout to the right branch first. 

Ok. Finally here my local settings look like after pushing.










Also, keep in mind an impotent thing. If you have heavily RnD oriented thing do it in different branch then merge it with "dev". This makes less complicated other to track the changes. In above example consecutive commits are recorded in remote repo after pushing which may hard to track others of your changes.  

May 16, 2015

Useful GIT commands

Install GIT on your PC.
First thing you need to do is customize git environment.

$ git config --global user.name "Dasun"
$ git config --global user.email hmdtharaka@gmail.com
Now it is the time for your first commit...
Create a file called main.cpp. On the same directory do basic commands using Git bash.
$ git status
$ git add main.cpp
$ git commit -m "First commit"
Now I modify main.cpp content and do a commit over same branch. Still this is master.
$ git status
$ git add main.cpp
$ git commit -m "changed in main.cpp"

Now we need to do certain changes in main.cpp but we are not sure about these changes. Hence I create different branch and do my testing there.
$ git branch dev
$ git checkout dev

Suppose, I do several commits on this branch. Now I am confident that my testing was fine. Hence I need to merge these changes with original and I did my change liner. This is what we called fast forwarding. 


Now we need to do certain changes in main.cpp but we are not sure about these changes. Hence I create differen

May 15, 2015

Lat's Play with OpenGL - 1

OpenGL Introduction

OpenGL is graphic library for cross platform 3D graphics. This is same as Direct3D in directx library. There are many tutorials and example videos to learn OpenGL. In this post I am trying to make a short note to cover up most import points, I have learnt. 

Glut 

Glut is tool for creating windows and handling inputs. Use FreeGlut pre build libs for your projects. 

Glew

This is openGL extension manager and lat us easily call openGL extensions without having declare DLL entry points.


May 10, 2015

Problem with Visual Studio Immediate Exit ?

Hello,

I have faced this problem many times. Specially in visual C++ programming.
Here, few things we can to avoid this issue.

  1. Simple, cool way is press CTRL + F5. This is also known Debug-> Start without debugging.
  2. Add  system("pause"); at the end of your code.
  3. This is also mentioned in many places over the web. Somehow I tested this on my Visual C++ console application and it wasn't work for me. I am leaving this to you for trying out...            
properties -> configuration proprieties -> linker -> system
select CONSOLE(/SUBSYSTEM:CONSOLE) in subsystem option.

Also I have seen added logically correct coding tips end of the code. But according to me those looks like unprofessional !

while(1) { }
cin.get();
for(;;) ;
std::getchar();



Jul 31, 2014

එය මෙසේ සිදු විය යුතුය



මහමෙරක් වන් නුබේ වෙනස,
සීමා මායිම් නොමැතිව,
දරා ගත නොහැකි තැන,

ඉතිරි වූ එකම විසදුම,
කියා ගත නොහැකි සෙනෙහසින් බැඳී වූ,
අපම හමු වී සිනා සුනු තැන්,
හැර යාම පමණි.



විටින් විට, හරි පරිස්සමට,
එහෙව් සෙනෙහස් සිතක් මරමින්,
නුඹ පන දුන් සැකය හා යහළු, කේන්ති සිත,

තව දුරටත් දළු නොලියන නමුදු,
එලෙසම පවතීවි.

නුඹ කෙරෙහි, නුබේ සිත නොරිදවීමෙහි,
මගේ සැලකීම කොතරම්ද නම්,
අදටත්, මේ මොහොතෙත්,
නුඹ බලයෙන් පන දුන් ඒ හිතට,
පෙර තිබූ සෙනෙහසින් බැඳි සිත,
යට කර පාගා දැමිය නොහැක.

මට නුඹ ගැන දුකය.
වෙලාවකට හැගීම් නුඹ හට විහිලුවක් බව දැනෙනා විට,
මට මම ගැනම දුකය.
එහෙත් නුඹ අසවලුන් සමග ගනු දෙනු කර,
මටත් නොකියාම, නුඹ තනිවම වේදනා සිතක අතරමං වන විට,
මට මම ගැනත්, නුඹ ගැනත් දුකය.

මේවා මම කළ වැරදිය,
නුඹ මගේ හිතට සමීප කර ගත්තා වැඩිය,
ඉවසුවා වැඩිය,
එතරම් රිදුනේ ඒ නිසාය,,,

මම නුඹව හැර යමි.
නුඹටත් මටත් අතීතයටවත් නැති කලක් හැර දමමින් යන්නට යමි.
ඒ නුඹ හට රිදුනාද කියා සොයා බැලීමට නොව,
තව දුරටත් හිත් මරා දමනු හා විදවන රිදුම් දැකීමට නොහැකි බැවිනි.

නුමුදු කතාව අහවර නැත,
නැවත නැවතත් ඉතිහාසය ලියවෙන බව මම දනිමි,
ඒ දවස අද හෝ හෙට නොවන බවද මම දනිමි,,,
කවදා හෝ අපි හමු වේවි.
දොඩමළු වේවි...
කිසිවක් නොවූ ගානට හිනා වේවි...
ඒ අතරම, නුඹටත් හොරෙන් නුඹේ හිතට දැනේවි,
දුටුවාට නුඹ හා සිනා සී මේ දොඩමළු වන්නේ,
නුබේ හිතට සමීප වූ සහෝදර සෙනෙහි හිත නොවන බවට...

එහෙත් මම කළ එකම වරද,
නුඹ විසින් මරා දැමූ ඒ සෙනෙහස් සිත,
නිසි ලෙස මිහිදන් කර සැනසවීම පමණි!

Jul 5, 2014

දෙවියන් මැරීම :: අසාධාරණ හා ආත්මාර්ථකාමී මිනිස් සිත

ඒ 2007, මම AL කරල නිදහසේ ගෙවන කාලය. කඩ්ඩ හදා ගන්න කියල තිබිරිගස්යායේ කඩු ක්ලාස් ගිය කාලය. මට ඒ ක්ලාස් එකේදී සෙට් උනා යාළුවෙක්, සිත්තරෙක්, ඒ වගේම ඌ කළාකරුවෙක්. වෙනස් අදහස් තියෙන සංවාදයට කැමති පුද්ගලයෙක්. හැමදාම ක්ලාස් ඉවර වෙලා පාර එහා පැත්තේ තියෙන කඩයට රිංගල සිගරට් එකක් උරන ගමන් මොකක් හරි දෙයක් ලොකුම ලොකු කරල, සාහිතය එක්ක කියවන එක තමයි මුගේ එකම සතුට. තිබුන යාළුකම වැඩි නිසාම උබේ සමාජවාදී හිතට ඕන උනේ හැම තිස්සෙම ගණිත තර්ක දාන මාව ටිකක් වෙනස් කරන්නෙ. :P
ඒත් උඹ කියපු කතා හිනාවක් දා ගෙන අහන් ඉන්නවට වඩා මට උඹ කියනවන තරමටම අහන් ඉදීමේ උවමනාවක් ඒ දවස් වල තිබුනේ නෑ, විහිළුවක් කරල 'එහෙම වෙන්නත් බෑ නේද මචං ?' කියල ඇහුවට. ;-)

මට තාමත් මතකයි, ඒදාත් මොකක්දෝ සිංහළ පොතක් දිග ඇරගෙන මට 'දෙවියන් මැරීම' ගැන වචනයෙන් වචනය කියල දුන්නු අපූරුව. උඹ මගේ අවධානය බිඳෙන කොට, ආයිත් පේළිය මුලින්ම පටන් අරන් කියල දුන්නා. කොච්චර කලක් ගියාද...උඹ එදා මොන ගැඹුරු තේරුමකින් මේ දෙය කියල දුන්නද කියන්න මම තාමත් දන්නේ නෑ. මේ දෙය උඹ එදා හුගාක් උවමනාවෙන් කියවපු හෙතුවත්, මෙහි මුල් රචකන් මේ වගේ නිමිත්තක් වචන කරන්න හේතුවත් මම දන්නේ නෑ. ඒ වගේම මේ දේවල් කතා කරපු තර්ක කරපු කාලයත් දැන් අපෙන් ඈත් වෙලා. ඒත් මට හිතෙනව මේ දේවල් නිකම්ම අහක දමිය යුතු දේවල නොවන බව. උඹ එදා ගත්තු උත්සහය අපතේ ගියෙ නෑ මචං....




















බුද්ධිය මිත‍්‍රයෙකැයි සිතු මම,
දිනක් මග රැක සිට
මගේ දෙවියන් මරා හෙලීමි.
දැවැන්තයකු වන බුද්ධිය,
අඳුරෙහි මහ අඩි තබමින්,
මා පිටි පසින් එනු මට ඇසෙයි...


එහෙත් දෙවියන් සිටි කල මෙන්, 
දැන් මට සැක හැර ගමන් කළ නොහැක.
මා වැටුණු කල, දැන් දෙවියන් නැති හෙයින්,
මමම නැඟී සිටිය යුතු ය...


යළිත් දෙවියන් සොයා ගිය මට,
උන්වහන්සේගේ රන්වන් මළ සිරුර,
මඟ අසල නුග ගස යට තිබී සම්බ විය..


ස්වාමීනි...! 
යළිත් නැඟී සිට මා හා පෙර මෙන්,
එනු මැනවයි මම කීමි...
උන්වහන්සේ යළි නැඟී නොසිටින්නේ,,
බුද්ධිය තම දත් දෙපළ පෙන්නා විලිස්සමින්,
මා පිටිපස සිටින හෙයින් බව මම දනිමි....!


"එහෙත් මට බුද්ධිය ගසා පලවා හැරිය නොහැකිය,
-ඔහු මා අතහැර නොයයි -"


දෙවියන් මැරීම,
-ජී බී සේනානායක-

Apr 14, 2014

Spartacu's Last Words














"Spartacus"
That is not my name.
I shall finally hear it again,
Given voice by my loving wife.
in greeting longed for..

There is no greater victory,
Than to fall from this world..
A Free Man!


Feb 14, 2014

නවම් මස පොහොය දින


හැමදාමත් පොහොයට පන්සල් ගිහින් ගාථා කීම හැරුනු කොට අද දිනයේ අසන්නට ලැබුණු වැදගත් ගාථා පාඨ දෙකක් ලෙස, මෙම සටහන තබමි... ( උපුටා ගැනීම මෙතැනින්.. )



තණ්හාය ජායතී සෝකෝ – තණ්හාය ජායතී භයං

තණ්හාය විප්පමුත්තස්ස – නත්ථි සෝකෝ කුතෝ භයං
තණ්හාවෙන් තමයි ශෝකය හටගන්නෙ. භය හටගන්නෙත් තණ්හාවෙන් තමයි. තණ්හාවෙන් නිදහස් වුණ කෙනෙකුට ශෝකයක් නෑ. භයක් කොයින්ද?
                            (ප්‍රිය වග්ගය- ජේතවනාරාමයේදී අනිත්ථිගන්ධ කුමරු අරභයා වදාළ ගාථාවකි ෴)

උට්ඨානවතෝ සතිමතෝ – සුචිකම්මස්ස නිසම්මකාරිනෝ

සඤ්ඤතස්ස ච ධම්මජීවිනෝ – අප්පමත්තස්ස යසෝ’භිවඞ්ඪති
නැගී සිටින වීරියෙන් යුක්ත නම්, හොඳින් සිහිය පවත්වනවා නම්, පිරිසිදු ක‍්‍රියාවෙන් යුක්ත නම්, නුවණින් විමසා බලා කටයුතු කරනවා නම්, සංවර නම්, ධාර්මික ජීවිතයක් ගෙවනවා නම්, අන්න එ් අප‍්‍රමාදී පුද්ගලයාගේ කීර්ති රාවය ඉහළින්ම පැතිරෙනවා.
(අප්පමාද වග්ගය- වේළුවනාරාමයේදී කුම්භඝෝෂක අරභයා වදාළ ගාථාවකි ෴)


Dec 27, 2013

පිපාසයෝ...?















ඉමක් කොනක් නොපෙනෙන
ඉඩෝරයට කර උන පොළොවක
මිරිගුවක් පසු පස දුවන
පිපාසිත මුව රැල…

අද ෆුල් ජොලියේ ජොබ් ගැන පුරසාරම් බාන උඹලා,
හෙට එම්.එස්.සී එකක් කරල රට සල්ලි වලින් පඩි ගන්න හදනවා…
අනිද්දා පී.එච්.ඩී එකක් දාල ලෙක්චර් වෙන්න හදනවා…
සිකුරාදාට කියනවා,
මේ පාළුව යන්නත් එක්ක බැඳල අවෝසම් උනා නම් නියමයි කියල...
සෙනසුරාදාට තමයි හොදම එක,
එදාට කියන්නෙ බොන එක තරම් වෙන ෆන් කොහේද කියල...

මේව ඔක්කොමත් හරි,
නිකමට…
උඹලට ඇත්තටම ඕනෙ මොනවද කියල ඇහුවොත්...?...

උඹල දුව දුව හොයනවා
උඹලට තියෙන පිපාසයට වඩා...
උඹලට පිපාසයක් වෙලා තියෙන්නෙ අනිත් උන්ගෙ පිපාසය.

උඹලත් එක්ක ඉන්න මම
මේ දේවල් ගලප ගන්න බැරුව
බලන් ඉන්නවා නතර වෙලා
උඹලගෙන් දිනන්නේ කවුද කියල.
උපේක්ෂාවෙන්...
හැබැයි නතර වෙලා ඉන්න මට,
මම ඇත්තටම පිපාසෙන් කියල තේරුන දවසට...[…]

May 27, 2012

Wiimote Head Tracking

This post is related with my undergraduate research. I am reading about human-computer interaction in a head oriented way. So I have to implement a head tracking system with wiimote. Here I am sharing my experience with 6DOF head tracking system. Try it...And Enjoy.. :)

I utilized available head tracking APIs to implement the head tracking system. Following were some APIs I have identified in literature review.
  • Glove PIE emulator
  • FaceTrackNoIR
  • Wiimote Head Tracker
  • FreeTrack
FreeTrack is a popular head tracking SDK which is distributed under GPL. It has been used in large number of games, simulations and it has a good community support. Hence it is improving day by day and requirement for the implementation has a good documentation. It uses several vision based algorithms for head tracking. You can go through tutorials over there and it is quite easy to implement. 

I investigated vision based tracking and sensor based tracking with FreeTrack. Hope you may also helpful. 

Vision based tracking (Active maker)

In literature review I found that there are significant research studies have been conducted for active marker based tracking. Hence I try to implement a head tracking system with four LED bulbs and for the calibration. I used FreeTrack SDK. In this case I noted that tracking system is fast and enough to emulate mouse function as shown in figure 1.

But this approach has lot of background limitations. See figure 2.

According to figure 2. (a) and (b), several other locations in the environment are detected as the marker points by the camera. This is because several points are illuminated in the image due to lighter background. Hence the position and orientation calculations are incorrect and getting unexpected rotations when it is emulating in the virtual environment. Therefore this system is limited to use in a darker environment.
And this system is heavily affected by the frame rate the camera which is used to stream the images. If the camera has low frame rate (bellow 20 Fps), the head tracking system unable to capture quick head rotations (see figure 2. (c)). 

Sensor based tracking 

Wiimote IR camara has a good frame rate that is approximate to 120-160 Fps. Hence wii mote tracking is really faster than vision based tracking where we used webcam for the tracking system. Wiimote is capable for tracking up to 4 IR LEDs but here I focused on the different implementation setup. Most of the wiimote head tracking systems are motivated by Jhoney Lee’s head tracking approach which wiimote keeps stationary and a dynamic 2 LED sensor bar. It is only capable of 3DOF tracking but here we proposed a novel way to 6DOF head tracking. 
One limitation of these systems is IR lights get invisible when rotating the head therefore wii registered other LED in to the invisible point. Hence the calculation becomes incorrect and user’s looking direction is messed due to wrong emulation. In this research we proposed a model 3LEDs as it is enough to tack head position and orientation simultaneously.               

Figure 3: Hardware assembly for head tracking system
 
According to figure 3, the hardware set up is easy to use and it is not cumbersome as other head tracking systems. When using this system user need to wear base ball cap and realistically look at here and there in the virtual environment. As LED points are always in front to the wiimote I did not encounter any LED invisibility problem. In this approach has no background limitation as we encountered in vision based tracking system. 

 
As mentioned earlier, wiimote should be placed in a proper place as IR lights are fitting with wii resolution (1024x768).  

Figure 5: Wiimote placement - bird's view
Here is the virtual environment we have used to test the head tracking system.

Figure 6: Virtual environment for experiment with the head tracking system
Challenges have to be overcome
  • Tracking speed should be smooth with the view point movement in the virtual environment
  • Mouse emulation is not realistic as actual mouse looking. This is because tracking system is unable to provide acceleration when moving head here and there. 

These are several findings I have mentioned. Try it and extend it...I used this work in a virtual world based application area. If you gain any knowledge wrt my work, Please cite my publication at IEEE.