July 19, 2019, 05:11:57 PM
Robotforum | Industrial Robots Community

 DataRecorder

normal_post Author Topic:  DataRecorder  (Read 626 times)

0 Members and 1 Guest are viewing this topic.

February 19, 2019, 08:44:50 AM
Read 626 times
Offline

Beginner


Hi People,

few weeks ago i started to work with Sunrise Workbench. Currently I'm trying to apply the function of the Datarecorder, but I'm not abel to use it....i just added
DataRecorder rec_1 = new DataRecorder("Recording_1.log", 5,TimeUnit.SECONDS, 100);
but it is not giving something out...there is no file (Recording_1.log) on my iiwa.

Do you have any hints for me?

Best,
Beginner

Today at 05:11:57 PM
Reply #1

Advertisement

Guest

February 19, 2019, 10:10:58 AM
Reply #1
Offline

DrG


Hello Beginner,

please have a look into the Help of the Sunrise Workbench -> Chapter 15.24


DrG
PS: Sorry - not more time for Details...

February 19, 2019, 11:16:11 AM
Reply #2
Offline

Beginner


I did it and just copied the example :-) but it did not write anything out...

February 20, 2019, 07:47:43 AM
Reply #3
Offline

DrG


Hi Beginner,
Code: [Select]
I did it and just copied the example :-) but it did not write anything out...
That does not Sound cool...
... hm... the example at the end of the chapter 15.24 (short before 15.25) should work - I had a quick glance on it.

Q: Where did you look for the datafiles?

For troubleshooting, you can "manually" force start/stop recording by calling directly "rec.startRecording()" <> "rec.stopRecording()".
AKA: Bypass the StartRecordingAction mechanism.

 
DrG

February 20, 2019, 07:49:30 AM
Reply #4
Offline

DrG


Hi Beginner,
another question:
in StationSetup.cat - is the "Sunrise Data Recording" Feature checked/selected?

DrG

February 21, 2019, 02:28:17 PM
Reply #5
Offline

Beginner


It is selected at station....cat and i always looking for it on my krc (\\172.31.1.148\krc\Roboter\log\DataRecorder)
It is still not working...
do i have to create a class or import something? i feel pretty stupid..
package application;


//import java.util.concurrent.TimeUnit;

//import java.util.concurrent.TimeUnit;

import javax.inject.Inject;
import com.kuka.roboticsAPI.applicationModel.RoboticsAPIApplication;
import static com.kuka.roboticsAPI.motionModel.BasicMotions.*;
import com.kuka.roboticsAPI.deviceModel.LBR;
//import com.sun.org.omg.CORBA.InitializerHelper;

/**
 * Implementation of a robot application.
 * <p>
 * The application provides a {@link RoboticsAPITask#initialize()} and a
 * {@link RoboticsAPITask#run()} method, which will be called successively in
 * the application lifecycle. The application will terminate automatically after
 * the {@link RoboticsAPITask#run()} method has finished or after stopping the
 * task. The {@link RoboticsAPITask#dispose()} method will be called, even if an
 * exception is thrown during initialization or run.
 * <p>
 * <b>It is imperative to call <code>super.dispose()</code> when overriding the
 * {@link RoboticsAPITask#dispose()} method.</b>
 *
 * @see UseRoboticsAPIContext
 * @see #initialize()
 * @see #run()
 * @see #dispose()
 */
public class DataRecorder extends RoboticsAPIApplication {
   @Inject
   private LBR lBR_iiwa_14_R820_1;

   //private rec_1;

   @Override
   public void initialize() {
      // initialize your application here
   }

   @Override
   public void run() {
      // your application execution starts here
      lBR_iiwa_14_R820_1.move(ptpHome());
      
      lBR_iiwa_14_R820_1.move(ptp(0,Math.toRadians(15),0,Math.toRadians(15),Math.toRadians(15),0,0).setJointVelocityRel(0.2));
      DataRecorder rec = new DataRecorder();
      // ...
      rec.enable();
      rec.startRecording();

      lBR_iiwa_14_R820_1.move(ptp(0,Math.toRadians(5),0,Math.toRadians(15),Math.toRadians(7),0,0).setJointVelocityRel(0.2));
         
   
      //rec.setFileName("Recording.log");
      //rec.setFileName("Recording.log");
      //rec.setSampleRate(10);
      //rec.addExternalJointTorque(lBR_iiwa_14_R820_1);
      //StartRecordingAction startAction =new StartRecordingAction(rec);
      
      lBR_iiwa_14_R820_1.move(ptpHome());
      

   }
}

here is my code for the pre last one...


February 27, 2019, 02:34:33 PM
Reply #6
Offline

Beginner


DrG do you have any suggestion for me ? :-) ?

Today at 05:11:57 PM
Reply #7

Advertisement

Guest

March 05, 2019, 07:42:53 AM
Reply #7
Offline

Seulki


Hi, sorry for a silly question, but have you called a stopRecording() method at the end?
I guess the log file creation should be done inside of this method which means you won't get any unless you call it.

March 11, 2019, 03:18:15 PM
Reply #8
Offline

DrG


Hi Beginner,
Quote
Seulki:: but have you called a stopRecording() method at the end?
Seulki is right...

you Need somehow to finish/stop the recording (refer e.g. to Section 15.24.4 in the Manual).

Either you call it manually: "stopRecording()"
    or you Trigger it via the Actions
    or you finish the application
    or the tracing depth of the Recorder is reached.

See also Section 15.26.6 - Example for datarecording.
There the "rec.stopRecording()" is called
AND the application is synchronized (rec.awaitFileEnable()).
Note: This helps especially for Trouble Shooting...
Further hints for Trouble Shooting: Inquire the state of the Recorder by calling "rec.isXXX" - isEnabled; isRecording; isFileAvailable

DrG






July 13, 2019, 01:22:42 PM
Reply #9
Offline

Beginner


package application;


import javax.inject.Inject;
import com.kuka.roboticsAPI.applicationModel.RoboticsAPIApplication;
import static com.kuka.roboticsAPI.motionModel.BasicMotions.*;
import com.kuka.roboticsAPI.deviceModel.LBR;
import com.kuka.roboticsAPI.sensorModel.DataRecorder;
import com.kuka.roboticsAPI.sensorModel.DataRecorder.AngleUnit;

/**
 * Implementation of a robot application.
 * <p>
 * The application provides a {@link RoboticsAPITask#initialize()} and a
 * {@link RoboticsAPITask#run()} method, which will be called successively in
 * the application lifecycle. The application will terminate automatically after
 * the {@link RoboticsAPITask#run()} method has finished or after stopping the
 * task. The {@link RoboticsAPITask#dispose()} method will be called, even if an
 * exception is thrown during initialization or run.
 * <p>
 * <b>It is imperative to call <code>super.dispose()</code> when overriding the
 * {@link RoboticsAPITask#dispose()} method.</b>
 *
 * @see UseRoboticsAPIContext
 * @see #initialize()
 * @see #run()
 * @see #dispose()
 */
public class DataExport extends RoboticsAPIApplication {
   @Inject
   private LBR lBR_iiwa_14_R820_1;
   
   //@Override
   //public void initialize() {
      // initialize your application here
//   }
   
   //@Override
   public void run() {
      DataRecorder(); {
      }
      DataRecorder rec = new DataRecorder();
      rec.setFileName("DataExport.log");
      rec.setSampleInterval(10);
      rec.addExternalJointTorque(lBR_iiwa_14_R820_1);
      rec.addCurrentJointPosition(lBR_iiwa_14_R820_1, AngleUnit.Degree);
      rec.addInternalJointTorque(lBR_iiwa_14_R820_1);
      rec.enable();
      rec.startRecording();
      // your application execution starts here
      lBR_iiwa_14_R820_1.move(ptpHome());
      lBR_iiwa_14_R820_1.move(ptp(getFrame("/P12")));
      rec.stopRecording();
      
         
   }

   private void DataRecorder() {
      // TODO
      
   }
}

-> This code is working, just for the next people with such issue :-)


Share via facebook Share via linkedin Share via pinterest Share via reddit Share via twitter

xx
DataRecorder KUKA LBR iiwa

Started by pma07pg on KUKA LBR IIWA

2 Replies
1039 Views
Last post February 19, 2019, 03:39:37 PM
by Beginner
xx
DataRecorder - Frame Orientations

Started by efipsom on KUKA LBR IIWA

10 Replies
1326 Views
Last post March 28, 2018, 02:01:28 PM
by razzo
moved
MOVED: DataRecorder KUKA LBR iiwa

Started by panic mode on KUKA Robot Forum

0 Replies
146 Views
Last post February 19, 2019, 03:46:32 PM
by panic mode