C Coding

Korean company maker of Robot kits and servos designed for of articulated robots. Re-incarnation of Megarobotics.
57 postsPage 2 of 41, 2, 3, 4
57 postsPage 2 of 41, 2, 3, 4

Post by l3v3rz » Sat Jul 26, 2008 10:42 pm

Post by l3v3rz
Sat Jul 26, 2008 10:42 pm

Posted code with ADC code. PSD sensor works well, some issues with Microphone. Modified so that code now works with IR so that press A punch left, B punch right. Also punched right if you get to close !

Code also sets basic posture on start up (after Red Square pressed on IR -ala normal). Report IR address and code received, but doesn't filter so will work on remote. Pressing #0 will run an ADC test routine that checks, PSD, MIC and Voltage. So lots to play with !

Compiled with WinAVR using Programmers Notepad (PN) IDE.

find at http://robosavvy.com/Builders/l3v3rz/RobovuilderIR.zip (oops typo - that really is vuilder!)
Posted code with ADC code. PSD sensor works well, some issues with Microphone. Modified so that code now works with IR so that press A punch left, B punch right. Also punched right if you get to close !

Code also sets basic posture on start up (after Red Square pressed on IR -ala normal). Report IR address and code received, but doesn't filter so will work on remote. Pressing #0 will run an ADC test routine that checks, PSD, MIC and Voltage. So lots to play with !

Compiled with WinAVR using Programmers Notepad (PN) IDE.

find at http://robosavvy.com/Builders/l3v3rz/RobovuilderIR.zip (oops typo - that really is vuilder!)
l3v3rz offline
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by l3v3rz » Sun Jul 27, 2008 1:45 pm

Post by l3v3rz
Sun Jul 27, 2008 1:45 pm

