Robots: sharing ideas

Start posting "psuedo-code" or BASIC algorithms. BASIC is very easy to port to other languages.

Rich

Reply to
aiiadict
Loading thread data ...

I don't know if there are any mobile robot specific libraries but google for "computer vision library"

simultaneous localization and mapping

Reply to
l3

JGCASEY wrote:

Are you prepared to share any of your code, ideas or programming knowledge? If so feel welcome to send me a personal email :-)

My practical foray into vision started with interfacing the old monochrome quickcam ccd camera. I wrote the interface for DOS in QBasic, Assembler and also C using the DJGPP compiler.

I have played with the LogicTech webcams using their SDK and the old VC++5 by inserting C code functions in a a VC++ shell. Also used the old VB5 using some video for windows functions that were given to me.

[...]

Although I understand the basics of analog and digital electronics and have done a lot of interfacing via the parallel port it is, as I said, a time problem. When I get time I think it is better spent on working on some algorithm than reinventing the electronic wheel.

As for software I would rather write my own libraries and know that I understand the algorithms fully and can use them without any proprietory problems.

The trick might be to write it in a Java or HLA which can be compiled to either OS? Java has robotics support including vision.

John Casey

Reply to
JGCASEY

I'll post what I do here or on my website.

Yea, the quickcams are really fun. I may an intruder alarm for mine. Doing a pixel differential analysis, no edge detection or anything serious. I bet I still have that code somewhere.

In the open source world, there is such a rich assortment of code to use that it is the hardware that is more difficult to do.

"Proprietory problems?" Forget it. I work in the software world, you can't know if you are infringing on anyone's patents. Its one of the reasons why a lot of developers are trying to fight software patents.

There are thousands of software patents approved every year. The majority of them are duplictive or trivial. In 1999 some guy patented the swing. Microsoft is busy patenting things like XML. A mere human can not know them all and still accomplish anything. Sure there is plenty of "prior practices," but legal "prior art" is sometimes hard to come by.

You are actually in worse shape if you have a track record of researching the patent databases for algorithms. That way it is more likely than not that you knew you were infringing on a patent, and then you have treble damages.

So forget about it. Code what you want and patents only come into play if you want to sell to a large customer. At that point, refuse to indemnify and provide as-is and let them fight the legal battles.

I can honestly say I would sooner jump off a cliff than code something in Java or a high level language. C/C++ are what I enjoy.

Reply to
mlw

BASIC may be easy to port, but a bad language in which to code an example.

Reply to
mlw

I've never heard about it but it sounds interesting.

Reply to
mlw

mlw wrote: [..]

That was the first thing I did with my quickcam as well.

[...]

I consider C/C++ to be high level languages!

Might favourite language was assembler but I mainly use C.

Reply to
JGCASEY

If you say so.

Rich

Reply to
aiiadict

BASIC is too high level a language and lacks many of the structural metaphors required to express an algorithm.

How would you code something like an AVL tree or HASH table in basic?

Reply to
mlw

How would I code ZZZ in basic?

I would think about it and type it in.

But I haven't yet found use for the "avl tree" or "hash table" and I prototyped occupancy grid, path planning in BASIC, as well as line detect, "edge" detect, shape detect, object detect, pattern matching, robot arm controller, OCR.

When I get a good understanding of the problem and the solution, and have code that works in BASIC, I switch to assembly.

I think as far as this group goes (comp.robotics.misc), most people are either very beginner, or advanced and not sharing code or algorithms. There are exceptions, but I think I am mostly correct.

That is why I suggest BASIC or psuedocode. Help those who are beginning in this hobby to understand algorithms which seem complicated, but are very easy if described correctly.

Rich

Reply to
aiiadict

I agree 100% with your above comments Rich.

John Casey

Reply to
JGCASEY

You *can* haul a boat with a Yugo, but it doesn't mean it is the right vehical for the job. Languages like C and C++, perhaps Java, perl, and such, suit themselves to algorithm design. They are closer to a Turing machine. BASIC is too far abstracted. The language elements in BASIC are very complex an hide the nature of your algorithm.

This is a computer science debate and we are here on comp.robtotics, so I guess it is something that we'll have to disagree on.

This is probably the worst choices I've seen. I've programmed on a lot of machines with assembly, and while it is fun, code that I've written in assembly is "dead" i.e. I can't do anything with it. Code written in BASIC only works when you have a BASIC environment installed, and if you've used elements of a specific BASIC, your screwed until your BASIC vendor decides to port their BASIC to your new platform.

