Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Feeding Coordinates to Pincher Arm.

  1. Feeding Coordinates to Pincher Arm.

    Hi,
    I'm a beginner to arduino and arm programming, but have decent experience in c++, I currently have a project in c++ in visual studio that outputs (x,y,z) coords, right hand rule (openGL for reference). (I can write them to file if needs be).

    Ive added the arduino visual studio add on to VS, so I can program my board and my arm. But I can't find much info on moving the pincher head directly to a point in free space without assigning values to each servo.

    I'd basically like to set the base of the arm as (0,0,0), set an exclusion zone, and then be able to send the pincher head to any coordinate I send to the code, within the given range. Is this possible?

    I realise this is going to more complex than I'd like, but I think I've missed some documentation.

    Can anyone point in the direction of tutorials / an API reference that would get me going?

    Thanks

  2. #2

    Re: Feeding Coordinates to Pincher Arm.

    We have some firmware for the pincher that will allow you to send the Pincher Cartesian, cylindrical, or joint data. You can find info on the firmware and a demo application here
    http://learn.trossenrobotics.com/20-...-software.html
    I'd recommend running the demo app to get acquainted with the functionality.

    The program sends the coordinates via a serial packet. This article goes over the packet structure and other info
    http://learn.trossenrobotics.com/arb...reference.html
    You'll need to generate the correct serial pacets to get the arm to move to different positions. We have example packets here
    http://learn.trossenrobotics.com/20-...-examples.html

    You can find all of the documetnation links for the pincher here
    http://learn.trossenrobotics.com/38-...robot-arm.html

  3. #3

    Re: Feeding Coordinates to Pincher Arm.

    Kyles suggestions give you the actual software to do what you want.

    Separately, you may want to read up on "two-bone IK" which is a simple way of solving the question "I have two linked arms of length A and B; how can I get them to end up at point X,Y" in 2D, and then you add in a simple atan2() call to figure out which orientation to point the base servo. This is the math that goes behind the libraries Kyle links to.

  4. Re: Feeding Coordinates to Pincher Arm.

    Quote Originally Posted by kgranat View Post
    We have some firmware for the pincher that will allow you to send the Pincher Cartesian, cylindrical, or joint data. You can find info on the firmware and a demo application here
    http://learn.trossenrobotics.com/20-...-software.html
    I'd recommend running the demo app to get acquainted with the functionality.

    The program sends the coordinates via a serial packet. This article goes over the packet structure and other info
    http://learn.trossenrobotics.com/arb...reference.html
    You'll need to generate the correct serial pacets to get the arm to move to different positions. We have example packets here
    http://learn.trossenrobotics.com/20-...-examples.html

    You can find all of the documetnation links for the pincher here
    http://learn.trossenrobotics.com/38-...robot-arm.html
    Yes I actually downloaded the arm link software and was messing around with it, I realised after you posted though that I also have the code for the ArmLink so I think I can probably cut it up to what I need.

    Those second two links are great, I think thats what I was missing, those along with the armlink source should set me in the right direction thanks!

  5. Re: Feeding Coordinates to Pincher Arm.

    Quote Originally Posted by jwatte View Post
    Kyles suggestions give you the actual software to do what you want.

    Separately, you may want to read up on "two-bone IK" which is a simple way of solving the question "I have two linked arms of length A and B; how can I get them to end up at point X,Y" in 2D, and then you add in a simple atan2() call to figure out which orientation to point the base servo. This is the math that goes behind the libraries Kyle links to.
    Very helpful thank you, I'm trying to get the robot to follow my finger tips, this should help me understand whats going on when I'm sending packets/coords.

  6. Re: Feeding Coordinates to Pincher Arm.

    I think I'm making some progress, been looking around at the examples and the armlink java code, but for some reason this doesn't work! It simply outputs ÿddd }U and nothing moves? Any idea where I'm going wrong? I tried using if(armlink.ReadMsgs()), but calling that it won't even enter the loop.

    Code:
    #include <ax12.h>
    #include <BioloidController.h>
    #include <ArmLink\ArmLink.h>
    
    BioloidController bioloid = BioloidController(1000000);
    
    ArmLink armlink= ArmLink();
    
    void setup(){
        Serial.begin(38400);
        Serial.println("Please wait 10 seconds.");
        delay(10000);
        Serial.println("Send Data.");
        
    }
    
    void loop(){
        if (Serial.available()){
            int inByte = Serial.read();
            switch (inByte){
            case '1':
                Serial.println("Sending Packet...");
                sendCommanderPacket(100, 100, 100, 0, 0, 256, 125, 0, 0);
                break;
            }
        }
    }
    
    void sendCommanderPacket(int x, int y, int z, int wristAngle, int wristRotate, int gripper, int delta, int button, int extended)
    {
        //clear the serial port for the next round of communications
        Serial.flush();
        byte xValBytes[2];
        xValBytes[0] = intToBytesLOW(x);
        xValBytes[1] = intToBytesHIGH(x);
    
    
        byte yValBytes[2];
        yValBytes[0] = intToBytesLOW(y);
        yValBytes[1] = intToBytesHIGH(y);
    
    
        byte zValBytes[2];
        zValBytes[0] = intToBytesLOW(z);
        zValBytes[1] = intToBytesHIGH(z);
    
    
        byte wristRotValBytes[2];
        wristRotValBytes[0] = intToBytesLOW(wristRotate);
        wristRotValBytes[1] = intToBytesHIGH(wristRotate);
    
    
        byte wristAngleValBytes[2];
        wristAngleValBytes[0] = intToBytesLOW(wristAngle);
        wristAngleValBytes[1] = intToBytesHIGH(wristAngle);
    
    
        byte gripperValBytes[2];
        gripperValBytes[0] = intToBytesLOW(gripper);
        gripperValBytes[1] = intToBytesHIGH(gripper);
    
    
        //cast int to bytes
        byte buttonByte = byte(button);
        byte extValByte = byte(extended);
        byte deltaValByte = byte(delta);
        boolean flag = true;
        //calculate checksum - add all values, take lower byte (%256) and invert result (~). you can also invert results by (255-sum)
        byte checksum = (byte)(~(xValBytes[1] + xValBytes[0] + yValBytes[1] + yValBytes[0] + zValBytes[1] + zValBytes[0] + wristAngleValBytes[1] + wristAngleValBytes[0] + wristRotValBytes[1] + wristRotValBytes[0] + gripperValBytes[1] + gripperValBytes[0] + deltaValByte + buttonByte + extValByte) % 256);
        
        //send commander style packet. Following labels are for cartesian mode, see function comments for clyindrical/backhoe mode
        //try to write the first header byte
            //Serial.write(0xff);
            Serial.write(0xff);//header        
            Serial.write(xValBytes[1]); //X Coord High Byte
            Serial.write(xValBytes[0]); //X Coord Low Byte
            Serial.write(yValBytes[1]); //Y Coord High Byte
            Serial.write(yValBytes[0]); //Y Coord Low Byte
            Serial.write(zValBytes[1]); //Z Coord High Byte
            Serial.write(zValBytes[0]); //Z Coord Low Byte
            Serial.write(wristAngleValBytes[1]); //Wrist Angle High Byte
            Serial.write(wristAngleValBytes[0]); //Wrist Angle Low Byte
            Serial.write(wristRotValBytes[1]); //Wrist Rotate High Byte
            Serial.write(wristRotValBytes[0]); //Wrist Rotate Low Byte
            Serial.write(gripperValBytes[1]); //Gripper High Byte
            Serial.write(gripperValBytes[0]); //Gripper Low Byte
            Serial.write(deltaValByte); //Delta Low Byte  
            Serial.write(buttonByte); //Button byte  
            Serial.write(extValByte); //Extended instruction  
            Serial.write(checksum);  //checksum
    }
    
    
    byte intToBytesLOW(int convertInt)
    {
        byte returnBytes; // array that holds the two bytes to return
        byte mask = byte(255);          //mask for the low byte (255/0xff)
        returnBytes = byte(convertInt & mask);//low byte - perform an '&' operation with the byte mask to remove the high byte
        return returnBytes;  //return byte array
    }
    
    
    byte intToBytesHIGH(int convertInt)
    {
        byte returnBytes; // array that holds the two bytes to return
        byte mask = byte(255);          //mask for the low byte (255/0xff)
        returnBytes = byte((convertInt >> 8) & mask);//high byte - shift the byte to the right 8 bits. perform an '&' operation with the byte mask to remove any additional data
        return returnBytes;  //return byte array
    }

  7. #7

    Re: Feeding Coordinates to Pincher Arm.

    Were you able to get the software working with the stock armlink example firmware?

    Can you give us a broader overview of what you're trying to accomplish? Will the computer be taking inputs from your fingertips, or are you doing it at the microcontroller level?

    If you're trying to control the arm from a computer, I would reccomend using the stock InterbotixArmLinkSerial firmware, then send commands to the arm from your computer - you shouldn't need to modify the firmware (unless you need custom features). All of the custom code will be on your computer app.

    The armlink library facilitates the armlink serial protocol, but it doesn't actually run any arm IK. So you still need the IK code that is in the other files

    https://github.com/Interbotix/ArmLin...xArmLinkSerial


    This demo also has some code for standalone use of the arms IK engine.
    http://learn.trossenrobotics.com/20-...-playback.html

  8. Re: Feeding Coordinates to Pincher Arm.

    Quote Originally Posted by kgranat View Post
    Were you able to get the software working with the stock armlink example firmware?
    I take it you mean this one: http://learn.trossenrobotics.com/20-...-playback.html

    Yes, it all works correctly.

    Quote Originally Posted by kgranat View Post
    Can you give us a broader overview of what you're trying to accomplish? Will the computer be taking inputs from your fingertips, or are you doing it at the microcontroller level?
    Have you heard of the Leap Motion (https://www.leapmotion.com/) Essentially I already have a C++ program that takes the coordinates of the users finer tips, (x,y,z), so to begin with I would like to hard code (x,y,z) coords just to get it working, then move on to take the coords from the Leap Motion directly and get the arm to follow the users finger tip.

    Quote Originally Posted by kgranat View Post
    If you're trying to control the arm from a computer, I would reccomend using the stock InterbotixArmLinkSerial firmware, then send commands to the arm from your computer - you shouldn't need to modify the firmware (unless you need custom features). All of the custom code will be on your computer app.

    The armlink library facilitates the armlink serial protocol, but it doesn't actually run any arm IK. So you still need the IK code that is in the other files

    https://github.com/Interbotix/ArmLin...xArmLinkSerial
    Yes, this verifies and uploads, but from what I gather you need a controller to send movements to the arm?

    For example:
    Code:
    armlink.buttons
    Code:
    //===================================================================================================
    // Check EXT packet to determine action
    //===================================================================================================
       void ExtArmState(){
           if(armlink.ext < 0x10){
            // no action
            g_fArmActive = true;
         }
          
          else if(armlink.ext == 0x11){  //96
            EmergencyStop();
            IDPacket();        
          }....
    I'm not really sure how I control the arm with interbotixArmLinkSerial. I should point out I only have a pincher arm and a arbotix-m.

    Quote Originally Posted by kgranat View Post
    This demo also has some code for standalone use of the arms IK engine.
    http://learn.trossenrobotics.com/20-...-playback.html
    Ok yes now I understand that I need more than what I posted above, can't just send a packet.

    The sequence firmware looks promising, I'll see if I can get it to move through its maximum working area, then maybe I'll be able to figure a way to send it the coordinates automatically.

    Thanks for the info.

    EDIT: Ok for some reason the sequence example is not working, I turned the button value to false and uncommented pincher, it verifies and uploads, arm moves to resting position, then outputs rubbish:
    Code:
    Žàüpþüÿðüpÿàü€ààpŽüüðüpþàþüüàüàþüðüàüþüüþüà€üàŽàüüpðà€àüàpøàüàpàü€üþàþüÿàüüàüðàþþàþàüüüàüðüŽüþüüþàüpŽàüüpðà€àüààðàüàààü€üþàþüÿà€ààüþüàüüàüðàþüàüüüàüðüŽüþüüàpþüüàüðüŽüþüüàüüàüðüðüàüðàþüà€|ðàþüÿàüü~àüààþàüàüŽàŽüà€
    And doesn't play the sequence.

    EDIT2: Ok turns out I had to remove all the button/pin defines, and now runs the sequence.
    Last edited by EpicZa; 04-28-2015 at 05:55 AM.

  9. #9

    Re: Feeding Coordinates to Pincher Arm.

    The ArmLinkSerial firmware is the firmware you loaded onto your pincher arm so that the armlink program could send commands to the arm. Basically, if you ran through this getting started guide to control the arm from our program, you've loaded the firmware onto your arm
    http://learn.trossenrobotics.com/20-...-software.html

    I've worked with the leap motion before, and did some basic demos of moving one of our arms with it. I used the ArmLinkSerial firmware (unmodifired) on the arm, the used the computer as the controller. I opened up a serial port in Java, then sent command packets over to the arm to the XYZ coordinates I wanted the arm to go to based on the leapmotion input.

  10. Re: Feeding Coordinates to Pincher Arm.

    Quote Originally Posted by kgranat View Post
    The ArmLinkSerial firmware is the firmware you loaded onto your pincher arm so that the armlink program could send commands to the arm. Basically, if you ran through this getting started guide to control the arm from our program, you've loaded the firmware onto your arm
    http://learn.trossenrobotics.com/20-...-software.html

    I've worked with the leap motion before, and did some basic demos of moving one of our arms with it. I used the ArmLinkSerial firmware (unmodifired) on the arm, the used the computer as the controller. I opened up a serial port in Java, then sent command packets over to the arm to the XYZ coordinates I wanted the arm to go to based on the leapmotion input.
    Yea it just took me a while getting my head around it, getting there now, creating code in c++ now to send the packets over serial.

    thanks for the Help!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. News/Announcement PhantomX Pincher Arm - now supported with ROS Robot Operating System
    By corb555 in forum Interbotix Robotic Arms
    Replies: 3
    Last Post: 04-11-2018, 09:04 AM
  2. Replies: 0
    Last Post: 02-14-2013, 11:46 PM
  3. Replies: 0
    Last Post: 02-01-2013, 05:15 PM
  4. New PhantomX Pincher Arm $360 Including Delivery
    By HyperCube in forum Garage Sale
    Replies: 0
    Last Post: 01-23-2013, 09:40 PM
  5. Coordinates of an object on a passive image
    By ilovebobcats in forum Sensors
    Replies: 9
    Last Post: 06-16-2012, 08:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •