Need help for a School Project.

  • Hello! I've now been struggling to learn myself how to write a code for basic movements for the KUKA LBR iiwa 7 R800. The task on hand is to make the robot draw the X's and O's in an TicTacToe game. I've been reading some manuals and figured out that I should be using the PTP and CIRC functions for the basic drawing movements, but the lack of example codes frustrate me. It would be awesome if any of you would give me some tips when it comes to coding.


    Thanks!


  • What is it exactly you're struggling with? The manual is pretty comprehensive (Im assuming you were referring to the systems integrator manual).


    I'm struggling with the basic approach of the program, like finding out which functions to use and how to use them. I've been reading the Sunrise Workbench Manual, but I can't really get my head around how to make the robot draw the lines and figures I want it to without going below the surface of the table. So I'm wondering about how to make a World that represents the 1 by 1 meter surface of the whiteboard where I can simply put in points to make the robot draw a line from one point to another, making the squares for the game and drawing the X's. And then to draw in a circular motion for the O's.

  • The 'Operating and Programming Instructions for System Integrators' manual (Sunrise 1.14) describes in chapter 14 'Basic principles of motion programming' the available motions and in chapter 15.6 'Motion programming: PTP, LIN, CIRC' how to program the motions.


    To drow a line you should use a linear motion (lin). If you use a ptp you cannot plan the path. The robot could run into your table or something like that. But this is a general ptp property and not a LBR iiwa specific one.

  • For this I'm going to assume you have a grasp of the basic principles of robotics and object oriented programming.


    Before doing anything you have to create your project with the correct configuration, this is covered fairly well in the manual.


    Create your first application, use the provided wizard in workbench. The wizard creates a java class that inherits from the super class RoboticsAPIApplication, because of this your application has access many functions for manipulating the robot. Note, all these functions can be obtained without extending the RoboticsAPI, you just have to import them yourself.


    Now it's time to write some code. Inside your application you'll see 2 abstract methods that sunrise has implemented for you, namely "run" and "initialize". The run method is called from the API once when your application is started and the initialize method is called once just before the run method is called. Just as the name suggests, you should initialize your program withing the initialize method. Usually you attach your desired tool to your robot (see sample code).


    Now you have a tool that is attached to your robot that you can command to different positions in space. You can calculate where you want the robot move or you can teach it. Teaching is done from the SmartPad. Teaching is simply storing the current robot position in a variable. If you want to learn how to declare and teach positions then I suggest you read the manual.


    The most common way to move the robot is by commanding the attached tool to certain position. The tool must be attached to the robot for this to work, see code below.


    For your tic tac toe you're going to need to create a base. The main advantage with using a base in this case is it makes calculations easier and you can move the surface you're going to draw on fairly easily.


    I'm going to provide you with some code to get started.



    Code never tested.


  • This helped alot! Thanks! :party2:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now