New version with a bug fix and a host of new features. Robo can now be cntrolled via serial interface (by pressing F,B,L,R). responds to loud noise by stepping backwards, basic motions also now work via IR controller(i.e. Fordward back, turn left, turn right. See source for details: (Includes Hex file - for those who just want to up load.)

http://robosavvy.com/Builders/l3v3rz/ro ... er_0_2.zip

Now I have control via serial port will look to integrate with Webcam software on PC. Robo football may be.
New version with a bug fix and a host of new features. Robo can now be cntrolled via serial interface (by pressing F,B,L,R). responds to loud noise by stepping backwards, basic motions also now work via IR controller(i.e. Fordward back, turn left, turn right. See source for details: (Includes Hex file - for those who just want to up load.)

http://robosavvy.com/Builders/l3v3rz/ro ... er_0_2.zip

Now I have control via serial port will look to integrate with Webcam software on PC. Robo football may be.
l3v3rz offline
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by i-Bot » Sun Jul 27, 2008 4:35 pm

Post by i-Bot
Sun Jul 27, 2008 4:35 pm

Wow, major progress.

Did motionbuilder make the basic pose entry or did you have to add it ?

I have drawn up the schematics so I can look at the battery charging. First pass for now, so let me know if you find any errors.
http://robosavvy.com/Builders/i-Bot/RBC.pdf
Wow, major progress.

Did motionbuilder make the basic pose entry or did you have to add it ?

I have drawn up the schematics so I can look at the battery charging. First pass for now, so let me know if you find any errors.
http://robosavvy.com/Builders/i-Bot/RBC.pdf
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by l3v3rz » Mon Jul 28, 2008 10:00 am

Post by l3v3rz
Mon Jul 28, 2008 10:00 am

Added the BasicPose function myself. The values come from initpos from motionbuilder but the array was created manually.

The diagram shows the sound chip - is there any sound output capability on the basic RCB without chip (model NNN) ? quite like my bot to be ale to beep
Added the BasicPose function myself. The values come from initpos from motionbuilder but the array was created manually.

The diagram shows the sound chip - is there any sound output capability on the basic RCB without chip (model NNN) ? quite like my bot to be ale to beep
l3v3rz offline
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by i-Bot » Mon Jul 28, 2008 10:41 am

Post by i-Bot
Mon Jul 28, 2008 10:41 am

Sadly the audio amplifier (NJM2073M), speaker ,and surrounding components are not fitted on the board either. This is a shame since the PWM from the Mega128 does go direct to the amplifier so could be used without the sound/speech chip. I guess the audio components could be fitted if you are happy to solder smt.
Sadly the audio amplifier (NJM2073M), speaker ,and surrounding components are not fitted on the board either. This is a shame since the PWM from the Mega128 does go direct to the amplifier so could be used without the sound/speech chip. I guess the audio components could be fitted if you are happy to solder smt.
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

latest C code for RoboBuilder?

Post by Joe » Sun Nov 02, 2008 4:25 am

Post by Joe
Sun Nov 02, 2008 4:25 am

l3v3rz wrote:I have got the PSD sensor working. Moving on to Mic and Voltage. Same basic routine so will post code when I have all three going.


Hey l3v3rz, that was back in July... at this point, I'd love to see the PSD code, even if you don't have mic and voltage working yet. In fact, as long as it's clearly noted somewhere what should work and what shouldn't, I'd be delighted to see the latest code in whatever state it's in, if you're willing to share.

In case you can't tell, I just got my RoboBuilder last week and I'm eager to start hacking!

How would you feel about a SourceForge project (robobuilder-lib?) for hosting and managing C code for the RBC?

Thanks,
- Joe
l3v3rz wrote:I have got the PSD sensor working. Moving on to Mic and Voltage. Same basic routine so will post code when I have all three going.


Hey l3v3rz, that was back in July... at this point, I'd love to see the PSD code, even if you don't have mic and voltage working yet. In fact, as long as it's clearly noted somewhere what should work and what shouldn't, I'd be delighted to see the latest code in whatever state it's in, if you're willing to share.

In case you can't tell, I just got my RoboBuilder last week and I'm eager to start hacking!

How would you feel about a SourceForge project (robobuilder-lib?) for hosting and managing C code for the RBC?

Thanks,
- Joe
Joe offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 204
Joined: Tue Sep 05, 2006 1:00 am

Post by l3v3rz » Sun Nov 02, 2008 2:45 pm

Post by l3v3rz
Sun Nov 02, 2008 2:45 pm

It hasn't changed since July. All the code there including PSD sensor and even the accelerometer code (did you buy one as well?)

http://robosavvy.com/Builders/l3v3rz/ro ... er_0_3.zip

Currently working on trying to link accelerometer to motion and get bot to dynamic balance.

cheers
It hasn't changed since July. All the code there including PSD sensor and even the accelerometer code (did you buy one as well?)

http://robosavvy.com/Builders/l3v3rz/ro ... er_0_3.zip

Currently working on trying to link accelerometer to motion and get bot to dynamic balance.

cheers
l3v3rz offline
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by Joe » Sun Nov 02, 2008 3:19 pm

Post by Joe
Sun Nov 02, 2008 3:19 pm

l3v3rz wrote:It hasn't changed since July. All the code there including PSD sensor and even the accelerometer code (did you buy one as well?)


Not yet — I'm waiting for Trossen to have them available here in the states. (Or waiting for a little while, anyway; if they don't get them in soon then I'll buy one overseas.)

l3v3rz wrote:http://robosavvy.com/Builders/l3v3rz/robobuilder_0_3.zip

Currently working on trying to link accelerometer to motion and get bot to dynamic balance.


Thanks very much for the code! I tried out 0.2 last night, and apart from changing "avr_gcc.exe" to "avr_gcc", it build just fine without modifications. That was all I had time to do then, but I hope to do more in the next week (and I'll work from your 0.3 version).

Dynamic balance is high on my list of goals, too.

Best,
- Joe
l3v3rz wrote:It hasn't changed since July. All the code there including PSD sensor and even the accelerometer code (did you buy one as well?)


Not yet — I'm waiting for Trossen to have them available here in the states. (Or waiting for a little while, anyway; if they don't get them in soon then I'll buy one overseas.)

l3v3rz wrote:http://robosavvy.com/Builders/l3v3rz/robobuilder_0_3.zip

Currently working on trying to link accelerometer to motion and get bot to dynamic balance.


Thanks very much for the code! I tried out 0.2 last night, and apart from changing "avr_gcc.exe" to "avr_gcc", it build just fine without modifications. That was all I had time to do then, but I hope to do more in the next week (and I'll work from your 0.3 version).

Dynamic balance is high on my list of goals, too.

Best,
- Joe
Joe offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 204
Joined: Tue Sep 05, 2006 1:00 am

Post by Joe » Fri Feb 13, 2009 5:42 am

Post by Joe
Fri Feb 13, 2009 5:42 am

Joe wrote:Not yet — I'm waiting for Trossen to have them available here in the states.


Trossen has them (RB accelerometers) in stock now, and I've just ordered mine. Should be here in a few days!

Meanwhile, is there any newer code than the 0.3 posted last November? I've got some time set aside over the next few months to work on this again, and I'd like to be sure I start from the current source.

Also, have you given any more thought to the idea of hosting an open-source project for this C code somewhere? SourceForge is nice because it gives a lot of extra tools (mailing lists, web page, etc.), but in a pinch I'd be happy to set up a subversion repository for it on strout.net.

Best,
- Joe
Joe wrote:Not yet — I'm waiting for Trossen to have them available here in the states.


Trossen has them (RB accelerometers) in stock now, and I've just ordered mine. Should be here in a few days!

Meanwhile, is there any newer code than the 0.3 posted last November? I've got some time set aside over the next few months to work on this again, and I'd like to be sure I start from the current source.

Also, have you given any more thought to the idea of hosting an open-source project for this C code somewhere? SourceForge is nice because it gives a lot of extra tools (mailing lists, web page, etc.), but in a pinch I'd be happy to set up a subversion repository for it on strout.net.

Best,
- Joe
Joe offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 204
Joined: Tue Sep 05, 2006 1:00 am

problems with 0.3

Post by Joe » Tue Feb 24, 2009 4:56 am

Post by Joe
Tue Feb 24, 2009 4:56 am

I finally got around to trying 0.3 of your code (I've got fresh motivation after installing the accelerometer and BT module).

Unfortunately, while 0.2 compiled successfully (albiet with a few dozen warnings, mostly in Comm.c), 0.3 does not compile for me. Here's the result:

Code: Select all
avr-gcc  -mmcu=atmega128 -Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT main.o -MF dep/main.o.d  -c  main.c
In file included from main.c:16:
global.h:25:24: avrlibdefs.h: No such file or directory
global.h:27:25: avrlibtypes.h: No such file or directory
In file included from main.c:21:
uart.h:177: error: syntax error before "baudrate"
uart.h:192: error: syntax error before "data"
uart.h:206: error: syntax error before "uartReceiveByte"
uart.h:206: error: syntax error before '*' token
uart.h:206: warning: type defaults to `int' in declaration of `uartReceiveByte'
uart.h:206: warning: data definition has no type or storage class
uart.h:210: error: syntax error before "uartReceiveBufferIsEmpty"
uart.h:210: warning: type defaults to `int' in declaration of `uartReceiveBufferIsEmpty'
uart.h:210: warning: data definition has no type or storage class
uart.h:218: error: syntax error before "uartAddToTxBuffer"
uart.h:218: error: syntax error before "data"
uart.h:218: warning: type defaults to `int' in declaration of `uartAddToTxBuffer'
uart.h:218: warning: data definition has no type or storage class
uart.h:227: error: syntax error before "uartSendBuffer"
uart.h:227: error: syntax error before "u16"
uart.h:227: warning: type defaults to `int' in declaration of `uartSendBuffer'
uart.h:227: warning: data definition has no type or storage class
In file included from main.c:25:
accelerometer.h:10:30: warning: no newline at end of file
main.c: In function `SW_init':
main.c:320: error: `FALSE' undeclared (first use in this function)
main.c:320: error: (Each undeclared identifier is reported only once
main.c:320: error: for each function it appears in.)
main.c: In function `main':
main.c:344: warning: passing arg 1 of `rprintfInit' from incompatible pointer type
main.c:349: error: `FALSE' undeclared (first use in this function)
make: *** [main.o] Error 1


I can probably fix some of these, such as the undeclared FALSE. And I bet the missing files are from Procyon AVRlib... I'll see if I can patch it up.

Best,
- Joe
I finally got around to trying 0.3 of your code (I've got fresh motivation after installing the accelerometer and BT module).

Unfortunately, while 0.2 compiled successfully (albiet with a few dozen warnings, mostly in Comm.c), 0.3 does not compile for me. Here's the result:

Code: Select all
avr-gcc  -mmcu=atmega128 -Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT main.o -MF dep/main.o.d  -c  main.c
In file included from main.c:16:
global.h:25:24: avrlibdefs.h: No such file or directory
global.h:27:25: avrlibtypes.h: No such file or directory
In file included from main.c:21:
uart.h:177: error: syntax error before "baudrate"
uart.h:192: error: syntax error before "data"
uart.h:206: error: syntax error before "uartReceiveByte"
uart.h:206: error: syntax error before '*' token
uart.h:206: warning: type defaults to `int' in declaration of `uartReceiveByte'
uart.h:206: warning: data definition has no type or storage class
uart.h:210: error: syntax error before "uartReceiveBufferIsEmpty"
uart.h:210: warning: type defaults to `int' in declaration of `uartReceiveBufferIsEmpty'
uart.h:210: warning: data definition has no type or storage class
uart.h:218: error: syntax error before "uartAddToTxBuffer"
uart.h:218: error: syntax error before "data"
uart.h:218: warning: type defaults to `int' in declaration of `uartAddToTxBuffer'
uart.h:218: warning: data definition has no type or storage class
uart.h:227: error: syntax error before "uartSendBuffer"
uart.h:227: error: syntax error before "u16"
uart.h:227: warning: type defaults to `int' in declaration of `uartSendBuffer'
uart.h:227: warning: data definition has no type or storage class
In file included from main.c:25:
accelerometer.h:10:30: warning: no newline at end of file
main.c: In function `SW_init':
main.c:320: error: `FALSE' undeclared (first use in this function)
main.c:320: error: (Each undeclared identifier is reported only once
main.c:320: error: for each function it appears in.)
main.c: In function `main':
main.c:344: warning: passing arg 1 of `rprintfInit' from incompatible pointer type
main.c:349: error: `FALSE' undeclared (first use in this function)
make: *** [main.o] Error 1


I can probably fix some of these, such as the undeclared FALSE. And I bet the missing files are from Procyon AVRlib... I'll see if I can patch it up.

Best,
- Joe
Joe offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 204
Joined: Tue Sep 05, 2006 1:00 am

Post by Joe » Tue Feb 24, 2009 5:04 am

Post by Joe
Tue Feb 24, 2009 5:04 am

All right, I (once again) posted too soon. It turns out that the 0.3 library just needs three header files from Procyon-AVRlib; the project compiled fine after copying in these:

- avrlibdefs.h
- avrlibtypes.h
- port128.h

Procyon-AVRlib is hard to find these days, so if anybody needs these, just ask. (Or, hopefully we'll set up a site for this RoboBuilder-lib somewhere, and we'll include them in that.)

Now to figure out how to install the compiled code onto the RBC, preferably without having to boot into Windows to do it...

Cheers,
- Joe
All right, I (once again) posted too soon. It turns out that the 0.3 library just needs three header files from Procyon-AVRlib; the project compiled fine after copying in these:

- avrlibdefs.h
- avrlibtypes.h
- port128.h

Procyon-AVRlib is hard to find these days, so if anybody needs these, just ask. (Or, hopefully we'll set up a site for this RoboBuilder-lib somewhere, and we'll include them in that.)

Now to figure out how to install the compiled code onto the RBC, preferably without having to boot into Windows to do it...

Cheers,
- Joe
Joe offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 204
Joined: Tue Sep 05, 2006 1:00 am

Post by l3v3rz » Tue Feb 24, 2009 10:02 am

Post by l3v3rz
Tue Feb 24, 2009 10:02 am

Ok well spotted. I include those headers in the 0.2 zip, but didn't in the 0.3 zip. So sorry about that.

I should be posting the next version shortly, I nearly have a crude autobalance working and will post when done.
Ok well spotted. I include those headers in the 0.2 zip, but didn't in the 0.3 zip. So sorry about that.

I should be posting the next version shortly, I nearly have a crude autobalance working and will post when done.
l3v3rz offline
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by Joe » Tue Feb 24, 2009 4:24 pm

Post by Joe
Tue Feb 24, 2009 4:24 pm

Joe wrote:Now to figure out how to install the compiled code onto the RBC, preferably without having to boot into Windows to do it...


Well, nuts. I wrote to RoboBuilder and asked them to give me information about the bootloader protocol, or the source to their updater tool (which could serve as de facto documentation of the protocol). Their reply:

sunnykim@robobuilder.net wrote:1. What is the protocol between the RBC and the PC during a firmware
upgrade?

=> Sorry that we can not open this information at this point of time.

2. May I have the source code for the RBC Upgrade Tool?

=> Sorry that we can not open this information at this point of time, either.


I guess they must own Microsoft stock. :( It's very frustrating — everything else can be done on a Unix or Linux box, if you're writing your own code in C, but the actual uploading of the file requires Windows. That is, until somebody reverse-engineers the protocol — but it'd be much safer if they just told us what it is.

Very disappointed,
— Joe
Joe wrote:Now to figure out how to install the compiled code onto the RBC, preferably without having to boot into Windows to do it...


Well, nuts. I wrote to RoboBuilder and asked them to give me information about the bootloader protocol, or the source to their updater tool (which could serve as de facto documentation of the protocol). Their reply:

sunnykim@robobuilder.net wrote:1. What is the protocol between the RBC and the PC during a firmware
upgrade?

=> Sorry that we can not open this information at this point of time.

2. May I have the source code for the RBC Upgrade Tool?

=> Sorry that we can not open this information at this point of time, either.


I guess they must own Microsoft stock. :( It's very frustrating — everything else can be done on a Unix or Linux box, if you're writing your own code in C, but the actual uploading of the file requires Windows. That is, until somebody reverse-engineers the protocol — but it'd be much safer if they just told us what it is.

Very disappointed,
— Joe
Joe offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 204
Joined: Tue Sep 05, 2006 1:00 am

Post by Joe » Tue Feb 24, 2009 4:27 pm

Post by Joe
Tue Feb 24, 2009 4:27 pm

Joe wrote:I guess they must own Microsoft stock. :( It's very frustrating — everything else can be done on a Unix or Linux box, if you're writing your own code in C, but the actual uploading of the file requires Windows. That is, until somebody reverse-engineers the protocol — but it'd be much safer if they just told us what it is.

Wow, I don't know how I failed to find this before (I really did search before posting!), but someone at Trossen just pointed out this thread, which seems to have the answer I was thinking of.

I'll post any follow-ups related to the bootloader protocol there.

Cheers,
- Joe
Joe wrote:I guess they must own Microsoft stock. :( It's very frustrating — everything else can be done on a Unix or Linux box, if you're writing your own code in C, but the actual uploading of the file requires Windows. That is, until somebody reverse-engineers the protocol — but it'd be much safer if they just told us what it is.

Wow, I don't know how I failed to find this before (I really did search before posting!), but someone at Trossen just pointed out this thread, which seems to have the answer I was thinking of.

I'll post any follow-ups related to the bootloader protocol there.

Cheers,
- Joe
Joe offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 204
Joined: Tue Sep 05, 2006 1:00 am

Post by PedroR » Tue Feb 24, 2009 6:53 pm

Post by PedroR
Tue Feb 24, 2009 6:53 pm

Hi Joe

Indeed Sunny is being very reserved about releasing further technical details.

I myself have asked him for some information to build the wCK protocol DLL and the Remocon DLL implementations and many of my emails were left unanswered.

I believe they are being fairly successful in Korea with their product and they are not paying so much attention to us hobbyist pioneers :(

They did release a lot of information about the product though.
For some reason they are only being reserved about the C code/protocol on the RBC itself (for example the wCK protocol is fully documented).

I am confident they will release it in the future though.
Hi Joe

Indeed Sunny is being very reserved about releasing further technical details.

I myself have asked him for some information to build the wCK protocol DLL and the Remocon DLL implementations and many of my emails were left unanswered.

I believe they are being fairly successful in Korea with their product and they are not paying so much attention to us hobbyist pioneers :(

They did release a lot of information about the product though.
For some reason they are only being reserved about the C code/protocol on the RBC itself (for example the wCK protocol is fully documented).

I am confident they will release it in the future though.
PedroR offline
Savvy Roboteer
Savvy Roboteer
Posts: 1199
Joined: Mon Jun 16, 2008 11:07 pm

PreviousNext
PreviousNext
57 postsPage 2 of 41, 2, 3, 4
57 postsPage 2 of 41, 2, 3, 4