go_away

Author Topic: Question about webbotlib using sabertooth 2x5 via simple serial  (Read 1141 times)

0 Members and 1 Guest are viewing this topic.

Offline GrooveHolmesTopic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Quote
SABERTOOTH_MOTOR motor1 = MAKE_SABERTOOTH_MOTOR(FALSE, 128,1);

If simple serial doesn't use addressing like packetized serial, why are we assigning and address of 128? And where is this value coming from?

The difference between the student and the master, is that the master knows what he does not know.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,150
  • Helpful? 109
Re: Question about webbotlib using sabertooth 2x5 via simple serial
« Reply #1 on: May 06, 2010, 08:57:51 AM »
Quote
SABERTOOTH_MOTOR motor1 = MAKE_SABERTOOTH_MOTOR(FALSE, 128,1);

If simple serial doesn't use addressing like packetized serial, why are we assigning and address of 128? And where is this value coming from?



There is only one MAKE_SABERTOOTH_MOTOR command and you need to MAKE the motors before you MAKE the driver using MAKE_SABERTOOTH_DRIVER.

Its only the driver that knows whether you are using simple or packetized modes. So its best to make the motors as if they were going to be used in packetized mode. Hence each motor should have a unique combination of address and motor number.

That way you can switch between simple and packetized modes by just flipping one parameter in the MAKE_SABERTOOTH_DRIVER command. When using simple mode the address is ignored. I decided that was the most flexible way to do it. Otherwise I would need two versions of MAKE_SABERTOOTH_MOTOR - one for simple and one for packetized, and the same again for MAKE_SABERTOOTH_DRIVER.

Where does the 128 come from? It can be any of: 128,129,130,131,132,133,134 or 135.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

 


Get Your Ad Here

data_list