If you have an algorithm you value, it is best coded in a precise and well defined language. C is the defacto for this. Java works. Perl seems OK. I personally like C++. Algorithms and code I write runs on Windows, Linux,

*BSD, Macintosh, and embedded operating systems unchanged.

C may not seem as easy as BASIC at first, but once you get the hang of it, you'll look back at BASIC and question how you ever got anything done.

What "is" need not forever "be." I'd like to see some more action on this group. I live in Boston, and for the home of MIT, we have so few resources here.

Don't we all.

BASIC as an example language becomes hard to follow. Pseudocode is nice, but by its very nature something that has not been tested. A good, well defined programming language with simple constructs is better in most cases.

But hey, its a free country (more or less) do what you want.

Reply to
mlw

mlw wrote: : I'm building a robot and I think I have a few ideas that are cool. I'd like : any feedback ranging from "wow! great idea" to "dude, that's the lamest : thing I ever heard."

Great idea. I'm working on something similar. Way out of date pictures of my bot are at

formatting link
I'm useing an AVR ATmega16 as a low-level controller for I/O, running AvrX. I have PID working, with a rotateing head on which sonars will be mounted.

High level computer is a Virgin Webplayer -- an I-appliance hacked to run Linux. 200mhz processor, with 800x600 LCD, runs on 5v, and takes a laptop battery. It has 2 RS-232 ports that run at TTL level, so I can connect it directly to the AVR without a max232 or any level shifter.

Unfortunately, I only get to work on it in bursts since my kids were born -- teething, lack of sleep, house projects, work, etc keep causeing large delays. My two main goals for the project are sonar mapping, and experimenting with a Unix-style software system.

What I want to try is having low-level drivers that listed on device handles which control hardware. So, say, you could make the robot move with something like: echo "forward 10" >/dev/motors

Or read sonars with cat /dev/sonar

Of course -- you wouldn't really do that in day to day running. But, I would like to see how modular it can be made, so that behaviors, features, etc can be added by simply starting new processes.

Of course, I expect the Webplayer to be far too slow for ALL of this. However, at this rate, by the time I get to the higher-level stuff, I should have a 2ghz motherboard retired from my desktop to use.

-Chris

Reply to
Christopher X. Candreva

Cool pics, how are those wheel/motor combos? Where did you buy them?

Sounds cool.

Nice.

I'm a true Linux convert. After writing articles about Windows programming, and spending 15 years developing software on Windows, I've had it. Linux is easy to use and develop software on. I ain't going back.

You know, that is a neat idea, but I'm actually doing something different. Web services! how about this:

http://myrobot/forward?amount=10http://myrobot/sonar/read?sensor=1 This way, you can have access to your robot from *any* software, and if you have internet, it is automatically a remote control.

That's the beauty of web services, IMHO.

Yea, the nano-ITX boards look very cool.

BTW: Where are you? I'm in Boston.

Reply to
mlw

"mlw" wrote

Why nobody remembers delphi? I've been doing software development for quite a long time, and I know most of the "live" languages and some of the dead too (don't force me to remember cobol :-S ), and so far, delphi is the best of them all for all-purpose programming. (IMHO) I've done very high level things as asset management talking to oracle and DB2, I've done games using directX, you name it and I'll do it faster that C++, better quality, code is more legible, and for the linux fans, there is kylix. If you haven't done anything fancy (like talking directly to the OS API), then the code you've done for windows compiles without a glitch to linux. Execution speed is as fast as C++ (sometimes even faster).

I like Java and the new flavor of .net languages, but too many layers for the type of application I do.

I have to agree, between basic and C, a thousand times C. But I still love Pascal!

Reply to
Padu

Pascal was developed as a language to teach programming, not a language that was designed to write programs.

We all have our favorites.

Well, depending on your definition of "quality" and "legibility."

What about FreeBSD, MacOS, NetBSD or embedded platforms?

I wouldn't bet about the faster, your particular methodology for implementing the algorithm may have turned out faster on Pascal than the same appraoch in C++, but ..., well that's a different debate.

In the realm of robotics, I see little utility in the .NET languages.

My problem with Pascal, as I said, is that it was not designed to write applications. It was designed to teach fundimentals of programming. In that respect, it may be a good syntax for defining algorithms, but for actual software development, I like C and C++, you can do some things that other languages would never allow or make very difficult.

Reply to
mlw

