Ask Your Question
0

ROS + kangaroo x2 + sabertooth 2x32

asked 2018-01-09 01:17:56 -0600

Please share some insights on the implementation of the same .

https://github.com/smd-ros-devel/kang... , i am trying to use this .

I tried to go through the raised issues on Github , but all of them were in complete .

I hope to find someone who has had experience in the above hardware configuration .

I have put the sabertooth in USB serial mode (on off on on off on 1-6) , kangaroo ,(0ff on on on 4-1). I then connected s2-a1 s1-a2 ,

https://pypi.python.org/pypi/sabertoo... , i am using this to talk to the sabertooth vai USB port (baud 9600 , port 128)

I can control sabertooth vai ROS , but i am not able to get the kangaroo to talk to sabertooth .

Please help , i have been skimming the Internet to find help , most are incomplete articles .

Sabertooth + Kangaroo x2 is a great combination , dimensional engineering also doesnt have much tutorials for the same .(often their original manual seem to be very confusing )

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-01-23 22:00:07 -0600

updated 2018-01-23 22:15:07 -0600

Connect an Arduino as per the code

// Mixed Mode Sample for Kangaroo
// Copyright (c) 2013 Dimension Engineering LLC
// See license.txt for license details.

#include <SoftwareSerial.h>
#include <Kangaroo.h>

// Arduino TX (pin 11) goes to Kangaroo S1
// Arduino RX (pin 10) goes to Kangaroo S2
// Arduino GND         goes to Kangaroo 0V
 // Arduino 5V          goes to Kangaroo 5V (OPTIONAL, if you want Kangaroo to power the Arduino)
 #define TX_PIN 2 //s1
 #define RX_PIN 3 //s2

 // Mixed mode channels on Kangaroo are, by default, 'D' and 'T'.
 SoftwareSerial  SerialPort(RX_PIN, TX_PIN);
 KangarooSerial  K(SerialPort);
 KangarooChannel Drive(K, 'D');
 KangarooChannel Turn(K, 'T');

 void setup()
 {
  SerialPort.begin(9600);
  SerialPort.listen();
  Serial.begin(9600);

  Drive.start();
  Turn.start();

  Drive.si(0);
  Turn.si(0);
  Serial.println("Started...");
  SerialPort.println("D, units 100 thou = 256 lines");
  SerialPort.println("T, units 100 thou = 256 lines");

  }

  void loop()
  {
   //  Drive 500 ticks (relative to where we are right now), then wait 1 second.
   //Drive.pi(500).wait();
   //delay(1000);

   // Turn 500 ticks (relative to where we are right now), then wait 1 second.
    //Turn.pi(500).wait();  
   //delay(1000);
   if (SerialPort.available()) {
    Serial.write(SerialPort.read());

     }
   if (Serial.available()) {
     SerialPort.write(Serial.read());
    } 
  }

This is the Python Script which will talk to the Arduino

  from time import sleep
  import serial
  ser = serial.Serial('/dev/ttyUSB1', 9600) # Establish the connection on a speci$
  counter = 32 # Below 32 everything in ASCII is gibberish
  ser.write("D,home")
  ser.write("T,home")
  while True:
     counter +=10
     ser.write("T,p"+str(counter)) # Convert the decimal number to ASCII then s$
     print ser.readline() # Read the newest output from the Arduino
     sleep(.1) # Delay for one tenth of a second
     if counter == 255:
        counter = 32
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2018-01-09 01:17:56 -0600

Seen: 489 times

Last updated: Jan 23 '18