diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..638c8d2a4f126823299db9c14b149df08d613908
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+bin
+build
+lib
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..3476639cd9c07a40bdb928e69d11083fefdfd45c
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,36 @@
+image: docker.io/labrobotica/labrobotica
+
+variables:
+  GIT_SUBMODULE_STRATEGY: recursive
+
+stages:
+  - build
+  - test
+  - deploy
+
+build-package:
+  stage: build
+  script:
+    - apt update
+    - apt -y install iri-iriutils-dev iri-comm-dev iri-segway-rmp-200-dev
+    - mkdir -pv build
+    - cd build
+    - cmake -DCMAKE_BUILD_TYPE=RELEASE -DCPACK_PACKAGE_VERSION=$CI_COMMIT_TAG ..
+    - ls ..
+    - make package -j $(nproc)
+    
+  artifacts:
+    paths:
+      - build/*.deb
+    expire_in: 2 weeks
+  only:
+    - tags
+    
+update_repo:
+  stage: deploy
+  script:
+    - cd build
+    - "scp -i /root/.ssh/iriLabKeyNopwd -r *segway-rmp-400*.deb irilabo@147.83.76.226:packages/"
+    - "ssh irilabo@147.83.76.226 -i /root/.ssh/iriLabKeyNopwd -tt /home/irilabo/repo_scripts/update_repo.sh segway-rmp-400"
+  only:
+    - tags
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 30d5d68f61d01f6373e64cc076c5d9bbbc5d99fb..8108e3934631995c256075806cbbcaaea6d9f813 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,8 @@ if(COMMAND cmake_policy)
 endif(COMMAND cmake_policy)
 
 # The project name and the type of project
-PROJECT(segway-rmp-400)
+PROJECT(segway_rmp_400)
+SET(PACKAGE_NAME segway-rmp-400)
 
 SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
 SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
@@ -72,22 +73,25 @@ ELSE(UNIX)
   )
 ENDIF(UNIX)
 
-
 IF (UNIX)
-  SET(CPACK_PACKAGE_FILE_NAME "iri-${PROJECT_NAME}-dev-${CPACK_PACKAGE_VERSION}${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
-  SET(CPACK_PACKAGE_NAME "iri-${PROJECT_NAME}-dev")
-  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Part of IRI-laboratory libraries. More information at http://wikiri.upc.es/index.php/Robotics_Lab")
-  SET(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
-  SET(CPACK_GENERATOR "DEB")
-  SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "galenya - labrobotica@iri.upc.edu")
-  SET(CPACK_SET_DESTDIR "ON")  # Necessary because of the absolute install paths
-  SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-iriutils-dev (>= 1.0~${DISTRIB}), iri-comm-dev (>= 1.0~${DISTRIB}), iri-segway-rmp-200-dev (>= 1.0~${DISTRIB})")
-
-  INCLUDE(CPack)
-ELSE(UNIX)
-  ADD_CUSTOM_COMMAND(
-    COMMENT "packaging only implemented in unix"
-    TARGET  uninstall
-  )
-ENDIF(UNIX)
-
+    SET(CPACK_PACKAGE_FILE_NAME "iri-${PACKAGE_NAME}-dev-${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
+    SET(CPACK_PACKAGE_NAME "iri-${PACKAGE_NAME}-dev")
+    SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Part of IRI-laboratory libraries. More information at https://gitlab.iri.upc.edu/labrobotica")
+    SET(CPACK_PACKAGING_INSTALL_PREFIX /usr)
+    SET(CPACK_GENERATOR "DEB")
+    SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "labrobotica - labrobotica@iri.upc.edu")
+
+  # Uncomment to add the necessary mantainer scripts
+  #   SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/scripts/debian/preinst;${CMAKE_SOURCE_DIR}/scripts/debian/postinst;${CMAKE_SOURCE_DIR}/scripts/debian/prerm;${CMAKE_SOURCE_DIR}/scripts/debian/postrm")
+
+  # Uncomment to add dependencies comma separated
+  # SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-<package_name>-dev (>= 1.0~${DISTRIB})")
+    SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-iriutils-dev (>= 1.0~${DISTRIB}), iri-comm-dev (>= 1.0~${DISTRIB}), iri-segway-rmp-200-dev (>= 1.0~${DISTRIB})")
+
+    INCLUDE(CPack)
+  ELSE(UNIX)
+    ADD_CUSTOM_COMMAND(
+      COMMENT "packaging only implemented in unix"
+      TARGET  uninstall
+    )
+  ENDIF(UNIX)
diff --git a/Findsegway_rmp_400.cmake b/Findsegway_rmp_400.cmake
index a95fa4da46921ce014311394dc92bcaefd633326..d1502fd183998df5b157c4a907d2ed9e81ec96d2 100644
--- a/Findsegway_rmp_400.cmake
+++ b/Findsegway_rmp_400.cmake
@@ -1,20 +1,26 @@
-FIND_PATH(segway_rmp_400_INCLUDE_DIR segway_RMP400.h segway_RMP400_exceptions.h /usr/include/iridrivers /usr/local/include/iridrivers)
+SET(name segway_rmp_400)
+#edit the following line to add the librarie's header files
+SET(header_files segway_RMP400.h segway_RMP400_exceptions.h)
 
-FIND_LIBRARY(segway_rmp_400_LIBRARY
-    NAMES segway_rmp_400
-    PATHS /usr/lib/iridrivers /usr/local/lib /usr/local/lib/iridrivers) 
+FIND_PATH(${name}_INCLUDE_DIRS ${header_files} /usr/include/iri/${name} /usr/local/include/iri/${name})
 
-IF (segway_rmp_400_INCLUDE_DIR AND segway_rmp_400_LIBRARY)
-   SET(segway_rmp_400_FOUND TRUE)
-ENDIF (segway_rmp_400_INCLUDE_DIR AND segway_rmp_400_LIBRARY)
+FIND_LIBRARY(${name}_LIBRARIES
+    NAMES ${name}
+    PATHS /usr/lib /usr/lib/iri/${name} /usr/local/lib /usr/local/lib/iri/${name})
 
-IF (segway_rmp_400_FOUND)
-   IF (NOT segway_rmp_400_FIND_QUIETLY)
-      MESSAGE(STATUS "Found Segway RMP400 driver: ${segway_rmp_400_LIBRARY}")
-   ENDIF (NOT segway_rmp_400_FIND_QUIETLY)
-ELSE (segway_rmp_400_FOUND)
-   IF (segway_rmp_400_FIND_REQUIRED)
-      MESSAGE(FATAL_ERROR "Could not find segway RMP200 driver")
-   ENDIF (segway_rmp_400_FIND_REQUIRED)
-ENDIF (segway_rmp_400_FOUND)
+SET(${name}_INCLUDE_DIR ${${name}_INCLUDE_DIRS})
+SET(${name}_LIBRARY     ${${name}_LIBRARIES})
 
+IF (${name}_INCLUDE_DIRS AND ${name}_LIBRARIES)
+   SET(${name}_FOUND TRUE)
+ENDIF (${name}_INCLUDE_DIRS AND ${name}_LIBRARIES)
+
+IF (${name}_FOUND)
+   IF (NOT ${name}_FIND_QUIETLY)
+      MESSAGE(STATUS "Found ${name}: ${${name}_LIBRARIES}")
+   ENDIF (NOT ${name}_FIND_QUIETLY)
+ELSE (${name}_FOUND)
+   IF (${name}_FIND_REQUIRED)
+      MESSAGE(FATAL_ERROR "Could not find ${name}")
+   ENDIF (${name}_FIND_REQUIRED)
+ENDIF (${name}_FOUND)
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..65c5ca88a67c30becee01c5a8816d964b03862f9
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,165 @@
+                   GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+  This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+  0. Additional Definitions.
+
+  As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+  "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+  An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+  A "Combined Work" is a work produced by combining or linking an
+Application with the Library.  The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+  The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+  The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+  1. Exception to Section 3 of the GNU GPL.
+
+  You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+  2. Conveying Modified Versions.
+
+  If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+   a) under this License, provided that you make a good faith effort to
+   ensure that, in the event an Application does not supply the
+   function or data, the facility still operates, and performs
+   whatever part of its purpose remains meaningful, or
+
+   b) under the GNU GPL, with none of the additional permissions of
+   this License applicable to that copy.
+
+  3. Object Code Incorporating Material from Library Header Files.
+
+  The object code form of an Application may incorporate material from
+a header file that is part of the Library.  You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+   a) Give prominent notice with each copy of the object code that the
+   Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the object code with a copy of the GNU GPL and this license
+   document.
+
+  4. Combined Works.
+
+  You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+   a) Give prominent notice with each copy of the Combined Work that
+   the Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
+   document.
+
+   c) For a Combined Work that displays copyright notices during
+   execution, include the copyright notice for the Library among
+   these notices, as well as a reference directing the user to the
+   copies of the GNU GPL and this license document.
+
+   d) Do one of the following:
+
+       0) Convey the Minimal Corresponding Source under the terms of this
+       License, and the Corresponding Application Code in a form
+       suitable for, and under terms that permit, the user to
+       recombine or relink the Application with a modified version of
+       the Linked Version to produce a modified Combined Work, in the
+       manner specified by section 6 of the GNU GPL for conveying
+       Corresponding Source.
+
+       1) Use a suitable shared library mechanism for linking with the
+       Library.  A suitable mechanism is one that (a) uses at run time
+       a copy of the Library already present on the user's computer
+       system, and (b) will operate properly with a modified version
+       of the Library that is interface-compatible with the Linked
+       Version.
+
+   e) Provide Installation Information, but only if you would otherwise
+   be required to provide such information under section 6 of the
+   GNU GPL, and only to the extent that such information is
+   necessary to install and execute a modified version of the
+   Combined Work produced by recombining or relinking the
+   Application with a modified version of the Linked Version. (If
+   you use option 4d0, the Installation Information must accompany
+   the Minimal Corresponding Source and Corresponding Application
+   Code. If you use option 4d1, you must provide the Installation
+   Information in the manner specified by section 6 of the GNU GPL
+   for conveying Corresponding Source.)
+
+  5. Combined Libraries.
+
+  You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+   a) Accompany the combined library with a copy of the same work based
+   on the Library, uncombined with any other library facilities,
+   conveyed under the terms of this License.
+
+   b) Give prominent notice with the combined library that part of it
+   is a work based on the Library, and explaining where to find the
+   accompanying uncombined form of the same work.
+
+  6. Revised Versions of the GNU Lesser General Public License.
+
+  The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+  Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+  If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..997ae5d4fe6e450f2f274f995778b8dd51aa4934
--- /dev/null
+++ b/README.md
@@ -0,0 +1,136 @@
+segway_rmp_400 library                         {#mainpage}
+============
+
+## Description
+
+This driver is in charge to operate motion of a SegwayRMP400 and as well as monitoring.
+
+  The main class is SegwayRMP400,
+
+  - The class has an FTDI driver object to ensure USB communication with the segway.
+  - It also launches two threads for reading data and sending commands to the segway.
+  - Uses a mutex variable, to ensure that only one thread is accessing ftdi object at a time.
+	
+  Segway parameters such as position and velocities paramaters are internal variables of the class, 
+  and updated every 10ms approx, by the read thread.
+	
+  The read thread waits for a reception event coming from FTDI device. Once received it reads data stored into
+  receiving buffer of FTDI device. A reference of reception event of FTDI device is retrieved at constructor so 
+  as to wait upon it.
+
+  Comanding the segway on the ohter hand is done at 50 Hz approx by the command thread, i.e one new command each
+  20 ms.Actually, segway must receive a command at least every 0.4 seconds (2.5 Hz) in order to keep it moving.
+  Otherwise it will automatically set motors to zero. 
+
+
+## Installation
+
+* Add the labrobotica repository if it is not already added:
+
+``` sudo sh -c 'echo "deb [arch=amd64] http://147.83.76.226/~irilabo/packages xenial main" > /etc/apt/sources.list.d/labrobotica_repo.list' ```
+
+``` wget -O - http://147.83.76.226/~irilabo/labrobotica_repo.gpg.key | sudo apt-key add - ```
+
+* Install the package:
+
+``` sudo apt update && sudo apt install iri-segway-rmp-400-dev ```
+
+## Scripts
+
+A script is provided to add the Segway manufacturer devices to the dialout group. 
+See [comm/scripts/add_manufacturer to_group_udev.md](https://gitlab.iri.upc.edu/labrobotica/drivers/comm/blob/install_path/scripts/add_manufacturer_to_group_udev.sh)
+
+
+## Disclaimer  
+
+Copyright (C) 2009-2018 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+Mantainer IRI labrobotics (labrobotica@iri.upc.edu)
+
+This package is distributed in the hope that it will be useful, but without any warranty. It is provided "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the program is with you. should the program prove defective, the GMR group does not assume the cost of any necessary servicing, repair  or correction.
+
+In no event unless required by applicable law the author will be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the program to operate with any other programs), even if the author has been advised of the possibility of such damages.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+
+## For developers
+
+<details><summary>click here</summary>
+<p>
+
+## Dependencies
+
+This package requires of the following system libraries and packages
+
+* [cmake](https://www.cmake.org "CMake's Homepage"), a cross-platform build system.
+* [doxygen](http://www.doxygen.org "Doxygen's Homepage") and [graphviz](http://www.graphviz.org "Graphviz's Homepage") to generate the documentation.
+* stdc++ and pthread libraries.
+
+Under linux all of these utilities are available in ready-to-use packages.
+
+This package also requires of the following IRI libraries:
+
+* [iriutils](https://gitlab.iri.upc.edu/labrobotica/algorithms/iriutils "iriutils gitlab page"), a set of basic tools.
+* [comm](https://gitlab.iri.upc.edu/labrobotica/drivers/comm "comm gitlab page"), a set of drivers for standard communication devices.
+
+## Compilation and installation from source
+
+Clone this repository and create a build folder inside:
+
+``` mkdir build ```
+
+Inside the build folder execute the following commands:
+
+``` cmake .. ```
+
+The default build mode is DEBUG. That is, objects and executables include debug information.
+
+The RELEASE build mode optimizes for speed. To build in this mode execute instead
+``` cmake .. -DCMAKE_BUILD_TYPE=RELEASE ```
+
+The release mode will be kept until next time cmake is executed.
+
+``` make -j $(nproc)``` 
+
+In case no errors are reported, the generated libraries (if any) will be located at the
+_lib_ folder and the executables (if any) will be located at the _bin_ folder.
+
+In order to be able to use the library, it it necessary to copy it into the system.
+To do that, execute
+
+``` make install ```
+
+as root and the shared libraries will be copied to */usr/local/lib/iri/segway_rmp_400* directory
+and the header files will be copied to */usr/local/include/iri/segway_rmp_400* directory. At
+this point, the library may be used by any user.
+
+To remove the library from the system, exceute
+
+``` make uninstall ```
+
+as root, and all the associated files will be removed from the system.
+
+To generate the documentation execute the following command:
+
+``` make doc ```
+
+## How to use it
+
+To use this library in another library or application, in the CMakeLists.txt file, first it is necessary to locate if the library has been installed or not using the following command
+
+``` FIND_PACKAGE(segway_rmp_400) ```
+
+In the case that the package is present, it is necessary to add the header files directory to the include directory path by using
+
+``` INCLUDE_DIRECTORIES(${segway_rmp_400_INCLUDE_DIR}) ```
+
+and it is also necessary to link with the desired libraries by using the following command
+
+``` TARGET_LINK_LIBRARIES(<executable name> ${segway_rmp_400_LIBRARY}) ```
+
+## Examples
+
+There are several examples that show how to use it.
+
+</p>
+</details>
\ No newline at end of file
diff --git a/ReadMe.txt b/ReadMe.txt
deleted file mode 100644
index d598803afb1927a434e90332e4479694a76c55ec..0000000000000000000000000000000000000000
--- a/ReadMe.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (C) 2009-2010 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
-Author cetto (cetto@iri.upc.edu)
-All rights reserved.
-
-This file is part of Segway RMP 400 driver library
-Segway RMP400 driver library is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>
-
-
diff --git a/src/segway_RMP400.h b/include/segway_RMP400.h
similarity index 100%
rename from src/segway_RMP400.h
rename to include/segway_RMP400.h
diff --git a/src/segway_RMP400_exception.h b/include/segway_RMP400_exception.h
similarity index 100%
rename from src/segway_RMP400_exception.h
rename to include/segway_RMP400_exception.h
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c35ef62e8cff5f3efe1216a62657c126e537edfc..fa4013d1c4723632e475d24320c86bab2a494163 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,7 +1,7 @@
 # edit the following line to add all the source code files of the library
 SET(sources segway_RMP400.cpp segway_RMP400_exception.cpp)
 # edit the following line to add all the header files of the library
