Author Topic: Kangaroo x2 Motion Controller  (Read 170 times)

0 Members and 1 Guest are viewing this topic.

Offline Rakesh_At_Robu

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
Kangaroo x2 Motion Controller
« on: November 21, 2017, 12:00:35 PM »
we are the team, providing you the latest robotics technologies at affordable costs. Buy now,

Kangaroo x2 motion controller                       SKU-15839                   ₹ 1,879.00 /-
(Kangaroo x2 adds self-tuning feedback motion control to your Sabertooth or SyRen motor driver. It can be used with quadrature encoders or potentiometers to provide position or speed control. It supports one or two feedback channels.)

List of Sabertooth and SyRen Motor Drivers with which Kangaroo can give you the better results,
        Sabertooth 2x10                     
        Sabertooth 2x12
        Sabertooth 2x25
        Sabertooth 2x32
        Sabertooth 2x25 V2
        Sabertooth 2x50HV
        Sabertooth 2x60

        SyRen 10
        SyRen 25     
        SyRen 50

For more information about Kangaroo Controller,

All this equipments are available at our website

Offline chrissunny94

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
Re: Kangaroo x2 Motion Controller
« Reply #1 on: January 12, 2018, 11:09:25 AM »
Hey , I need help with setting up Kangaroo .

We are using Kangaroo for ROS (SLAM enabled Robots) , Kangaroo is supposed to help us with the Localization .

I want some instructions on how to use this .

I have successfully used sabertooth 2x32 vai USB cable . The code is listed below ,sabertooth dip switch configuration is (On off on on on on 1-6).

USB cable connected directly (No ttl cable or Arduino in between).

Using the below script one can control a differential drive bot which uses sabertooth 2x32.

I have been hunting for information regarding the use of kangaroo x2 along with sabertooth , i promise to make a good tutorial for the same as i am finding not much material is available related to this .

Kangaroo can handle PID based position/speed control . Kangaroo can also supposedly give back the encoder data (yet to figure out all of that ).

Please see if you could give me some insights on how to use ROS with the above configuration.
    #!/usr/bin/env python
    #import arduinoserial
    from pysabertooth import Sabertooth
    from std_msgs.msg import String
    from geometry_msgs.msg import Twist, Pose
    import rospy , time
    import as port
    #import pylcdlib
    print "\nInit sabertooth....\n"

    print "\nDetecting sabertooth....\n"
    portlist = list(port.comports())
    print portlist
    address = ''
    for p in portlist:
      print p
      if 'Sabertooth' in str(p):
          address = str(p).split(" ")
    print "\nAddress found @"
    print address[0]
    speed1 = 0
    speed2 = 0

    saber = Sabertooth(address[0], baudrate=9600, address=128, timeout=0.1)

    def translate(value, leftMin, leftMax, rightMin, rightMax):
       # Figure out how 'wide' each range is
       leftSpan = leftMax - leftMin
       rightSpan = rightMax - rightMin

       # Convert the left range into a 0-1 range (float)
       valueScaled = float(value - leftMin) / float(leftSpan)

       # Convert the 0-1 range into a value in the right range.
       return rightMin + (valueScaled * rightSpan)

    def callback(data):
        #print data
        speed = translate(data.linear.x,-1,1,-100,100)
        #speed = translate(data.linear.x,-1,1,-2047,2047)
        SPEED = 'md: {}\r\n'.format(speed)
        angle = translate(-data.angular.z,-1,1,100,-100)
        #angle = str(translate(-data.angular.z,-1,1,2047,-2047))
        ANGLE = 'mt: {}\r\n'.format(angle)
        if angle+speed > 100:
            speed1 = 100
        else :
            speed1 = angle+ speed
        if speed-angle < -100:
            speed2 = -100
        else :
            speed2 = speed-angle,speed),speed)

        if(angle < 0):
            print "negative"
        elif (angle > 0):
            print "positive"

        #MD: 0\r\n
        print SPEED
        print ANGLE

        #print message

    def sabertoothStatusCallback(data):
        print data
        temperature = ('T [C]: {}'.format(saber.textGet('m2:gett')))
        set_position = ('P : {}'.format(saber.textGet('T,p45')))
        battery = ('battery [mV]: {}'.format(saber.textGet('m2:getb')))
        print battery , temperature
        #lcd.lcd_write(0x0C) #Cursor uitschakelen.
        #lcd.lcd_write(0x01) #Scherm leegmaken.
        #lcd.lcd_puts("Hallo", 1) #Tekst voor LCD display lijn 1.
        #lcd.lcd_puts("  Wereld!", 2) #Tekst voor LCD display lijn 2.
        #lcd.lcd_backlight(1) #Achterverlichting aanzetten.

    def listener():
        # In ROS, nodes are uniquely named. If two nodes with the same
        # node are launched, the previous one is kicked off. The
        # anonymous=True flag means that rospy will choose a unique
        # name for our 'listener' node so that multiple listeners can
        # run simultaneously.
        rospy.init_node('listener', anonymous=True)

        #rospy.Subscriber("/joy_teleop/cmd_vel", Twist, callback)
        rospy.Subscriber("/cmd_vel", Twist, callback)
        #rospy.Subscriber("/mastercmd_vel", Twist, callback)
        # spin() simply keeps python from exiting until this node is stopped

    if __name__ == '__main__':
This is a good start in the ROSification of kangaroo x2 .
This is a full stack implementation of odometry packages on Arduino .
(I am seeking for something like this for the Kangaroo+sabertooth/Syren configuration )

(Link to the video of the robot i am working on )
(Link to the repository for ROS + Sabertooth + kangaroo x2)