Skip to content

sunrise_project_setup

Salvo Virga edited this page Jul 25, 2017 · 16 revisions

Set up your Sunrise Project

  1. Create a Sunrise project, or load an existing one from the controller (do not create a new RoboticApplication)
  2. Open the StationSetup.cat file
  3. Select the Software tab
  4. Enable the Servo Motion packages, this is how that page should look like : station
  5. Save and apply changes
  6. Browse to the location of the folder iiwa_stack/iiwa_ros_java/src and copy its content (the folder de)
  7. Select the folder src of the Sunrise Project in Sunrise Workbench and paste what you just copied
  8. Browse to the location of the folder iiwa_stack/iiwa_ros_java and copy the folder ROSJavaLib
  9. Select the Sunrise Project in Sunrise Workbench and paste what you just copied.
  10. In your project, you should now see this :
    project
  11. Inside Sunrise Workbench select all the files inside ROSJavaLib, right click and choose Build Path -> Add to Build Path... libraries
    IMPORTANT
  12. Have you already set your Safety Configuration? If not, you should! HERE we show how we set up ours.
  13. Be sure the right master_ip is set in the config.txt file. See below.

Configuration File

From release 1.7.x, we introduced a configuration file that allows to easily set some parameters.
In the Java project you just created, you should have a config.txt file.

There you can set :

  • robot_name: name of your robot, by default iiwa. Read more about this HERE;
  • master_ip: IP of the ROSCORE machine you just set HERE, for example 160.69.69.100;
  • master_port: port for ROS communication, also set HERE, by default is 11311;
  • ntp_with_host: turns on/off the ntptimeprovider from ROSJava to sync the two machines. The default value is false, note that you need an ntp provider on the external machine if you want to set it to true.

Once you properly fill this file, everything is ready. There should be no red sign or problem found by the IDE. If this is a new project? Then you first need to Install it (Station Setup -> Installation) and then synchronise it.

Note for Developers

With this setup extending the Java side of iiwa_stack is not optimal, we just copied everything out of the git directory so every change was done in Sunrise Workbench won't be seen.
A better idea would be to make an additional Java Project that uses the Java code as external source, the ROSJavaLib and the KUKAJavaLib files as external libraries (Configure Build Path...-> Source->Link Source and Libraries->Add External JARs, respectively), including then this Java Project into the Sunrise Project(Configure Build Path...->Projects->Add).

This way the source code will be only linked to the project but still physically in the git folder, unfortunately, this seems to generate a good set of senseless and not really informative errors from Sunrise Workbench when trying to synchronize the project, therefore we have to live like this for the moment :(

Clone this wiki locally