


这套系统的作用就是根据传感器的输出数据来判定传感器所依附物体的姿态,然后在PC上以3D效果显示出来。核心的东东就是一个姿态的识别算法,其他什么数据传输,图像显示都是绿叶。
由于软件是在Linux上编写,我采用了GTK+。为了显示3D效果,我google调查了一下,需要GTK+ OpenGL Extension。OK,问题就是找到3D Sample了。可是我下载GTK+ OpenGL Extension的Release版本1.2.0编译上就遇到了问题。gtkglext-1.2.0是2006年的版本,我现在用的GTK+还是比较新的版本,很显然gtkglext-1.2.0版本太老了。当时的思路是google解决掉所有出错点。经过一番恶战,我的确解决了编译的错误,但是运行起来依然有问题,总是说"gtkglext example 'GDK_IS_GL_DRAWABLE (gldrawable)' failed"。再google,貌似是gtkglext自己的问题。最后决定用git抓取最新版本。抓下来后configure那里又不过,晕死了!提示configure: error: Invalid target for GDK: use x11 or win32。怎么办呢?干脆Merge一下1.2.0和git的版本算了,我首先Merge了gtk/gtkglwidget.c,毕竟之前报错总来自这里。看来是人品爆发了,merge完这个文件,编译,执行再不出错了!哈哈!看来root cause找到了!Yeah!
GTK+ OpenGL Extension 的shapes例子还不错,可以3D显示并旋转一个茶壶,这正是我想要的东西^_^。
后记: 2011/08/10已经实现当时的想法,详见 AMCC 1.0 release
Comparison of Hard Link and Symbolic Link
| Item | Hard Link | Symbolic Link |
|---|---|---|
| Name resolution | Faster. A hard link contains a direct reference to the object. | Slower. A symbolic link contains a path name to the object, which must be resolved to find the object. |
| Object existence | Required. An object must exist in order to create a hard link to it. | Optional. A symbolic link can be created when the object it refers to does not exist. |
| Object deletion | Restricted. All hard links to an object must be unlinked (removed) to delete the object. | Unrestricted. An object can be deleted even if there are symbolic links referring to it. |
| Dynamic objects (attributes change) | Slower. Many of the attributes of an object are stored in each hard link. Changes to a dynamic object, therefore, are slower as the number of hard links to the object increases. | Faster. Changes to a dynamic object are not affected by symbolic links. |
| Static objects (attributes do not change) | Faster. For a static object, name resolution is the primary performance concern. Name resolution is faster when hard links are used. | Slower. Name resolution is slower when symbolic links are used. |
| Scope | Restricted. Hard links cannot cross file systems. | Unrestricted. Symbolic links can cross file systems. |
Give up waiting for root device. Common problem:
- Boot args (cat /proc/cmdline)
- Check rootdelay = (did the system wait log enough?)
- Check root = (did the system wait for the right device)
- Missing modules (cat /proc/modules; ls /dev)
ALERT! /dev/dist/by-uuid/xxxxx doest not exist. Dropping to a shell!
奇怪,怎么就找不到硬盘了呢?我把rootdelay设置到了200都不OK!忙活了几个小时,不知道为何,思路有点乱,改天再研究!
1 在kernel.org下载了2.6.32.3的内核,放置到了下面的路径中
anders@ubuntu:/media/Data/anders/ing/linux/linux-2.6.32.3$
2 为了减少折腾的时间,我使用之前ubuntu904系统的config档案
anders@ubuntu:/media/Data/anders/ing/linux/linux-2.6.32.3$ cp
/boot/config-2.6.28-11-generic .config
3 制作软连接
ln -s /media/Data/anders/ing/linux/linux-2.6.32.3 /usr/src/linux
3 配置内核 (其实什么都没配置直接退出保存,然后shell提示内核压缩算法,我选择了gzip压缩,之后一路回车逃避一大堆提示^^)
anders@ubuntu:/usr/src/linux$make menuconfig
4 编译内核 (这一步骤我用了2个小时,23:40编译,知道第2天凌晨1:40,汗!)
anders@ubuntu:/usr/src/linux$make
[2010_0108]
5 安装内核 (/boot目录会长出来 vmlinuz-2.6.32.3)
anders@ubuntu:/usr/src/linux$make install
6 安装内核Module (/lib/module/会长出2.6.32.3目录)
anders@ubuntu:/usr/src/linux$make modules_install
7 制作initrd文件
anders@ubuntu:/usr/src/linux$mkinitramfs -o /boot/initrd.img-2.6.32.3 2.6.32.3
8 修改grub启动选项
vi /boot/grub/menu.lst, 加入如下文字:
title Ubuntu 9.04, kernel 2.6.32.3(by Anders)
145 root ()/ubuntu/disks
146 kernel /boot/vmlinuz-2.6.32.3 root=UUID=E218500B184FDD63
loop=/ubuntu/disks/root.disk ro quiet splash
147 initrd /boot/initrd.img-2.6.32.3
然后设置 default 2 (因为我上面添加这个启动选项的顺序是第3个(0为index,所以为2)
9 reboot
ok,一切搞掂!使用新Kernel还是不错的,启动速度提高了10s,嘿嘿!
$LINENO variable, are required by POSIX.