Author Topic: Kangaroo x2 Motion Controller  (Read 628 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 »
Hello,
we are the Robu.in 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.)
         https://robu.in/product/kangaroo-x2-motion-controller/



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

https://robu.in/

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 serial.tools.list_ports 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
        saber.text('m1:startup')
        saber.text('1,p100')
        saber.text('md:1000\r\n')
   
        saber.text('m2:startup')
        saber.text('r1:1940\r\n')
        saber.text('r2:1940\r\n')
        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)
        #saber.text('m1:startup')
        #saber.drive(1,speed)
        #saber.drive(2,speed)
        if angle+speed > 100:
            speed1 = 100
        else :
            speed1 = angle+ speed
        if speed-angle < -100:
            speed2 = -100
        else :
            speed2 = speed-angle
        saber.drive(1,speed)
        saber.drive(2,speed)
       

        if(angle < 0):
            print "negative"
            saber.drive(1,speed2)
            saber.drive(2,speed1)
        elif (angle > 0):
            print "positive"
            saber.drive(1,speed2)
            saber.drive(2,speed1)
   

        #saber.text('m2:startup')
        #MD: 0\r\n
        print SPEED
        print ANGLE
   
        #saber.text(SPEED)

        pass
        #print message

    def sabertoothStatusCallback(data):
        print data
        temperature = ('T [C]: {}'.format(saber.textGet('m2:gett')))
   
        saber.textGet('T,start')
        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)
        #sabertoothStatusCallback("as")
        #rospy.Subscriber("/mastercmd_vel", Twist, callback)
        # spin() simply keeps python from exiting until this node is stopped
        rospy.spin()

    if __name__ == '__main__':
        listener()





https://github.com/smd-ros-devel/kangaroo_x2_driver
This is a good start in the ROSification of kangaroo x2 .


https://github.com/hbrobotics/ros_arduino_bridge
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 )


https://github.com/LillyCorp/sabertooth_2x32_kangaroo_x2_ros
(Link to the repository for ROS + Sabertooth + kangaroo x2)