2

Author Topic: webbotlib error axon 2  (Read 970 times)

0 Members and 1 Guest are viewing this topic.

Offline DothosTopic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
webbotlib error axon 2
« on: December 23, 2011, 05:44:15 PM »
Hi,

I stoped programming for some months and I now started again but first I updated webbotlib first. And all the programs I have for my robot compile alright but they all give a webbotlib error in the axon. After some time I narrowed the problem down to the servo code the rest is working fine.

Is there anything new is the last version of the lib that makes me to have to change my code? Is there any doc with the errors of webbotlib? I get error 12. Something with the timers?

I'm sorry for the noob questions but I searched everywhere and cant find  the problem. And in the trying to debug I recompiled the programs with the new lib and now none of them works...  :P

thanks in advance

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 109
Re: webbotlib error axon 2
« Reply #1 on: December 24, 2011, 06:39:46 AM »
The errors are listed in 'errors.h' that is part of WebbotLib.
Error 12 means 'PWM_PIN_NOT_AVAILABLE'.
This means that you are trying to generate hardware PWM on a pin that is not a valid hardware (timer) PWM pin.

If you use Project Designer then it will show you these sorts of errors in the GUI.

Don't forget - if you move to a new version of WebbotLib its always a good idea to do a 'clean' and then rebuild the whole project. It gets rid of any stuff that may be left lying around from the previous version.
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 DothosTopic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
Re: webbotlib error axon 2
« Reply #2 on: December 25, 2011, 07:56:16 AM »
Thanks a lot for answering so fast. But all the code I have using servos doesn't work anymore, with or without PWM... And the code is very simple. With this code the axon appears to freeze and the display flickers. It all used to work fine can you tell me what is wrong please? I think it reset before even sending the printf and if I use the PWM it reset after sending it. I ruled out any hardware problem by changing the power supply and disconnecting the servos. Thanks  ;)

#include "sys/axon2.h"
#include "rprintf.h"
#include "hardware.h"
#include "servos.h"
#include "pwm.h"

SERVO servo0 = MAKE_SERVO(FALSE, E3,1000, 500);
SERVO servo1 = MAKE_SERVO(FALSE, E4,1000, 500);
SERVO servo2 = MAKE_SERVO(FALSE, E5,1000, 500);

SERVO_LIST servos[] = {&servo0,&servo1,&servo2};

SERVO_DRIVER bank1 = MAKE_SERVO_DRIVER(servos);

void appInitHardware(void){

   servosInit(&bank1, TIMER1);
//   servoPWMInit(&bank1);
   
   uartInit(USB_UART, USB_BAUD);
   rprintfInit(USB_ACTIVATE);
}
TICK_COUNT appInitSoftware(TICK_COUNT loopStart){

   rprintf("\nAxon initiated.\n\n");
   servosSetConnected(&bank1,TRUE);
   return 0;
}
TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart){
   
   statusLED_off();
   servosCenter(servos, USB_UART);
   statusLED_on();
   return 2000;
}
« Last Edit: December 25, 2011, 07:59:12 AM by Dothos »

Offline DothosTopic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
Re: webbotlib error axon 2
« Reply #3 on: December 25, 2011, 01:23:28 PM »
Forget about it. I learned how to use the project designer. I didn't want to because I fear I'll get lazy and this way I don't need to understand almost anything about the implementations which can make me a bigger noob :p

Anyway I don't care what changed, I'll just take the time to adapt the code to work with the auto generated code from PD.

It's an amazing tool and saves a lot of time. Thank you very much.  ;)

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: webbotlib error axon 2
« Reply #4 on: December 26, 2011, 01:56:57 AM »
Forget about it. I learned how to use the project designer. I didn't want to because I fear I'll get lazy and this way I don't need to understand almost anything about the implementations which can make me a bigger noob :p
Yea, I sometimes feel like that too. But in return, it gives you much more free time to learn and do more advanced things with your robot.

ie, instead of spending 10 hours getting PWM to work, you can spend 10 hours getting your robot to do intelligent mapping of it's surroundings. You learn an equal amount each way, but the latter is more productive. :P

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 109
Re: webbotlib error axon 2
« Reply #5 on: December 26, 2011, 11:50:26 AM »
Your problem may have been caused by a change in V1.32. Look in version.h. A lot of the list are now put in program memory rather than RAM. ie you should have:
Code: [Select]
SERVO_LIST PROGMEM servos[] = {&servo0,&servo1,&servo2};
Anyway - glad you are enjoying PD
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 DothosTopic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
Re: webbotlib error axon 2
« Reply #6 on: December 29, 2011, 09:23:53 AM »
I don't care anymore. You already destroyed the little will I had to deal with the low level stuff :p

But I'm with admin, now it's easier and faster to get everything to work properly and focus on our code. Thank you for taking the time to deal with it so we don't have too.

 


Get Your Ad Here

data_list