-SET(headers segway_RMP400.h segway_RMP400_exception.h)
+SET(headers ../include/segway_RMP400.h ../include/segway_RMP400_exception.h)
 
 # edit the following line to find the necessary packages
 FIND_PACKAGE(iriutils REQUIRED)
@@ -9,25 +9,25 @@ FIND_PACKAGE(comm REQUIRED)
 FIND_PACKAGE(segway_rmp_200 REQUIRED)
 
 # edit the following line to add the necessary include directories
-INCLUDE_DIRECTORIES(.)
-INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIR})
-INCLUDE_DIRECTORIES(${comm_INCLUDE_DIR})
-INCLUDE_DIRECTORIES(${segway_rmp_200_INCLUDE_DIR})
+INCLUDE_DIRECTORIES(../include)
+INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES(${comm_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES(${segway_rmp_200_INCLUDE_DIRS})
 
 ADD_LIBRARY(segway_rmp_400 SHARED ${sources})
 
 #edit the following line to add the necessary system libraries (if any)
-TARGET_LINK_LIBRARIES(segway_rmp_400 ${iriutils_LIBRARY})
-TARGET_LINK_LIBRARIES(segway_rmp_400 ${comm_LIBRARY})
-TARGET_LINK_LIBRARIES(segway_rmp_400 ${segway_rmp_200_LIBRARY})
+TARGET_LINK_LIBRARIES(segway_rmp_400 ${iriutils_LIBRARIES})
+TARGET_LINK_LIBRARIES(segway_rmp_400 ${comm_LIBRARIES})
+TARGET_LINK_LIBRARIES(segway_rmp_400 ${segway_rmp_200_LIBRARIES})
 
 INSTALL(TARGETS segway_rmp_400
   RUNTIME DESTINATION bin
-  LIBRARY DESTINATION lib/iridrivers
-  ARCHIVE DESTINATION lib/iridrivers
+  LIBRARY DESTINATION lib/iri/${PROJECT_NAME}
+  ARCHIVE DESTINATION lib/iri/${PROJECT_NAME}
 )
 
-INSTALL(FILES ${headers} DESTINATION include/iridrivers)
+INSTALL(FILES ${headers} DESTINATION include/iri/${PROJECT_NAME})
 
 INSTALL(FILES ../Findsegway_rmp_400.cmake DESTINATION ${CMAKE_ROOT}/Modules/)