Society of Robots  Robot Forum
Software => Software => Topic started by: superchiku on March 03, 2008, 11:43:33 AM

thanks for the great tutorial admin about image processing ,
now i know about the theories of image processing bt can u help me by telling me how i can apply that knowledge practically like image processng with matlab (like how to program and stuff using matlab) also i have heard that for image processing u always need to attach the bot to the computer for better processing so can u tell me how i make a completely autonomous camera bot using matlab with no help from the computer during competitions or real time enviroments where the bot needs to work?????????

you can use the matlab image processing toolbox, it has a collection of powerfull functions
and you have to learn to program with matlab language, its pretty much like c
,im using matlab intensivly so if u have any questions ur welcome
im using matlab to control my robot, using the serial port to reveive / transmit data (commands and readings .....)

ok i need to use matlab thats cool but can u tell me where do i learn the basics of matlab programming and image processing also tell me how do i interface matlab with my rocots microcontroller

using matlab with no help from the computer during competitions or real time enviroments where the bot needs to work?????????
I have to use matlab(simulink mostly) almost everyday and I have never heard of using matlab without a computer.
by the way there are cameras that can be connected directly to the controller. But a computer is fundamental for debbuging. I cant remember the name of the cameras right now but if you use the search tool I am sure you will find lots of topics about them, they are popular here.

The cameras  were they CMU cam or AVR cam ? ;)

to learn matlab its wether you buy a good book or read the matlab help
,the matlab help is really great,i kind of leart matlab programming by the help
its like a big book
also try to find some matlab forums, tell me if you find a popular one
,,maybe admin should have a Matlab section in this forum , ;D .
there is no way that you can use matlab without a computer
there is somthin in matlab called a deployment tool where you can make your program(programmed by matlab) run on pcs that dont have matlab
,also check with the embedded matlab toolbox it can help.
simulink is just to simulate your work
i never use it,
i do functions in the mfile programming that helps me to build my bot brain
you just need to implement your own algorithms in the matlab language thats all
as matlab offers great functions hard algos should be easy to implement

tell me how do i interface matlab with my rocots microcontroller
1/serial port (UART)
2/LPT
read external interfaces in the matlab help

The cameras  were they CMU cam or AVR cam ? ;)
That is it!
simulink is just to simulate your work
Wrong. Simulink can be used to simulate your work, but it is mainly used to find the value of variables(break points, delays, etc) that are just way to difficult to find algebrically by using a technique called modeling. Simulink is never used to simulate a complex machines like a car, a rocket or a robot. There are programs just for that. Also most of people I know, include myself, also make their own programs.

well then can simulink be a help in robotics?
all i saw is just to add boxes and see how they do, this is simulation, you dont design anything
unless you include an mfile (kind of way to debug your mfile)

well then can simulink be a help in robotics?
Of course. For example, you have a surgeon robot. It will be basically an arm. You need the robot to be extremelly precise otherwise you willl kill the patient. Be cause of that you have to know the exact quatity of work you need to make the motors do. And you need to know how the motor will work. That is called "control theory". Problaby you might have heard the words PID or fuzzy. Simulink is all about that. You use simulink to find the optimal value, so you can avid vibrations, noise or even explosions. Here is a reasonable explanation: http://en.wikipedia.org/wiki/Control_theory (http://en.wikipedia.org/wiki/Control_theory)
You can also use Simulink for modeling as i said before. For example, my case. I research bionics and one of the most basic things of bionics is to calculate the flow of blood in the Aorta. As a System enginner I have very little knowledge of fluiddynamics so instead of using the NavierStokes equation I simply make an analogy with a electric circuit and use circuit equations. In order to simulate the flow of blood instead of assembling the circuit, I use Simulink.
Then you use the results you obtained in Simulink when programming the robot or designing the body or circuit.
When you learn how to use matLAB professionally you will understand what I am trying to say. But before you learn matLAB you must learn control theory, linear algebra, complex variables(I dont know how it is called in English, it is basically calcullus with complex numbers), and differential equations.

can you upload a matlab simulink file showing us what you are talking about? something related to robotics ,it can help many folks in here
and yes i read about control theory and the PID thing is to study the starting response of a system before its stable
, maybe that would be important in only professional robots
and what else you can do in simulink other than mfile programing? i would be glad if you can upload an example of what you say, thanks

http://wwwusers.cs.umn.edu/~martin/PUMA/index.html (http://wwwusers.cs.umn.edu/~martin/PUMA/index.html)
I am not going to upload my stuff because I do it for research and work. They are my industrial secrets. But I know this website above which is great. But it is pointless to read it if you have no background.
And simulink is all about mfile programming. that is it. It is up to YOU how are you going to program the files. The possibilities are infinity. Just like any other programming language (for example, openGL is just about showing stuff on screen but it is widely used from games to scientific simulation). And finally, simulink and matLAB are for professional robotics and enginering. I see a contradiction: Why are you, as a hobbist, using matLAB for robotics when it is not needed at all?
Anyway, we are already way to much offtopic. I dont want to get banned so that is my last post.

hey ppl ok i went with benji's advice and decided to get matlab and i even bought a book named image processing using matlab by gonzalez though i learnt the basics iam stuck in the chapter about spatial filtering and all and i dont understand a bit what it says plzz help me guys by telling what tutorials to follow in order to learn matlab programming??

hey superchiku, howcome you want to do image processing if you dont know matlab first?
i told you already USE MATLAB HELP FIRST then buy the book you think you need
,its not a good idea to read about image processing using matlab before you learn how to program in matlab first,
drop the book for now and use the matlab help
then you read this book.
Anyway, we are already way to much offtopic.
i dont think so, everything that is related to robotics is acceptable to discuss, isnt this site for learning people how they can get better in robotics?
if matlab does that then why not tell folks about what it can do,,,!!!!!

by the way, to me, im using matlab to show the maps im aquireing from my scaaning sensor(ir)
i also implemented the a* algorithm to do pathplanning and mapping (exploring unexplored areas )in matlab
i did all this stuff programing mfile functions then arranging them into a gui, i didnt see any need for simulink
, how would simulink help me in such a project?

benji can by reading the help ill be able to grab the basics of matlab programming without any outside help at all
???
how much of matlab should i know bfore starting out with image processing i know some basics of matlab like making arrays ,structures , functions with m file do u think it will be enough //????

i told you hundered times that the matlab help is enough, its the biggest tutorial for matlab basics
,not only basics , also some advanced applications
you SHOULD learn how to make matlab functions and scripts using mfile programing, its not that hard
,and when you program you use the matlab image processing functions when needed
again, use the matlab help

ya ur right i probably am being too impatient so matlab help can also give info about image processing functions and how to image processing :D
iam downloading matlab version 2007b will it be enough or do i need a better version

by the way, to me, im using matlab to show the maps im aquireing from my scaaning sensor(ir)
i also implemented the a* algorithm to do pathplanning and mapping (exploring unexplored areas )in matlab
i did all this stuff programing mfile functions then arranging them into a gui
You should have told me that earlier. It is not bad at all (but it is a bit of a waste of resources. You could easily do that using any programing language. matLAB (including simulink) are mainly used when there is something difficult to calculate, like a partial differential equation of third grade with two variables.) I am almost sure there is a pathplanning function in matlab (find the Euler graph(graph theory)), so in that case it is not a bad idea using matLAB. And there is no need for simulink for your task. I though you was trying to calculate the vibration on the arm of your robot, or the characteristic of some sensor you might be using.
Now superchiku why do you want to use matLAB for image processing. RoboRealm is much better for robotics, easier to use, faster, and best of all, it is free.

roborealm is a good option but i dont know how to use it and also abt matlab i know the basics of matlab so i decided to go with matlab also to be honest i think it would be very easy in roborealm and i dont want to go the easy way i want to take the challenge of programming which i can get in matlab , it may be difficult i also may fail but still it can teach me a lot and i can be ready for worst case scenarios

the project im doing isnt simple. i recieveing scanner data from the serial port so the matlab input is just the scanner distances with angles
, going from here i built the robot brain
the bot can
1/choose the closest unmapped area AND the area that makes power consumption is less to go to,(that includes getting away from turns (hexapod))
2/it doesnt waste time remapping unmapped areas
3/diagonal movements are allowed (only with 45 degree)
4/show the map every time a new scan is aquired
if you wanna do these tasks in other than matlab , like visual c++ or visual basic then you have to build your own functions and they are a lot.
i am using a lot of matlabs function and thank god there are lots that benefits me in this project
like imtool , matrix rotation ,matrix concatenate ....etc
so i dont think that it was a bad choice (matlab) to do this
by the way thanks Tsuku for the info
and yea superchiku ,this version is great i am using r2007a and its awesome , as long as your is newer then it should be great

well then after so much speculation matlab it is but i have got another doubt can u clear it suppose i have learnt image processing with matlab but i want to interface it with a bot like the bot has to move inthe direction of the red squares how do i do it using atmega16 mcu and matlab i mean in the traditional way i just write programs in winavr and download it to the bot and it does work but now i got to attach the computer to the bot so how do i do it using matlab and how do i load the program

you need to interface it using the serial or parallel port of the pc
matlab supports both, so you send and recieve data between micro and matlab

yes parallel port but how do i load the progrram in it do i use the tx and rx pins?

no, rx and tx are for the serial port
you connect a port like PORTA in the micro with the Lpt port on the pc side
so its a 8 bits data bus

i get it its like reading adc value for each kind of pixel i read ill get different values in the parallel port and make the mcu do things accordingly isnt it

i havnt dont anythink related to cameras
but you can obtain the image then send it to matlab using serial port or paralel port
do the processing there and send comands back to the robot

oh so according to the image i send the commands but i thought that you have to load the program in the microcontroller for the robot to do ur work but how can u send commands to a mcu without loading the program in mcu

it seems you didnt totally get what i was saying
you have 1 program on your micro (which is made by winavr and downloaded by ponyprog for instance)
and you have another mfile on matlab
so its 2 programs
data is sent and recieved by functions in both programs ,
so your micros program job is to aquire image from camera and send it to matlab
your second program(which is in MATLAB) will do the processing and send commands back to your micro
is it clear now
?

all clear boss now matlab does support this kind of interface so it must be cool thank u

Just in case you aren't already aware:
http://www.roborealm.com/

is roborealm good enough and how do i learn it?

Roborealm Getting Started (http://www.roborealm.com/help/Getting%20Started.php)
You might wanna read up there...

ok