THE STREEB-GREEBLING DIARIES-C#版本 MonoSLAM

Friday, June 09, 2006

MonoSLAM for Windows

I now have a version of  Andrew Davison's MonoSLAM system working on Windows. You can find it  here. The translation from C++ to C# took some effort, and I replaced a lot of proprietory stuff for handling streams and lists with standard .NET classes. I also got rid of all the C++ templates, which were unnecessary. I'm not a fan of templating, because having used them in the past they can make the code very difficult to follow if you don't know what data types are being used in a given situation. About the biggest problem was dealing with multiple inherritance, which C# does not support, but I eventually managed to work around that.

Why did I bother to translate to C#? Certainly, it would have been far easier just to compile it as a C++ DLL. To a large extent this was self-inflicted punishment. Doing the translation meant that I needed to understand exactly how the code works, and I think C# is generally more stable than C++. C++ compilers let you get away with all kinds of dodgy stuff, whereas the C# one is far more discerning which minimises the chances of odd bugs or memory allocation/deallocation problems. I also now have a substantial legacy of vision stuff written in C#, so sticking with that keeps everything consistent.



The MonoSLAM system is one of the most reliable feature tracking methods I've seen. It combines both bottom-up feature detection and top-down assumptions from an internal 3D map within a  closed visual loop, and I think it's this kind of approach which will ultimately lead to some really practical and cost effective robotics applications. I think our own biological vision system works in exactly this way - as a closed loop.

The camera can be moved around in any sort of way, and isn't restricted to only certain types of movement. This means that potentially it could be attached to all kinds of complicated devices such as robot arms with multiple axes, or it could even become part of a wearable computer (the camera could be on your shoulder as you walk about).

The only assumption here is that the camera has a reasonably high frame rate, and that it moves continuously through space (it doesn't jump or teleport from one location to another). For testing purposes I used a very bog-standard  QuickCam Express, which is only USB 1.1, has a low quality image and works at maybe 15 frames per second on average. Performance of the system seems to be the same both in good natural lighting and in low artificial lighting where there is much less contrast and pixels blatantly jiggle around.

Early last year I used a Davison-like feature tracking method to construct 3D grids of an orange juice carton which you can see below.



However, the method which I used wasn't as good as Davison's. I couldn't get the maths right, and the feature tracking would suffer from slippage over time, as occurs with virtually all similar methods. So the 3D grid would gradually become less and less coherent until it was useless. I think I should return to this problem using similar methods to MonoSLAM, which might give far better results. The ultimate goal is to have dense 3D maps formed in something close to real time, so that a robot like  Rodney can glance around at a desk surface and pick out objects in a non-trivial way.
16 comments:
Yaron said...

Hi Bob,
Thank you for sharing the code.
Does it have similar performances as Davidson's current open version of monoSLAM?

Bob Mottram said...

It's based on the Scenelib 1.0 code available on Andrew Davison's web site, and has similar performance.

http://www.doc.ic.ac.uk/~ajd/software.html

Yaron said...

Thank you!

adonis said...

do you know a way to add a usb camera interface to davison's monoslam on linux

Bob Mottram said...

On linux it would probably be fairly straightforward to write a v4l2 interface, to replace the original firewire one. Many USB cameras are UVC compliant now, and so will work on linux without any issues.

However, as I've mentioned many times before Davison's system is experimental, and not really suitable for practical uses on robots just yet.

adonis said...

thanks bob for your comments....if davison's monoslam is not good for practical uses on robots then can you suggest me some other software which might be good for this application

Bob Mottram said...

There are some visual SLAM functions within MRPT

http://babel.isa.uma.es/mrpt/index.php/Main_Page

I havn't tried using these, but I expect that they are similarly experimental. At the moment as far as I'm aware there are no visual SLAM systems under free/open source licenses which are really what I'd call "commercial grade", in that they could perform reliably day after day when used on a mobile robot.

Even the systems sold commercially by Skilligent and Evolution I think are either not quite ready for prime time, or are not really general purpose SLAM.

adonis said...

thanks bob for your previous comments..they have been really helpful...now i have added a USB cmaera to the monoslam code (linux version) which previously supported only firewire cameras...but i am not able to get a very good performance...i have changed the camera parameters and i am able to get good tracking of the camera but for new features....i get the 2D position correctly...i.e. in my 3D map they all appear in the image plane...i am not able to find their depth correctly...can you tell me what could be the reason...also my camera is not wide angle...how much effect does this have on the performance

Bob Mottram said...

Narrow field of view will degrade performance on this kind of system, since features will go out of view more often.

In this version depth is estimates by making observations of the same feature tracked over several frames. The narrower the field of view the less likely that features can be tracked over significant numbers of frames.

adonis said...

hi bob, i have one problem. the continuity of the system. is it possible to break the system continuity and resume tracking again. maybe not from a completely new location but from a place where the robot has already been before. there are various object recognition algorithms tht can be applied here which tells me the presence of an already existing feature in the present frame but what bothers me is that from this new location how can i find the position of the camera.

Bob Mottram said...

It is, but not with this software. Relocalisation can be achieved by matching feature descriptors within the image, then using three point pose estimation to recover the camera pose. It's something which was done with later monocular SLAM systems.

adonis said...

can you suggest some reading material or open source code for the same

chao shen said...

hello Bob, i'm a student and interest in monoSLAM. the windows version's link is crashed, could you update it? thank you very much!

Bob Mottram said...

I'm not doing any development on monoSLAM currently, and I don't use Windows much either. If you have any patches to fix bugs then I'll include them in the code.

chao shen said...

Thank you for your reply! What i'm saying is that I couldn't get the code you shared before. could you send me a copy of your old code? thanks!

Bob Mottram said...

https://code.google.com/p/monoslam/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值