Kuka iiwa 7 Inverse Kinematic funtion

  • Hello everyone,


    I am working with the Kuka iiwa robot for an art project. An artist wants to control the robot using sound inputs. The kuka robot that I am using came with a ROS API that made my life so much easier.
    However I have realised that this API has some limits, for example when a target frame is sent to the robot and if this frame reaches the joint limits the robot will just freeze until I manually reset it from the smartPad.
    Now since it is the artist that will send the inputs and since I won't be there during the Art exhibition, I would like to bypass the API to make sure the robot won't stop in the middle of the exhibition. To do so I thought about creating an Inverse kinematics model that will compute the joint angle corresponding to the target frame, and at that point I'll make sure the robot will never reach the joint limitation, preventing it from freezing.


    Anyway before, creating the mathematical model, which is quite tedious (considering this is a 7 DOF manipulator) I was researching about sunrise functions that can do this for me. I came across to this function


    getInverseKinematicFromFrameAndRedundancy(frame)

    but i was not able to find any documentation about it.


    Does anyone know how to implement this function? What inputs does it take and what output does it produce?


    Sorry for the wordy Message but I wanted to make sure everyone was on the same page. Thanks in advance!!


    P.S I am open to suggestion, if you think there's an easier way to get the inverse kinematic solution

  • Hello pisi96,


    If you want to use that method, you have to associate it with your robot :

    Code
    JointPosition jPositions = robot.getInverseKinematicFromFrameAndRedundancy(frame)


    It will gets the IK value of the given frame for this robot. If the frame contains redundancy information, these are used for computation. If the frame does not contain redundancy information, an IllegalArgumentException is thrown. (Source : javaDoc)


    The input is your frame, a Cartesian one. You can get it from different ways.
    One way could be to take the current position like that :
    If you wish it at the mediaFlange position :

    Code
    ObjectFrame frameOnFlange = robot.getFlange();
    Frame currentFrame = robot.getCurrentCartesianPosition(frameOnFlange).copyWithRedundancy();


    The output will be the result of the calculation from the controller. You will get a JointPosition parameter.


    Have a good day,
    Best regards,


    PS : Could you give some informations about your project ? I'm curious :icon_smile:

  • Hi OlivierRMD,


    Thank you for your reply. I will try to use the method you described next week as I'm gong to Bristol to the TAROS Conference tomorrow. I will let you know if it works.


    What would you like to know about the project? It is based on a previously successful installation at the No Bounds festival 2017. I am working for Sheffield Robotics and Audiovisual artist Mark Fell to develop an interactive robotics art installation for Festival of the Mind 2018 (Sheffield, UK). The exhibit, titled “Generative Approaches to Robotic Movement and Vocal Synthesis”, will feature a collaborative robot whose movement will be mapped to synthesised audio. The work aims to engage a broad audience in an open, absorbing and thought provoking manner, and to explore and confront attitudes towards robotics, automation and technology.

  • A small suggestion,
    I would rather use try-catch to avoid a motion error and do afterwards whatever I'd like -try other safer position or simply skip this step-.


    Code
    Frame target = new Frame(x, y, z, a, b, c);
    try {
    	lbr.move(lin(target));
    } catch (Exception e) {
    	getLogger().error("The target is unreachable");
    	// try other way
    }

Advertising from our partners