Commit 857b4e77 authored by Lorenz Halt's avatar Lorenz Halt 🔀
Browse files

fix install and dependencies

parent a855ee9a
......@@ -24,17 +24,17 @@ add_service_files(
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()
catkin_python_setup()
generate_messages(
DEPENDENCIES
std_msgs
ilc
)
catkin_package(
CATKIN_DEPENDS roscpp cppitasc message_runtime pitasc_library std_msgs
INCLUDE_DIRS include
CATKIN_DEPENDS roscpp cppitasc message_runtime pitasc_library
LIBRARIES ilc_controllers ilc_scripts
# DEPENDS system_lib
)
......@@ -48,9 +48,11 @@ include_directories(include
${Eigen_INCLUDE_DIRS}
)
add_library(ilc_controllers
src/ilc/controller_ilc.cpp
)
add_dependencies(ilc_controllers ${catkin_EXPORTED_TARGETS})
target_link_libraries(ilc_controllers
${catkin_LIBRARIES}
)
......@@ -59,6 +61,8 @@ target_link_libraries(ilc_controllers
add_library(ilc_scripts
src/ilc/scripts_ilc.cpp
)
add_dependencies(ilc_scripts ${catkin_EXPORTED_TARGETS})
add_dependencies(ilc_scripts ${${PROJECT_NAME}_EXPORTED_TARGETS})
target_link_libraries(ilc_scripts
${catkin_LIBRARIES}
)
......@@ -78,5 +82,8 @@ catkin_install_python(PROGRAMS
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY models apps launch etc ilc_controllers
# install(DIRECTORY include/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
install(DIRECTORY models apps launch etc
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
......@@ -13,10 +13,13 @@
<author email="lorenz.halt@ipa.fraunhofer.de">ipa-lth</author>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>message_generation</build_depend>
<build_export_depend>message_runtime</build_export_depend>
<exec_depend>message_runtime</exec_depend>
<exec_depend>pitasc</exec_depend>
<depend>std_msgs</depend>
<depend>roscpp</depend>
<depend>cppitasc</depend>
<depend>pitasc_library</depend>
......
......@@ -4,7 +4,7 @@ from __future__ import print_function
from ilc.srv import TriggerILC, TriggerILCResponse, RetimeILC, RetimeILCResponse, RetimeIfILC, RetimeIfILCResponse
import rospy
import numpy as np
import ilc_lib
from ilc import ilc_lib
import os
import argparse
......@@ -86,10 +86,10 @@ class Ilc_serviceproxy:
self.last_decay_time = self.decay_time
self.decay_time = req.setpoint_duration_ms
self.initialized = req.reuse_ff
if req.retime_scheme != 0:
self.reshape = True
print("Retiming Service received:\n{}".format(req))
return RetimeILCResponse(success=True, message="done")
......@@ -102,13 +102,14 @@ class Ilc_serviceproxy:
#print("Retiming Service received:\n{}".format(req))
try:
if (np.max(ilc_lib.error_convergence(self.data_diff)) < req.convergence_threshold):
print("Reducing trajectory time to {self.decay_time}")
self.last_decay_time = self.decay_time
self.decay_time = self.decay_time * req.retime_factor
self.initialized = req.reuse_ff
if req.retime_scheme != 0:
self.reshape = True
return RetimeIfILCResponse(success=True, message="reshaped")
else:
print("Convergence: {} > {}".format(np.max(ilc_lib.error_convergence(self.data_diff)), req.convergence_threshold))
......
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['ilc'],
package_dir={'': 'scripts'})
setup(**setup_args)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment