Society of Robots - Robot Forum

Software => Software => Topic started by: Robot_Longbordr on February 10, 2012, 10:21:39 PM

Title: webbotlib servo probs
Post by: Robot_Longbordr on February 10, 2012, 10:21:39 PM
Hey after reading over the ERP example code and reading through the servo part of the axon function list http://www.societyofrobots.com/axon/axon_function_list.shtml#programs (http://www.societyofrobots.com/axon/axon_function_list.shtml#programs) it would seem the servos are controlled through funcitions but the functions to control them are not elaborated on. when i try to build the code it gives the error message "servo is not a function" servo being the name of the servo im trying to control.

The project im using was auto built by the webbotlib project designer

Am i doing something wrong?
How would i go about using webbotlib to control a servo? and the microcontroller im using is the Axon 2
Title: Re: webbotlib servo probs
Post by: Robot_Longbordr on February 10, 2012, 11:09:44 PM
I don't think i elaborated enough, i meant is there a way to control servos so that they turn to a specific angle, like if i was to give it a value and it would turn to that corresponding value, instead of just changing the speed from zero to something else. It looks like the code for the ERP just passes to the servo a servo position.
Quote
//move arm into centered vertical position
      arm_right_base(620);
      arm_right_J1(750);
      arm_right_J2(350);
this is from the fetch.c file of the ERP code
Title: Re: webbotlib servo probs
Post by: Webbot on February 11, 2012, 09:10:38 PM
Admins ERP code doesn't use WebbotLib - it uses his own stuff from before WebbotLib was born.

Quote
How would i go about using webbotlib to control a servo?
When you generate the code for your project and it contains some servos then the example code will show an example of how to move each servo back and forwards. Look in 'example.txt' generated into your project directory.
Title: Re: webbotlib servo probs
Post by: Admin on February 24, 2012, 11:51:56 AM
Admins ERP code doesn't use WebbotLib - it uses his own stuff from before WebbotLib was born.
The most recent ERP version does . . . I think Robot_Longbordr is looking at an earlier version.

See this:
http://www.societyofrobots.com/downloads/ERP_code_020110.zip (http://www.societyofrobots.com/downloads/ERP_code_020110.zip)