Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Sending commands to Bioloid from Matlab

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
24 postsPage 1 of 21, 2
24 postsPage 1 of 21, 2

Sending commands to Bioloid from Matlab

Post by Zwolsee » Wed Sep 17, 2008 3:20 am

Post by Zwolsee
Wed Sep 17, 2008 3:20 am

I'm using the Bioloid robot for my thesis. I have a character recognition program which takes an image of a number 0 - 9 as an input and performs the recognition of that number in Matlab. The program returns the variable 'number' with whatever number from 0 - 9.

I want to somehow send which ever number my Matlab program recognises to the Bioloid robot to perform a clapping motion for as many number of times is stored in the variable 'number'.

Can anyone help? Whats the easiest way of doing this?

Zwolsee
I'm using the Bioloid robot for my thesis. I have a character recognition program which takes an image of a number 0 - 9 as an input and performs the recognition of that number in Matlab. The program returns the variable 'number' with whatever number from 0 - 9.

I want to somehow send which ever number my Matlab program recognises to the Bioloid robot to perform a clapping motion for as many number of times is stored in the variable 'number'.

Can anyone help? Whats the easiest way of doing this?

Zwolsee
Zwolsee
Robot Builder
Robot Builder
Posts: 11
Joined: Wed Sep 17, 2008 3:11 am

Post by StuartL » Wed Sep 17, 2008 10:54 am

Post by StuartL
Wed Sep 17, 2008 10:54 am

Be warned: It's considered very bad form to post the same question many times on a forum. I've deleted your other posts on this subject to leave this thread for people to answer.

I have no idea of the programming capability of MatLab. If it can access serial ports you may find that the USB2Dynamixel product from Robotis achieves what you desire, there are PDFs for it and the AX-12s available from some simple googles.
Be warned: It's considered very bad form to post the same question many times on a forum. I've deleted your other posts on this subject to leave this thread for people to answer.

I have no idea of the programming capability of MatLab. If it can access serial ports you may find that the USB2Dynamixel product from Robotis achieves what you desire, there are PDFs for it and the AX-12s available from some simple googles.
StuartL
Savvy Roboteer
Savvy Roboteer
Posts: 350
Joined: Mon Jun 04, 2007 3:46 pm
Location: Thatcham, Berkshire, UK

Post by clusher » Wed Sep 17, 2008 11:06 am

Post by clusher
Wed Sep 17, 2008 11:06 am

Matlab has the ability to communicate through serial port. google for it, I don't really have any code to show about it.

I suppose the recognition program isn't the issue.

About communicating to bioloid. The USB2Dynamixel allows direct communication from the PC to the bus of AX-12 servos. So all you had to do was to make a matlab program to send orders to AX-12 to move the number of times .

However I would suggest something a little different, since the main goal of the thesis clearly isn't the "clapping" and you may not have all the funds required. You can use the MotionEditor to make a page with the clapping movement (let's suppose its page 4). Then you can have Matlab to send via serial port the command "play 4" the number of times you detect.

Or you can make a small C program for CM5 that receives the number through the serial port and repeats the clapping movement that many times.
Matlab has the ability to communicate through serial port. google for it, I don't really have any code to show about it.

I suppose the recognition program isn't the issue.

About communicating to bioloid. The USB2Dynamixel allows direct communication from the PC to the bus of AX-12 servos. So all you had to do was to make a matlab program to send orders to AX-12 to move the number of times .

However I would suggest something a little different, since the main goal of the thesis clearly isn't the "clapping" and you may not have all the funds required. You can use the MotionEditor to make a page with the clapping movement (let's suppose its page 4). Then you can have Matlab to send via serial port the command "play 4" the number of times you detect.

Or you can make a small C program for CM5 that receives the number through the serial port and repeats the clapping movement that many times.
clusher
Savvy Roboteer
Savvy Roboteer
Posts: 57
Joined: Thu Jul 17, 2008 12:27 pm

Post by Zwolsee » Wed Sep 17, 2008 11:57 pm

Post by Zwolsee
Wed Sep 17, 2008 11:57 pm

