Skip to content
Snippets Groups Projects
Commit 9b845f6c authored by Matthieu Herrb's avatar Matthieu Herrb
Browse files

[wip/FRILibrary] import FRILibrary a C++ interface to Kuka LWR arms

This is the code from Torsten Kroeger, Stanford University.
parent 53b5ae8d
No related branches found
No related tags found
No related merge requests found
The Fast Research Interface Library intends to provide a simple user
interface to the KUKA Light-Weight Robot IV and hides all
communication and set-up issues behind interface. It is only an
interface and it does not contain any control functionalities. Without
much installation efforts, access to different controller interfaces
of the KUKA system is provided:
Joint position controller,
Cartesian impedance controller, and
Joint position controller.
The Fast Research Interface Library runs on a remote PC node with is
connected to the KRC (KUKA Robot Controller) via an Ethernet
connection. In intervals of 1 to 100 milliseconds, UDP packages are
periodically sent from the KRC unit to the remote host. These packages
contain a complete set of robot control and status data (e.g., joint
positions, joint torques, drive FRIDriveTemperatures, etc.; cf. FRI
User Documentation). Users become able to set-up own control
architectures and/or application-specific controllers for the
light-weight arm as it is often desired at research institutions.
KRL files (to be installed on the KRC) are installed in
${PREFIX}/share/FRILibrary
# robotpkg Makefile for: hardware/FRILibrary
# Created: Matthieu Herrb on Mon, 23 May 2016
#
DISTNAME= fril
VERSION= 1.2
PKGNAME= FRILibrary-${VERSION}
DIST_SUBDIR= frilib-${VERSION}
EXTRACT_SUFX= .zip
MASTER_SITES= http://cs.stanford.edu/people/tkr/fri/download/
HOMEPAGE= http://cs.stanford.edu/people/tkr/fri/html/index.html
CATEGORIES= hardware
MAINTAINER= openrobots@laas.fr
COMMENT= C++ Library to interface the KUKA Light Weight Robot IV
LICENSE= apache-2.0
WRKSRC= ${WRKDIR}/FRILibrary
BUILD_DIRS= Linux
include ../../mk/robotpkg.prefs.mk
ifeq (${MACHINE_ARCH},x86_64)
arch= x64
else ifeq (${MACHINE_ARCH},i386)
arch= x86
else
PKG_FAIL_REASON= "Architecture not supported"
endif
PKG_SUPPORTED_OPTIONS+= debug
PKG_OPTION_DESCR.debug= Compile in debugging mode
# do not remove the newline below build= debug !
define PKG_OPTION_SET.debug
build= debug
endef
PKG_OPTION_UNSET.debug:= build= "release"
BUILD_TARGET= all_${build}_${arch}
CPPFLAGS+= -DPREFIX="${PREFIX}"
do-install:
${INSTALL_DATA_DIR} ${PREFIX}/include/FRILibrary
cd ${WRKSRC}/include && \
${PAX} -rwp ma . ${PREFIX}/include/FRILibrary
cd ${WRKSRC}/Linux/${arch}/${build}/ && \
${PAX} -rwp ma bin lib ${PREFIX}
${INSTALL_DATA_DIR} ${PREFIX}/share/FRILibrary/KRL
cd ${WRKSRC}/KRL && \
${PAX} -rwp ma . ${PREFIX}/share/FRILibrary/KRL
${INSTALL_DATA_DIR} ${PREFIX}/share/FRILibrary/conf
cd ${WRKSRC}/etc && \
${PAX} -rwp ma . ${PREFIX}/etc
NO_CONFIGURE= yes
include ../../archivers/pax/depend.mk
include ../../pkgtools/install-sh/depend.mk
include ../../mk/language/c++.mk
include ../../mk/robotpkg.mk
@comment Mon May 23 17:04:40 CEST 2016
bin/FastResearchInterfaceTest
bin/LWRCartImpedanceControlExample
bin/LWRJointImpedanceControlExample
bin/LWRJointPositionControlExample
bin/LWRLoggingExample
etc/980039-FRI-Driver.init
include/FRILibrary/Console.h
include/FRILibrary/DataLogging.h
include/FRILibrary/Doxygen.h
include/FRILibrary/FRICommunication.h
include/FRILibrary/FastResearchInterface.h
include/FRILibrary/FastResearchInterfaceTest.h
include/FRILibrary/InitializationFileEntry.h
include/FRILibrary/LWRBaseControllerInterface.h
include/FRILibrary/LWRCartImpedanceController.h
include/FRILibrary/LWRJointImpedanceController.h
include/FRILibrary/LWRJointPositionController.h
include/FRILibrary/LinuxAbstraction.h
include/FRILibrary/MACOSAbstraction.h
include/FRILibrary/OSAbstraction.h
include/FRILibrary/QNXAbstraction.h
include/FRILibrary/TypeIRML.h
include/FRILibrary/TypeIRMLDecision.h
include/FRILibrary/TypeIRMLInputParameters.h
include/FRILibrary/TypeIRMLMath.h
include/FRILibrary/TypeIRMLOutputParameters.h
include/FRILibrary/TypeIRMLPolynomial.h
include/FRILibrary/TypeIRMLProfiles.h
include/FRILibrary/TypeIRMLVector.h
include/FRILibrary/UDPSocket.h
include/FRILibrary/WindowsAbstraction.h
lib/libFastResearchInterfaceLibrary.a
lib/libTypeIRML.a
share/FRILibrary/KRL/FRIControl.dat
share/FRILibrary/KRL/FRIControl.src
# robotpkg depend.mk for: hardware/FRILibrary
# Created: Matthieu Herrb on Mon, 23 May 2016
#
DEPEND_DEPTH:= ${DEPEND_DEPTH}+
FRILIBRARY_DEPEND_MK:= ${FRILIBRARY_DEPEND_MK}+
ifeq (+,${DEPEND_DEPTH})
DEPEND_PKG+= FRILibrary
endif
ifeq (+,${FRILIBRARTY_DEPEND_MK))
DEPEND_USE+= FRILibrary
DEPEND_API.FRILibrary?= FRILibrary>=1.2
DEPEND_DIR.FRILibrary?= ../../wip/FRILibary
SYSTEM_SEARCH.FRILibrary=\
include/FRILibrary/FastResearchInterface.h \
lib/libFastResearchInterfaceLibrary.a \
bin/FastResearchInterfaceTest
INCLUDE_DIRS.FRILibrary= include/FRILibrary
LIBRARY_DIRS.FRILibrary= lib
RPATH_DIRS.FRILibrary=lib
endif
DEPEND_DEPTH:= ${DEPEND_DEPTH:+=}
SHA1 (frilib-1.2/fril.zip) = a876c225b464ffa25a0dcbae8783eb84e5d06132
RMD160 (frilib-1.2/fril.zip) = b23957503feee5c16e610eb4fae65d49760fcdc2
Size (frilib-1.2/fril.zip) = 997218 bytes
SHA1 (patch-aa) = 5922a171eecc767859b565cd01c00b94fc0a3321
SHA1 (patch-ab) = 7313d58b0a215b7b6ddb84c9b0187191f300fe7e
SHA1 (patch-ac) = 451b9b1e8c534747af7f75bbc894ac6d81450fbf
SHA1 (patch-ad) = c5b88b1b2ed9605d0ddff59e06b400d7af398c76
SHA1 (patch-ae) = 2540ae5fe484aaa59b610b7bcd74659bec1f2bbb
SHA1 (patch-af) = 8c230783e5ffcaf8194738ab371a32485eef892b
SHA1 (patch-ag) = 34c2a6973f17861182555f3c295732685730c36f
SHA1 (patch-ah) = 4379946c9efaae50f9935ccd6d4acdfb6e5840c6
SHA1 (patch-ai) = 02d8aaee1583ff4da2c81ae4673bd70181afd4ae
--- ./etc/980039-FRI-Driver.init.orig 2011-11-19 21:07:18.000000000 +0100
+++ ./etc/980039-FRI-Driver.init 2016-05-23 17:57:02.808782000 +0200
@@ -16,5 +16,5 @@
[Logging]
NumberOfLoggingFileEntries=60000
-LoggingPath=/home/lwrcontrol/output
-LoggingFileName=LWR-Scope.dat
\ No newline at end of file
+LoggingPath=/tmp
+LoggingFileName=LWR-Scope.dat
--- ./src/FastResearchInterfaceTest/FastResearchInterfaceTest.cpp.orig 2014-12-03 09:27:36.000000000 +0100
+++ ./src/FastResearchInterfaceTest/FastResearchInterfaceTest.cpp 2016-05-23 17:53:38.860953000 +0200
@@ -108,7 +108,7 @@
#ifdef __LINUX__
fprintf(stdout, "You may need superuser permission to run this program.\n");
fflush(stdout);
- FRI = new FastResearchInterface("/home/torsten/etc/980039-FRI-Driver.init");
+ FRI = new FastResearchInterface(PREFIX "/etc/980039-FRI-Driver.init");
#endif
#ifdef __MACOS__
--- ./src/LWRGettingStartedExamples/LWRCartImpedanceControlExample.cpp.orig 2014-12-03 09:27:36.000000000 +0100
+++ ./src/LWRGettingStartedExamples/LWRCartImpedanceControlExample.cpp 2016-05-23 17:54:55.458384000 +0200
@@ -91,7 +91,7 @@
LWRCartImpedanceController *Robot;
- Robot = new LWRCartImpedanceController("/home/lwrcontrol/etc/980039-FRI-Driver.init");
+ Robot = new LWRCartImpedanceController(PREFIX "/etc/980039-FRI-Driver.init");
fprintf(stdout, "RobotCartImpedanceController object created. Starting the robot...\n");
--- ./src/LWRGettingStartedExamples/LWRJointImpedanceControlExample.cpp.orig 2014-12-03 09:27:36.000000000 +0100
+++ ./src/LWRGettingStartedExamples/LWRJointImpedanceControlExample.cpp 2016-05-23 18:56:00.196563000 +0200
@@ -81,7 +81,7 @@
LWRJointImpedanceController *Robot;
- Robot = new LWRJointImpedanceController("/home/lwrcontrol/etc/980039-FRI-Driver.init");
+ Robot = new LWRJointImpedanceController(PREFIX "/etc/980039-FRI-Driver.init");
fprintf(stdout, "RobotJointImpedanceController object created. Starting the robot...\n");
--- ./src/LWRGettingStartedExamples/LWRJointPositionControlExample.cpp.orig 2014-12-03 09:27:36.000000000 +0100
+++ ./src/LWRGettingStartedExamples/LWRJointPositionControlExample.cpp 2016-05-23 17:55:43.250402000 +0200
@@ -81,7 +81,7 @@
LWRJointPositionController *Robot;
- Robot = new LWRJointPositionController("/home/lwrcontrol/etc/980039-FRI-Driver.init");
+ Robot = new LWRJointPositionController(PREFIX "/etc/980039-FRI-Driver.init");
fprintf(stdout, "RobotJointPositionController object created. Starting the robot...\n");
--- ./src/LWRGettingStartedExamples/LWRLoggingExample.cpp.orig 2014-12-03 09:27:36.000000000 +0100
+++ ./src/LWRGettingStartedExamples/LWRLoggingExample.cpp 2016-05-23 17:56:15.514740000 +0200
@@ -87,7 +87,7 @@
LWRJointPositionController *Robot;
- Robot = new LWRJointPositionController("/home/lwrcontrol/etc/980039-FRI-Driver.init");
+ Robot = new LWRJointPositionController(PREFIX "/etc/980039-FRI-Driver.init");
fprintf(stdout, "RobotJointPositionController object created. Starting the robot...\n");
--- ./src/FastResearchInterfaceLibrary/FastResearchInterface.cpp.orig 2014-12-03 09:27:36.000000000 +0100
+++ ./src/FastResearchInterfaceLibrary/FastResearchInterface.cpp 2016-05-23 18:26:01.337261000 +0200
@@ -240,12 +240,12 @@
}
else
{
- sprintf(this->LoggingPath, ".%s\0", OS_FOLDER_SEPARATOR);
+ sprintf(this->LoggingPath, ".%s", OS_FOLDER_SEPARATOR);
}
if (strlen(this->LoggingFileName) == 0)
{
- sprintf(this->LoggingFileName, "FRI.dat\0");
+ sprintf(this->LoggingFileName, "FRI.dat");
}
this->DataLogger = new DataLogging( this->RobotName
--- ./src/FastResearchInterfaceLibrary/UDPSocket.cpp.orig 2014-12-03 09:27:36.000000000 +0100
+++ ./src/FastResearchInterfaceLibrary/UDPSocket.cpp 2016-05-23 18:27:33.082396000 +0200
@@ -157,7 +157,7 @@
}
else
{
- fprintf(stderr, "ERROR: Data size incorrect (received: %d, expected %d)\n", DataReceived, sizeof(FRIDataReceivedFromKRC));
+ fprintf(stderr, "ERROR: Data size incorrect (received: %d, expected %zu)\n", DataReceived, sizeof(FRIDataReceivedFromKRC));
fflush(stderr);
}
}
--- Linux/Makefile.global.orig 2013-10-30 09:28:32.000000000 +0100
+++ Linux/Makefile.global 2016-05-23 18:47:54.687506000 +0200
@@ -80,13 +80,14 @@
DEBUG_EXE_DIR=debug/bin
DEBUG_OBJ_DIR=debug/obj
DEBUG_LIB_DIR=debug/lib
-DEBUG_CC= g++ -c -I $(INCLUDE_DIR) -D$(TARGET_OS) -ggdb
+DEBUG_CC= g++ -c -I $(INCLUDE_DIR) -D$(TARGET_OS) -ggdb -DPREFIX=\"${PREFIX}\"
+
DEBUG_CL= g++ $(SYSTEM_LIBS) -gddb
RELEASE_EXE_DIR=release/bin
RELEASE_OBJ_DIR=release/obj
RELEASE_LIB_DIR=release/lib
-RELEASE_CC= g++ -c -I $(INCLUDE_DIR) -D$(TARGET_OS) -O3
+RELEASE_CC= g++ -c -I $(INCLUDE_DIR) -D$(TARGET_OS) -O3 -DPREFIX=\"${PREFIX}\"
RELEASE_CL= g++ $(SYSTEM_LIBS)
AR= ar vrs
......@@ -14,6 +14,7 @@ SUBDIR+= dynamic-graph-v3
SUBDIR+= dynamic-graph-bridge
SUBDIR+= dynamic-graph-bridge-v3
SUBDIR+= dynamic-graph-bridge-msgs
SUBDIR+= FRILibrary
SUBDIR+= gdalwrap
SUBDIR+= gest-genom
SUBDIR+= gladys
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment