go_away

Author Topic: Webbot lib with omnibots  (Read 1603 times)

0 Members and 1 Guest are viewing this topic.

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
Webbot lib with omnibots
« on: February 13, 2010, 10:00:07 AM »
hey form-ers of SoR, got a question on webbot's library.
I am planning on using  webbot lib for my soon to be omni bot with an Axon II
now for an omnibot, full forward, full backwards, and stop will not work. I need
to be able to have direct control over the servos speed. I was looking through the documentation on webbot lib and didn't find anything like what I am talking about. am I just not seeing it or is that functionality not in webbot lib?
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Webbot lib with omnibots
« Reply #1 on: February 13, 2010, 10:53:12 AM »
hi Dellagd
this is an issue with servos rather than a software thing.
different servos implement speed in different ways.

before you modify a servo you tell a servo the position you want it to move to and the best servos go there at full speed.

that's *not* to say the best servos make the best continuous rotation servos once you modify them though.
in fact the opposite can be true.

so some servos will only have 2 accurate speeds: full speed and stop. these are typically the more expensive ones.
others will have a some in between states but you'll need to play your self to calibrate the speed.

sorry to be so vague.
maybe someone on here knows a good model of servo thats speed scales nicely?


dunk.

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
Re: Webbot lib with omnibots
« Reply #2 on: February 13, 2010, 11:11:59 AM »
thats not what I asked
I was wondering how to put servos to a specific position using webbot lib (or in continuous rotation a certain speed)
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Webbot lib with omnibots
« Reply #3 on: February 13, 2010, 11:52:25 AM »
yea, after re-reading your post i suppose it wasn't. (it will still be an issue though.)

if you have a look in the WebbotLib-1-XX.pdf in the WebbotLib zip file there is a good example on how to do this on a simple photovore robot.

dunk.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: Webbot lib with omnibots
« Reply #4 on: February 13, 2010, 12:47:41 PM »
thats not what I asked
I was wondering how to put servos to a specific position using webbot lib (or in continuous rotation a certain speed)

Continuous rotation servos are treated like DC motors (in WebbotLib).
So all of the commands from 'actuators.h' apply. So you can set the speed, read the last issued speed command, disconnect them etc etc. As dunk says this the photovore example shows some of these commands.

If the servos are un-modified then the same 'act_Speed' call is used - but where min speed is the full counter-clockwise position (same as as 'full speed reverse' for a modified servo) and max speed is the full clockwise rotation (same as 'full speed ahead' for a modified servo).

If you are using Project Designer and you bring in a servo then the examples.txt file will contain some example code. If the servo is modifed then this will vary the servo between full reverse and full ahead (and speeds in-between). For an unmodified servo you will see the servo swing between it min and max positions.



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: Webbot lib with omnibots
« Reply #5 on: February 13, 2010, 10:38:08 PM »
In my photovore example code, you'll see:

Code: [Select]
act_setSpeed(&left_wheel,DRIVE_SPEED_MIN);
act_setSpeed(&right_wheel,DRIVE_SPEED_MAX);

With an omni-wheel bot, you end up doing fractions of full speed, calculated using trig. Sooo . . .

Code: [Select]
float fractionA;
float fractionB;

calculate_fractions();

act_setSpeed(&left_wheel,DRIVE_SPEED_MAX*fractionA);
act_setSpeed(&right_wheel,DRIVE_SPEED_MAX*fractionB);


edit: fixed it to be floats - dumb mistake!
« Last Edit: February 13, 2010, 10:58:03 PM by Admin »

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: Webbot lib with omnibots
« Reply #6 on: February 13, 2010, 10:51:48 PM »
Well you probably need 'fractionA' and 'fractionB' to be floating point numbers eg 'double' or 'float'. Otherwise your 'setSpeed' calls will only be 0, DRIVE_SPEED_MAX or -DRIVE_SPEED_MAX (ie stop, full fwds, full reverse)

If they are floating point and hold any value between -1 and +1 then it would work.

There are other ways - which avoid use of floating point maths. The photovore example in the manual has an example.
.
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 dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
Re: Webbot lib with omnibots
« Reply #7 on: February 14, 2010, 09:56:24 AM »
for a second, just forget the whole trig calculations and such

if I want to set a continuous rotation servo to any speed I'll just toy around with the "0" after the "&right, " until I get what speed and direction I want? like how I see -127 is DRIVE_SPEED_MIN.

Code: [Select]
act_setSpeed(&right,0);
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
Re: Webbot lib with omnibots
« Reply #8 on: February 14, 2010, 01:20:10 PM »
if I want to set a continuous rotation servo to any speed I'll just toy around with the "0" after the "&right, " until I get what speed and direction I want?

Yup  :)

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
Re: Webbot lib with omnibots
« Reply #9 on: February 14, 2010, 02:21:48 PM »
ok thank you!
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

 


Get Your Ad Here