Well thanks for informing me of bad form. I only did so because I am a little pressed for time at the moment and hoped that someone would see my reply in time. Thank you.

I am not that familiar with C programming the Bioloid. That sounds like a good way to communicate with the bioloid however. I don't have a USB2Dynamixel so I will need to write a short C program to send to the CM5. How would I call the number stored in the variable 'number'? Should I save the number in a text file using matlab then possibly call that file in my C program?
Well thanks for informing me of bad form. I only did so because I am a little pressed for time at the moment and hoped that someone would see my reply in time. Thank you.

I am not that familiar with C programming the Bioloid. That sounds like a good way to communicate with the bioloid however. I don't have a USB2Dynamixel so I will need to write a short C program to send to the CM5. How would I call the number stored in the variable 'number'? Should I save the number in a text file using matlab then possibly call that file in my C program?
Zwolsee
Robot Builder
Robot Builder
Posts: 11
Joined: Wed Sep 17, 2008 3:11 am

Post by clusher » Thu Sep 18, 2008 10:24 am

Post by clusher
Thu Sep 18, 2008 10:24 am

No, not at all.
Matlab can communicate through the serial port, so you can transmit the number directly to the CM5. Maybe you should send a message with a header (like sending "clap x", where x is the number) and have your C program to recognize the header "clap", read "x" and clap that many times.

About programming in C, you should read the documentation and some other posts in the forum. The main idea is to download Win-AVR (a compiler) and use Programmers Notepad to make the code and the makefile. Base the code in the example.c that comes in the Bioloid CD (although it has some errors) and in other examples you may find around here, and the makefile too.

Then you have to use Robot Terminal to upload it to the CM5. And it's a go :p
No, not at all.
Matlab can communicate through the serial port, so you can transmit the number directly to the CM5. Maybe you should send a message with a header (like sending "clap x", where x is the number) and have your C program to recognize the header "clap", read "x" and clap that many times.

About programming in C, you should read the documentation and some other posts in the forum. The main idea is to download Win-AVR (a compiler) and use Programmers Notepad to make the code and the makefile. Base the code in the example.c that comes in the Bioloid CD (although it has some errors) and in other examples you may find around here, and the makefile too.

Then you have to use Robot Terminal to upload it to the CM5. And it's a go :p
clusher
Savvy Roboteer
Savvy Roboteer
Posts: 57
Joined: Thu Jul 17, 2008 12:27 pm

Post by jorge ochoa » Fri Sep 19, 2008 12:12 am

Post by jorge ochoa
Fri Sep 19, 2008 12:12 am

see the next page:

http://humanoids.dem.ist.utl.pt

It can help you.
see the next page:

http://humanoids.dem.ist.utl.pt

It can help you.
jorge ochoa
Robot Builder
Robot Builder
Posts: 14
Joined: Mon Jan 14, 2008 4:50 am

Post by Zwolsee » Fri Sep 19, 2008 1:06 am

Post by Zwolsee
Fri Sep 19, 2008 1:06 am

I'm using a laptop to control the bioloid so I only have a USB port with a USB to serial adapter. Can you still send commands through matlab to the USB port and then the serial adapter handles the rest? And all I need to do is alter the example.c program to call that number from the COM port and manipulate the value stored in the message to clap so many times? Can you call motion pages in the C program at all?
I'm using a laptop to control the bioloid so I only have a USB port with a USB to serial adapter. Can you still send commands through matlab to the USB port and then the serial adapter handles the rest? And all I need to do is alter the example.c program to call that number from the COM port and manipulate the value stored in the message to clap so many times? Can you call motion pages in the C program at all?
Zwolsee
Robot Builder
Robot Builder
Posts: 11
Joined: Wed Sep 17, 2008 3:11 am

Post by billyzelsnack » Fri Sep 19, 2008 1:43 am

Post by billyzelsnack
Fri Sep 19, 2008 1:43 am

Probably. Try and find a USB virtual serial port driver for your USB adapter.
Probably. Try and find a USB virtual serial port driver for your USB adapter.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by Zwolsee » Fri Sep 19, 2008 4:04 am