This is my definition as a project manager: "Quality code is the one that performs what it was designed to perform according to its specs and can be mantained by any other programmer, demanding a very short time to understand what is already written." Legibility follows from that. If a junior programmer reads the same code in delphi or in C++, he/she will take much less time to understand what is going on reading delphi.

That's a big no no. I'm a software engineer, and I've learned that languages are only tools for our goals. For these platforms, you have to use the tools that are available. For example, I develop for PIC using MikroPascal because it gives me a productivity boost, but there are some things that I still need to do in mplab. Never done anything for MacOS, but I've heard that pascal used to be very strong among mac developers, but it probably changed.

Some time ago (delphi 3) I've implemented the same TSP algorithm in delphi and C. Delphi was slightly faster. I've compared the assembly code generated by both compilers and delphi generated a few less instructions. But I cannot claim that delphi is faster than C based on only one test, therefore I said "sometimes". In practical terms, it is fast enough for my customers. Never had a complain about performance (except when the project involves database, but then delphi is used only as the frontend)

Completely agree.

I can use that argument for LISP. There are things in that language that C/C++ would never allow me to do or make very difficult. Although programming in LISP/Prolog is very boring (even more if you don't have a very good IDE), the language itself is very powerful, and it definitely has its niche of applications. It is not a dead language at all, and if you are lucky, you still can sell LISP based projects. In our business, we have to be open minded. Sometimes we have to review some old concepts, or else we may be using the wrong set of tools for a given problem. You CAN do everything with C/C++, but can you do it faster than your competitor? Never had to tweak the language to get anything done with delphi. Pretty much everything I need is offered in the language. What I like about it is that I can choose how high level or how low level I want to go. What I dislike about it? Some decisions Borland made about following the .NET wagon. As I said, I like the .NET concept for some types of applications, but for the applications I do, the .NET framework is overkilling and completely unnecessary.

Reply to
Padu

I forgot to mention:

I fit it all into 128k of RAM.

Rich

Reply to
aiiadict

This is the point I made about the fact we all use different hardware/software/os combinations and that makes sharing *actual* code difficult.

It doesn't matter how great a language is in someones opinion it doesn't help those who cannot use it for whatever reason.

A great idea works fine in any language and if I come up with one I am sure you can easily adapt it to Wozbot?

Although I think your robot Wozbot will lack the oomph to do any major vision processing?

John

Reply to
JGCASEY

It was used to teach because it had very rigid types. Very rigid function declarations, where the functions removed passed variables off the stack. Computer science teachers, as opposed to engineers, wanted a very rigid environment to enforce concepts that qualified professionals are well able to determine when and if they should be circumvented.

That is a "good" definition, but there are some things that "junior" people will always have a hard time understanding. A good hash table, a fast and efficient tree, stuff like that.

I would also include a reusability clause. One long function can fit into your definition, but much of the time invested into the code may be wasted in the larger sense because elements of it could be reusable.

I completely disagree. I have code from the '80s that with only minor tweeks (K&R -> ANSI) still compile today and is still usable. RLE compression, serial communication, etc.

The language is integral with your goal. I'm a private consultant and I have generated a library of routines and classes over 20 years that includes tons of functionality. I can whip up a fairly sophisticated application in very short order. Writing things over and over again is wasteful.

Code written in C/C++ can be written to handle virtually every platform you would ever intend to target. For instance, my library started out on DOS, but in the course of its use, it has been compiled on Solaris, HPUX, VMS, Windows95, WindowsNT, WindowsXP, NetBSD, FreeBSD, OpenBSD, ConcurrentDOS, SCO Xenix, Coherent UNIX, Linux, and MacOS/X. It has even been used in kernel space on WindowsNT, Windows95, and Linux.

It is a freedom I really enjoy.

I can't debate your results as I have no data with which to do so, delphi is a good environment, no arguments, but still suffers from the afore mentioned problem of not running on enough platforms.

An example?

I don't like "environment" languages like Java, .NET, LISP, perl, etc. Be they interpreted or compiled into byte code, I like my code to be code.

Most often, in my case, yes. We've all seen it, right, the Java project that never seems to ship on time because of garbage collection issues, memory fragmentation, memory partitioning, data marshalling between components, thread syncronization etc.

From what I can gather, Microsoft is sort of backing away from .NET. It is having an inability to deliver the CLR and developers are backing away from providing it themselves. (A lot of applications are downloaded these days and the size of the CLR is prohibitive for download)

Reply to
mlw

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.