2

Author Topic: New C library - testers required  (Read 47741 times)

0 Members and 1 Guest are viewing this topic.

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: New C library - testers required
« Reply #120 on: April 05, 2010, 04:46:37 PM »
Maybe I'm missing this, so if someone could enlighten me.

For my SAGAR rover, I was planing on having a 'mission file' of GPS waypoints that I externally create and upload into the Axon's EEPROM. Then, as a start-up routine, my Axon code would start parsing the mission file. I would start copying into a string the contents of the EEPROM incrementally until a '\n' was found, token-ize the string and parse the tokens to GPS coordinates. Once SAGAR achieved the waypoint, it would repeat the parsing of the EEPROM mission file to pull out the next waypoint.

There doesn't seem to be a generic function just to read out a byte of EEPROM at a specified address.

For example, a

while (temp_byte = EEPROMReadByte(address++), temp_byte!='\n')
       temp_string[inx++] = temp_byte;

The 'eeprom_read_block ( )' won't work because i'm not treating my eeprom like system memory with compiler created variables, i'm treating it as a storage device with a text file created by another process.

I guess a hack would be to create a dummy 'char EEMEM eepromString[10];' variable and hope webbotlib and the compiler puts it's address at the beginning of my eeprom where i plan on starting my txt 'mission file', but it still seems there should be a generic EEPROMReadByte(address) function in webbotlib.

EDIT:

Nevermind, I'm crazy. I just re-read the Webbotlibc manual, and realized those are not webbotlibc functions, and that eeprom_read_byte() is what i need, i just need to figure out the memory address of the first byte of eeprom memory, or is it just eeprom_read_byte(1)? Hmm, either way, this is a useless post, and can be deleted. Sorry Guys.

« Last Edit: April 05, 2010, 05:03:15 PM by madsci1016 »

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: New C library - testers required
« Reply #121 on: April 05, 2010, 05:27:22 PM »
Good to see you've answered your own question. (eeprom addressing starts at 0 not 1).

Don't know how big your waypoint files are but if they are big then note the SD card + FAT disk support now in WebbotLib.

This lets you open/create/append to a file and use rprintf to write to it and a 'reader' to read from it. I use a 4Gb SD card.

Advantage is that if you spend a couple of bucks on a USB stick that you can slide the SD card into then you can plug whole thing into your PC as if it were a hard drive - and hence read/write the files from both your PC and/or the robot.

Of course if your robot writes the files in the correct format then your PC could also use Google maps to plot your robots course on a satellite terrain map.

Or vice versa.


Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
Re: New C library - testers required
« Reply #122 on: April 05, 2010, 09:23:33 PM »
Quote
Of course if your robot writes the files in the correct format then your PC could also use Google maps to plot your robots course on a satellite terrain map.

This would make a nice tutorial... Any takers? Webbot is too busy to do it, so... who can?
Check out the uBotino robot controller!

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,657
  • Helpful? 169
    • Society of Robots
Re: New C library - testers required
« Reply #123 on: April 05, 2010, 09:49:40 PM »
Quote
Of course if your robot writes the files in the correct format then your PC could also use Google maps to plot your robots course on a satellite terrain map.


This would make a nice tutorial... Any takers? Webbot is too busy to do it, so... who can?

cough cough . . .

http://www.google.com/search?q=how+to+plot+a+list+of+gps+coordinates+in+google+maps

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
Re: New C library - testers required
« Reply #124 on: April 06, 2010, 05:15:01 AM »
Looks like research to write the tutorial...
Check out the uBotino robot controller!

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: New C library - testers required
« Reply #125 on: April 06, 2010, 06:15:08 AM »
Alright, alright, I wasn't going to post again, but since i now have accomplices in this thread-jacking,

My mission file is small enough to fit in the 4k of eeprom. I though about SD cards and would eventually like to add one for mission logging, but i'm not that far yet. I'm aware of the ability to plot waypoints in Google earth, and after I get SAGAR running missions properly and logging them, I'm going to work on that. Right now since my operator software is written in Labview, there's a way to plot the robots position and course real-time on google earth.

And maybe when all is said and done, I'll right a few tutorials on GPS and plotting on google earth.

/thread-jacking

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: New C library - testers required
« Reply #126 on: April 12, 2010, 05:28:40 PM »
Here's a problem I've been running into but keep forgetting to post about.

The one and only WebbotLib error I have ever gotten, is error 11, but i get it a lot. Even with gigantic Uart buffers (300+ bytes) I will still get the error.

What I think is going on, is my Uart devices are all on the same power rail as the Axon itself.

If the Axon finishes loading before my (let's say for example) my GPS, then it's ready to receive data, but my GPS's controller may not have initialized it's UART pins and there are still in a high impedance state. The resulting floating pins on the Axon think they are getting a bunch of bytes at full speed.

If i reset the Axon without power-cycling my robot, I get no error. It's only when all my devices and Axon come on together do i get the buffer overflow error.

I can fix it completely by putting a delay_ms(1000); before initHardware();. I'm posting all this in case anyone else runs into this problem, or Webbot, in case you want to add a small delay to you lib for the noobs.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,930
  • Helpful? 98
Re: New C library - testers required
« Reply #127 on: April 12, 2010, 07:19:59 PM »
Quote
not have initialized it's UART pins and there are still in a high impedance state

When I design embedded systems I try to anticipate this kind of condition and put weak pull-ups or pull-down (set in inactive state) on those lines that may be un-driven during power-up and initialization.

I did have a case several years ago where a CPLD during initialization had hiZ pins. But some of these pins were active low bus driver enables. So for a short period during power up four different bus driver chips were trying the drive signals onto the same buss. We found this because sometime the power supply would not come on (it really was shutting down ) and by measuring the power supply current on a scope we saw a large current spike while the CPLD was loading code.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,657
  • Helpful? 169
    • Society of Robots
Re: New C library - testers required
« Reply #128 on: April 12, 2010, 08:35:32 PM »
Quote
I can fix it completely by putting a delay_ms(1000); before initHardware();. I'm posting all this in case anyone else runs into this problem, or Webbot, in case you want to add a small delay to you lib for the noobs.
With many of the sensors, WebbotLib adds in a startup delay for reasons such as this. The GPS manual should point out a specific delay period. Just send Webbot the info he needs, its a quick fix in the code.

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: New C library - testers required
« Reply #129 on: April 13, 2010, 07:48:16 PM »
Some of you may have used my Project Designer - see http://webbot.org.uk/iPoint/37.page
Others may not. Some of this may be because your board isn't supported or you have a home made board.

So I can now announce that the Board Designer is available http://webbot.org.uk/iPoint/36.page - allowing you to create board designs for your own board or for currently unsupported commercial boards.

These board designs can then be shared with others, published over the web, and then used within Project Designer.

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: New C library - testers required
« Reply #130 on: May 12, 2010, 11:36:47 AM »
Version 1.18 has been released

See http://webbot.org.uk/iPoint/35.page  for details.

Main changes are:
  • Support for Sony PS2 controllers - v. cheap and with about 16 buttons and two analogue joysticks
  • Write your own processor code to talk to my Gait Designer
  • Support for some additional micro controllers

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Cristi_Neagu

  • Robot Overlord
  • ****
  • Posts: 165
  • Helpful? 5
Re: New C library - testers required
« Reply #131 on: May 12, 2010, 02:29:25 PM »
This library is getting close to being an operating system for AVR chips ;D Great stuff!

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: New C library - testers required
« Reply #132 on: May 12, 2010, 04:53:19 PM »
Webbot, What version of the build do you consider stable for mission critical applications? The latest release, or something earlier?

I may be using the lib and an Axon for something at work.

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: New C library - testers required
« Reply #133 on: May 12, 2010, 07:34:26 PM »
Webbot, What version of the build do you consider stable for mission critical applications? The latest release, or something earlier?

I may be using the lib and an Axon for something at work.

What an excellent question! But one without a simple answer as it depends on the sub-systems you are using.

For example: the 'timer' code, and other core code, hasn't changed for a good while, whereas some features like Sony PS2 controllers are only available in the latest release.
The addition of new processors has zero effect on others - as they each have their own library build.

Some releases, like 1.18, have certain 'fixes' that touch the code but only to make it more robust - ie 1.18 behaves better if you try to flush a UART receive buffer when it doesn't actually have one. But these changes just tend to report errors for 'bad code' but have no effect on 'already working' code.

Equally 1.18 has 'improved code' to parse the GPS messages to give less rounding errors - note this is a completely different subject to your own thread regarding rounding errors in your own code! The old code worked fine but is now marginally better.

I will only ever fix issues in the current branch - so I guess the easy answer is therefore 'the current release'. As of 1.18 there are no known issues remaining.

But if you are producing a truly mission critical system then let me know (PM me maybe) what parts of the lib you are using and I can then analyze when they were last changed and why and let you know what version I recommend. This is not an open invite to everyone!!

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: New C library - testers required
« Reply #134 on: May 12, 2010, 10:17:39 PM »
But if you are producing a truly mission critical system then let me know (PM me maybe) what parts of the lib you are using and I can then analyze when they were last changed and why and let you know what version I recommend. This is not an open invite to everyone!!

Understood. Sorry if this gets you spammed by a few people. I debated asking you by PM, but figured others might want the insight as well.

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: New C library - testers required
« Reply #135 on: May 15, 2010, 01:50:29 PM »
Anyone out there using the existing Devantech CMPS03 compass code?

I'm wanting to change this so that it uses I2C rather than the current pulse timing code. Should be more accurate but will mean changing your hardware setup.

If anyone feels strongly about retaining the existing code then PM me.

Webbot

PS And 'no worries' - I own one of these so I at least have something to test with!!
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,657
  • Helpful? 169
    • Society of Robots
Re: New C library - testers required
« Reply #136 on: May 17, 2010, 09:14:38 PM »
Any reason to not have both?

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: New C library - testers required
« Reply #137 on: May 18, 2010, 06:42:43 AM »
Have actually changed it do both but just thought maybe the I2C option was more elegant - so both it is!
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline teoxan

  • Full Member
  • ***
  • Posts: 49
  • Helpful? 2
Re: New C library - testers required
« Reply #138 on: May 18, 2010, 07:59:35 AM »

I have a CMPS03 somewhere here, but not tested it with AXON. It's on a small robot I used with the Brainstem micro.

Theo

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: New C library - testers required
« Reply #139 on: May 18, 2010, 08:45:37 PM »
WebbotLib Version 1.19 has been released with the following:-

    * Devantech SRF02 and SRF08 sonar
    * Devantech SD21 Servo Controller (up to 21 servos)
    * Devantech CMPS03 now also supports I2C interface
    * Devantech CMPS09 compass with pitch and roll
    * The I2C code now has some more friendly code for reading/writing registers on a slave device
    * All other code remains untouched

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline teoxan

  • Full Member
  • ***
  • Posts: 49
  • Helpful? 2
Re: New C library - testers required
« Reply #140 on: May 18, 2010, 11:08:24 PM »

Great job, Webbot

I can't seem to find the SD21 support.
Can you please let me know about it?

thanks!



Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: New C library - testers required
« Reply #141 on: May 19, 2010, 10:07:59 AM »
I can't seem to find the SD21 support.
Can you please let me know about it?


Ooops my bad - thought I'd added it to the docs when I hadn't.

Rather than making a new release I've updated the online docs for now (but it will also be in the PDF for the next release).
You can find it in the online docs here http://webbot.org.uk/WebbotLibDocs/object.jsp?id=39821
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: New C library - testers required
« Reply #142 on: May 27, 2010, 05:58:52 PM »
A new version of Project Designer has been released (and it will auto-install the next time you run it).

This release has a File | Print option for saved projects which generates a PDF of your project. Note that you will need to have Adobe Reader installed and this is freely available from Adobe. (but you probably already have it so that you can read the PDF manual!).

 
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: New C library - testers required
« Reply #143 on: June 07, 2010, 06:08:22 PM »
Version 1.20 released

See http://webbot.org.uk/iPoint/35.page

My robot talks!!!
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
Re: New C library - testers required
« Reply #144 on: June 07, 2010, 07:12:05 PM »
Cool!!! Now you need to add support for VRbot module! So the robot can listen to your voice commands!!!
Check out the uBotino robot controller!

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,657
  • Helpful? 169
    • Society of Robots
Re: New C library - testers required
« Reply #145 on: June 07, 2010, 07:16:39 PM »
Cool!!! Now you need to add support for VRbot module! So the robot can listen to your voice commands!!!

I was looking at that module too, actually. I emailed the maker of it a few days ago, but no reply yet . . .

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
Re: New C library - testers required
« Reply #146 on: June 07, 2010, 08:51:25 PM »
You can buy it from several sources. My MiniEric robot uses it successfully. The nice part is that you can train it in any language. I wish we could do the same with speech synthesis...
« Last Edit: June 07, 2010, 09:00:18 PM by Ro-Bot-X »
Check out the uBotino robot controller!

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: New C library - testers required
« Reply #147 on: June 13, 2010, 07:22:30 PM »
I have a function suggestion/request.

A function that returns the number of bytes in the uart RX buffer. When defining binary communications, it's useful to know how much data the lib's buffer is holding, to see whether or not there is a full set of data waiting to be dealt with. Right now i have to define my own second buffer, dump whatever data is in the uart buffer every pass, then decide if i got everything or not. Arduino's have one, and i find it very useful, plus it saves memory not having to have two 'buffers'.

Offline WebbotTopic starter

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: New C library - testers required
« Reply #148 on: June 13, 2010, 07:36:59 PM »
ok I have added that.

But if your screaming for it now then just use this:-

Code: [Select]
static __linline__ size_t bufferBytesUsed(const cBuffer* buffer){
size_t rtn;
CRITICAL_SECTION_START;
rtn =  buffer->datalength;
CRITICAL_SECTION_END;
return rtn;
}

The number of bytes 'used' in the buffer is already held in the 'datalength' member. The CRITICAL_SECTION commands just wrap it to make sure that interrupts dont cause any side effects when reading the two byte number as it transitions the single byte boundary.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: New C library - testers required
« Reply #149 on: June 13, 2010, 07:41:58 PM »
Sweet, thank you. I knew it would be something simple.

No rush, what i have works now, but next time i over-haul SAGAR's code(next lib release most likely), i'll add it in.

 


Get Your Ad Here

data_list