Post by Zwolsee
Fri Sep 19, 2008 4:04 am

Yes I have the USB to serial drive installed for the adpater already. But how do I write to the COM port in matlab?
Yes I have the USB to serial drive installed for the adpater already. But how do I write to the COM port in matlab?
Zwolsee
Robot Builder
Robot Builder
Posts: 11
Joined: Wed Sep 17, 2008 3:11 am

Post by billyzelsnack » Fri Sep 19, 2008 4:36 am

Post by billyzelsnack
Fri Sep 19, 2008 4:36 am

billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by Zwolsee » Fri Sep 19, 2008 8:54 am

Post by Zwolsee
Fri Sep 19, 2008 8:54 am

Does anyone know how to use callbacks on Matlab? I have a GUI with a video input being streamed in and ive created a push button to capture an image. I know I have to use getsnapshot somehow but everytime i run it it ouputs:
Undefined function or variable 'vid'.

Error in ==> OCR_GUI>pushbutton1_Callback at 88
char = getsnapshot(vid);

Error in ==> gui_mainfcn at 75
feval(varargin{:});

Error in ==> OCR_GUI at 42
gui_mainfcn(gui_State, varargin{:});

??? Error while evaluating uicontrol Callback.

Can anyone help?
Does anyone know how to use callbacks on Matlab? I have a GUI with a video input being streamed in and ive created a push button to capture an image. I know I have to use getsnapshot somehow but everytime i run it it ouputs:
Undefined function or variable 'vid'.

Error in ==> OCR_GUI>pushbutton1_Callback at 88
char = getsnapshot(vid);

Error in ==> gui_mainfcn at 75
feval(varargin{:});

Error in ==> OCR_GUI at 42
gui_mainfcn(gui_State, varargin{:});

??? Error while evaluating uicontrol Callback.

Can anyone help?
Zwolsee
Robot Builder
Robot Builder
Posts: 11
Joined: Wed Sep 17, 2008 3:11 am

Post by limor » Fri Sep 19, 2008 11:18 am

Post by limor
Fri Sep 19, 2008 11:18 am

Hi Zwolsee,

We did quite a lot of work hooking up the Bioloid to Matlab/Simulink at IST in Portugal.
Have you seen the reference in the Bioloid Knowledgebase

There's a thesis by Pedro Teodoro with all the gory details.
Hi Zwolsee,

We did quite a lot of work hooking up the Bioloid to Matlab/Simulink at IST in Portugal.
Have you seen the reference in the Bioloid Knowledgebase

There's a thesis by Pedro Teodoro with all the gory details.
limor
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1845
Joined: Mon Oct 11, 2004 1:00 am
Location: London, UK

Post by Zwolsee » Sat Sep 20, 2008 3:40 am

Post by Zwolsee
Sat Sep 20, 2008 3:40 am

Yes I have thanks for that
Yes I have thanks for that
Zwolsee
Robot Builder
Robot Builder
Posts: 11
Joined: Wed Sep 17, 2008 3:11 am

Post by Zwolsee » Sun Sep 21, 2008 8:47 am

Post by Zwolsee
Sun Sep 21, 2008 8:47 am

Does anyone know if you can call motion pages in the C program?
I need my program to read a number being sent from a serial port and clap the number of times of the character. Does anyone have any example code?
Does anyone know if you can call motion pages in the C program?
I need my program to read a number being sent from a serial port and clap the number of times of the character. Does anyone have any example code?
Zwolsee
Robot Builder
Robot Builder
Posts: 11
Joined: Wed Sep 17, 2008 3:11 am

Post by jorge ochoa » Sun Sep 21, 2008 5:16 pm

Post by jorge ochoa
Sun Sep 21, 2008 5:16 pm

in the forum "Bioloid Control (Open Source Project)

", you can find information about it and the source code.
in the forum "Bioloid Control (Open Source Project)

", you can find information about it and the source code.
jorge ochoa
Robot Builder
Robot Builder
Posts: 14
Joined: Mon Jan 14, 2008 4:50 am

Next
24 postsPage 1 of 21, 2
24 postsPage 1 of 21, 2