├── msg └── PidTune.msg ├── scripts ├── pid_lib.pyc ├── pid_tune_differential.py ├── pid_tune_gui.py ├── pid_lib.py └── pid_tune_drone.py ├── launch ├── pid_tune_diff.launch └── pid_tune_drone.launch ├── README.md ├── package.xml ├── .gitignore └── CMakeLists.txt /msg/PidTune.msg: -------------------------------------------------------------------------------- 1 | int16 Kp 2 | int16 Kd 3 | int16 Ki 4 | int16 Kp_z 5 | 6 | -------------------------------------------------------------------------------- /scripts/pid_lib.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simmubhangu/pid_tune/HEAD/scripts/pid_lib.pyc -------------------------------------------------------------------------------- /launch/pid_tune_diff.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /launch/pid_tune_drone.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /scripts/pid_tune_differential.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import rospy 3 | import time 4 | from pid_lib import * 5 | 6 | if __name__ == '__main__': 7 | 8 | rospy.init_node('Tune_pid_differential') 9 | lwheel_ui = rospy.get_param('~lpid_ui_enable',True) #set it as True if you need left_wheel ui 10 | rwheel_ui = rospy.get_param('~rpid_ui_enable',True) 11 | 12 | if lwheel_ui and rwheel_ui: 13 | lpid = Pid_dim("Left_wheel","lpid_params",1000) #Title of the ui, topic name of the publisher, queue size 14 | rpid = Pid_dim("Right_wheel","rpid_params",1000) 15 | lpid.root.mainloop() 16 | elif lwheel_ui: 17 | lpid = Pid_dim("Left_wheel","lpid_params",1000) 18 | lpid.root.mainloop() 19 | elif rwheel_ui: 20 | rpid = Pid_dim("Right_wheel","rpid_params",1000) 21 | rpid.root.mainloop() 22 | else: 23 | rospy.loginfo("UI DISABLED") 24 | -------------------------------------------------------------------------------- /scripts/pid_tune_gui.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | from Tkinter import * 3 | from pid_tune.msg import PidTune 4 | import rospy 5 | 6 | rospy.init_node('tune_pid') 7 | send_pid = rospy.Publisher('/pid_tuning', PidTune, queue_size=10) 8 | pid_value = PidTune() 9 | def set_value(): 10 | pid_value.Kp = scale.get() 11 | pid_value.Ki = scale1.get() 12 | pid_value.Kd = scale2.get() 13 | # pid_value.Kp_z = scale3.get() 14 | send_pid.publish(pid_value) 15 | # print scale.get(), scale1.get(), scale2.get() 16 | 17 | root = Tk() 18 | 19 | scale = Scale(root, orient='horizontal', from_=0, to=300, label= 'Kp',width = "50", length = "500",troughcolor="red") 20 | scale1 =Scale(root, orient='horizontal', from_=0, to=1000, label= 'Ki',width = "50", length = "500",troughcolor="green") 21 | scale2 =Scale(root, orient='horizontal', from_=0, to=100, label= 'Kd',width = "50", length = "500", troughcolor="blue") 22 | # scale3 =Scale(root, orient='horizontal', from_=0, to=300, label= 'Kp_z',width = "50", length = "500", troughcolor="gray") 23 | scale.pack() 24 | scale1.pack() 25 | scale2.pack() 26 | # scale3.pack() 27 | 28 | Button(root, text='set_value', command=set_value).pack() 29 | 30 | root.mainloop() 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ### Requirement for this package 3 | 1. tkinter python library. 4 | 5 | ```python 6 | sudo apt-get install python python-tk 7 | ``` 8 | [For more information visit here](http://www.greenteapress.com/thinkpython/swampy/install.html) 9 | 10 | ### How to use This package 11 | 1. Import the msg in your script. 12 | ```python 13 | from pid_tune.msg import PidTune 14 | ``` 15 | 2. Write the subscriber in the code. 16 | ```python 17 | rospy.Subscriber('/pid_tuning', PidTune, self.set_pid_value ) 18 | ``` 19 | 3. Get the Value and change the Gain values. 20 | ```python 21 | def set_pid_value(self,data): 22 | self.kp_x = data.Kp 23 | self.kp_y = data.Kp 24 | self.kp_z = data.Kp 25 | 26 | self.kd_x = data.Kd 27 | self.kd_y = data.Kd 28 | self.kd_z = data.Kd 29 | 30 | self.ki_x = data.Ki 31 | self.ki_y = data.Ki 32 | self.ki_z = data.Ki 33 | ``` 34 | 35 | ### Package information for tuning drone 36 | 37 | #### Publications: 38 | **/$pid_params** *(pid_tune/PidTune)*
39 | 40 | $ denotes corresponding letter for the pid. eg: ppid_params for pitch pid parameters 41 | 42 | ### launch the ros node by the following command 43 | + For differential drive robot, you can run the following node 44 | ``` 45 | roslaunch pid_tune pid_tune_diff.launch 46 | ``` 47 | + For drone, you can run the following node 48 | 49 | ``` 50 | roslaunch pid_tune pid_tune_drone.launch 51 | ``` 52 | ### Run the ros node by the following command 53 | + For differential drive robot, you can run the following node 54 | ``` 55 | rosrun pid_tune pid_tune_differential.py 56 | ``` 57 | + For drone, you can run the following node 58 | 59 | ``` 60 | rosrun pid_tune pid_tune_drone.py 61 | ``` 62 | 63 | -------------------------------------------------------------------------------- /scripts/pid_lib.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import tkinter as tk 4 | from tkinter import Scale 5 | 6 | import rospy 7 | from pid_tune.msg import PidTune 8 | 9 | 10 | class Pid_dim: 11 | def __init__(self, title, topic_name, queue_size): 12 | self.pub_pid = rospy.Publisher(topic_name, PidTune, queue_size=queue_size) 13 | self.pid_params = PidTune() 14 | 15 | self.root = tk.Tk() 16 | self.root.title(title) 17 | self.root.attributes("-topmost", True) 18 | self.root.geometry("250x210") 19 | 20 | self.scale = Scale( 21 | self.root, 22 | orient="horizontal", 23 | from_=0, 24 | to=5000, 25 | command=self.set_value, 26 | label="Kp", 27 | width="20", 28 | length="300", 29 | troughcolor="red", 30 | sliderlength="15", 31 | ) 32 | self.scale1 = Scale( 33 | self.root, 34 | orient="horizontal", 35 | from_=0, 36 | to=1000, 37 | command=self.set_value, 38 | label="Ki", 39 | width="20", 40 | length="300", 41 | troughcolor="green", 42 | sliderlength="15", 43 | ) 44 | self.scale2 = Scale( 45 | self.root, 46 | orient="horizontal", 47 | from_=0, 48 | to=5000, 49 | command=self.set_value, 50 | label="Kd", 51 | width="20", 52 | length="300", 53 | troughcolor="blue", 54 | sliderlength="15", 55 | ) 56 | 57 | self.scale.pack() 58 | self.scale1.pack() 59 | self.scale2.pack() 60 | 61 | def set_value(self, event): 62 | 63 | self.pid_params.Kp = self.scale.get() 64 | self.pid_params.Ki = self.scale1.get() 65 | self.pid_params.Kd = self.scale2.get() 66 | self.pub_pid.publish(self.pid_params) 67 | -------------------------------------------------------------------------------- /package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | pid_tune 4 | 0.0.0 5 | The pid_tune package 6 | 7 | 8 | 9 | 10 | simmu 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | catkin 52 | roscpp 53 | rospy 54 | std_msgs 55 | message_generation 56 | 57 | roscpp 58 | rospy 59 | std_msgs 60 | roscpp 61 | rospy 62 | std_msgs 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /scripts/pid_tune_drone.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import rospy 3 | import time 4 | from pid_lib import * 5 | 6 | if __name__ == '__main__': 7 | 8 | rospy.init_node('Tune_pid_drone') 9 | pitch_ui = rospy.get_param('~ppid_ui_enable',True) #set it as True if you need pitch pid ui 10 | roll_ui = rospy.get_param('~rpid_ui_enable',True) 11 | yaw_ui = rospy.get_param('~ypid_ui_enable',True) 12 | throttle_ui = rospy.get_param('~tpid_ui_enable',True) 13 | 14 | if pitch_ui and roll_ui and yaw_ui and throttle_ui : 15 | ppid = Pid_dim("Pitch","pid_tuning_pitch",1000) #Title of the ui, topic name of the publisher, queue size 16 | rpid = Pid_dim("Roll","pid_tuning_roll",1000) 17 | ypid = Pid_dim("Yaw","pid_tuning_yaw",1000) 18 | tpid = Pid_dim("Throttle","pid_tuning_altitude",1000) 19 | ppid.root.mainloop() 20 | 21 | elif pitch_ui and roll_ui and yaw_ui: 22 | ppid = Pid_dim("Pitch","pid_tuning_pitch",1000) #Title of the ui, topic name of the publisher, queue size 23 | rpid = Pid_dim("Roll","pid_tuning_roll",1000) 24 | ypid = Pid_dim("Yaw","pid_tuning_yaw",1000) 25 | ppid.root.mainloop() 26 | 27 | elif pitch_ui and roll_ui and throttle_ui: 28 | ppid = Pid_dim("Pitch","pid_tuning_pitch",1000) #Title of the ui, topic name of the publisher, queue size 29 | rpid = Pid_dim("Roll","pid_tuning_roll",1000) 30 | tpid = Pid_dim("Throttle","pid_tuning_altitude",1000) 31 | ppid.root.mainloop() 32 | 33 | elif pitch_ui and yaw_ui and throttle_ui: 34 | ppid = Pid_dim("Pitch","pid_tuning_pitch",1000) #Title of the ui, topic name of the publisher, queue size 35 | ypid = Pid_dim("Yaw","pid_tuning_yaw",1000) 36 | tpid = Pid_dim("Throttle","pid_tuning_altitude",1000) 37 | ppid.root.mainloop() 38 | 39 | elif roll_ui and yaw_ui and throttle_ui: 40 | rpid = Pid_dim("Roll","pid_tuning_roll",1000)#Title of the ui, topic name of the publisher, queue size 41 | ypid = Pid_dim("Yaw","pid_tuning_yaw",1000) 42 | tpid = Pid_dim("Throttle","pid_tuning_altitude",1000) 43 | rpid.root.mainloop() 44 | 45 | elif pitch_ui and roll_ui: 46 | ppid = Pid_dim("Pitch","pid_tuning_pitch",1000) #Title of the ui, topic name of the publisher, queue size 47 | rpid = Pid_dim("Roll","pid_tuning_roll",1000) 48 | ppid.root.mainloop() 49 | 50 | elif pitch_ui and yaw_ui: 51 | ppid = Pid_dim("Pitch","pid_tuning_pitch",1000) #Title of the ui, topic name of the publisher, queue size 52 | ypid = Pid_dim("Yaw","pid_tuning_yaw",1000) 53 | ppid.root.mainloop() 54 | 55 | elif pitch_ui and yaw_ui: 56 | ppid = Pid_dim("Pitch","pid_tuning_pitch",1000) #Title of the ui, topic name of the publisher, queue size 57 | tpid = Pid_dim("Throttle","pid_tuning_altitude",1000) 58 | ppid.root.mainloop() 59 | 60 | elif roll_ui and yaw_ui: 61 | rpid = Pid_dim("Roll","pid_tuning_roll",1000) 62 | ypid = Pid_dim("Yaw","pid_tuning_yaw",1000) 63 | rpid.root.mainloop() 64 | 65 | elif roll_ui and throttle_ui: 66 | rpid = Pid_dim("Roll","pid_tuning_roll",1000) 67 | tpid = Pid_dim("Throttle","pid_tuning_altitude",1000) 68 | rpid.root.mainloop() 69 | 70 | elif yaw_ui and throttle_ui: 71 | ypid = Pid_dim("Yaw","pid_tuning_yaw",1000) 72 | tpid = Pid_dim("Throttle","pid_tuning_altitude",1000) 73 | ypid.root.mainloop() 74 | 75 | elif pitch_ui: 76 | ppid = Pid_dim("Pitch","pid_tuning_pitch",1000) #Title of the ui, topic name of the publisher, queue size 77 | ppid.root.mainloop() 78 | 79 | elif roll_ui: 80 | rpid = Pid_dim("Roll","pid_tuning_roll",1000) 81 | rpid.root.mainloop() 82 | 83 | elif yaw_ui: 84 | ypid = Pid_dim("Yaw","pid_tuning_yaw",1000) 85 | ypid.root.mainloop() 86 | 87 | elif throttle_ui: 88 | tpid = Pid_dim("Throttle","pid_tuning_altitude",1000) 89 | tpid.root.mainloop() 90 | 91 | else: 92 | rospy.loginfo("UI DISABLED") 93 | 94 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.toptal.com/developers/gitignore/api/python 2 | # Edit at https://www.toptal.com/developers/gitignore?templates=python 3 | 4 | ### Python ### 5 | # Byte-compiled / optimized / DLL files 6 | __pycache__/ 7 | *.py[cod] 8 | *$py.class 9 | 10 | # C extensions 11 | *.so 12 | 13 | # Distribution / packaging 14 | .Python 15 | build/ 16 | develop-eggs/ 17 | dist/ 18 | downloads/ 19 | eggs/ 20 | .eggs/ 21 | lib/ 22 | lib64/ 23 | parts/ 24 | sdist/ 25 | var/ 26 | wheels/ 27 | share/python-wheels/ 28 | *.egg-info/ 29 | .installed.cfg 30 | *.egg 31 | MANIFEST 32 | 33 | # PyInstaller 34 | # Usually these files are written by a python script from a template 35 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 36 | *.manifest 37 | *.spec 38 | 39 | # Installer logs 40 | pip-log.txt 41 | pip-delete-this-directory.txt 42 | 43 | # Unit test / coverage reports 44 | htmlcov/ 45 | .tox/ 46 | .nox/ 47 | .coverage 48 | .coverage.* 49 | .cache 50 | nosetests.xml 51 | coverage.xml 52 | *.cover 53 | *.py,cover 54 | .hypothesis/ 55 | .pytest_cache/ 56 | cover/ 57 | 58 | # Translations 59 | *.mo 60 | *.pot 61 | 62 | # Django stuff: 63 | *.log 64 | local_settings.py 65 | db.sqlite3 66 | db.sqlite3-journal 67 | 68 | # Flask stuff: 69 | instance/ 70 | .webassets-cache 71 | 72 | # Scrapy stuff: 73 | .scrapy 74 | 75 | # Sphinx documentation 76 | docs/_build/ 77 | 78 | # PyBuilder 79 | .pybuilder/ 80 | target/ 81 | 82 | # Jupyter Notebook 83 | .ipynb_checkpoints 84 | 85 | # IPython 86 | profile_default/ 87 | ipython_config.py 88 | 89 | # pyenv 90 | # For a library or package, you might want to ignore these files since the code is 91 | # intended to run in multiple environments; otherwise, check them in: 92 | # .python-version 93 | 94 | # pipenv 95 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 96 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 97 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 98 | # install all needed dependencies. 99 | #Pipfile.lock 100 | 101 | # poetry 102 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 103 | # This is especially recommended for binary packages to ensure reproducibility, and is more 104 | # commonly ignored for libraries. 105 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 106 | #poetry.lock 107 | 108 | # pdm 109 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 110 | #pdm.lock 111 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 112 | # in version control. 113 | # https://pdm.fming.dev/#use-with-ide 114 | .pdm.toml 115 | 116 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 117 | __pypackages__/ 118 | 119 | # Celery stuff 120 | celerybeat-schedule 121 | celerybeat.pid 122 | 123 | # SageMath parsed files 124 | *.sage.py 125 | 126 | # Environments 127 | .env 128 | .venv 129 | env/ 130 | venv/ 131 | ENV/ 132 | env.bak/ 133 | venv.bak/ 134 | 135 | # Spyder project settings 136 | .spyderproject 137 | .spyproject 138 | 139 | # Rope project settings 140 | .ropeproject 141 | 142 | # mkdocs documentation 143 | /site 144 | 145 | # mypy 146 | .mypy_cache/ 147 | .dmypy.json 148 | dmypy.json 149 | 150 | # Pyre type checker 151 | .pyre/ 152 | 153 | # pytype static type analyzer 154 | .pytype/ 155 | 156 | # Cython debug symbols 157 | cython_debug/ 158 | 159 | # PyCharm 160 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 161 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 162 | # and can be added to the global gitignore or merged into this file. For a more nuclear 163 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 164 | #.idea/ 165 | 166 | # End of https://www.toptal.com/developers/gitignore/api/python 167 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(pid_tune) 3 | 4 | ## Compile as C++11, supported in ROS Kinetic and newer 5 | # add_compile_options(-std=c++11) 6 | 7 | ## Find catkin macros and libraries 8 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 9 | ## is used, also find other catkin packages 10 | find_package(catkin REQUIRED COMPONENTS 11 | roscpp 12 | rospy 13 | std_msgs 14 | message_generation 15 | ) 16 | 17 | ## System dependencies are found with CMake's conventions 18 | # find_package(Boost REQUIRED COMPONENTS system) 19 | 20 | 21 | ## Uncomment this if the package has a setup.py. This macro ensures 22 | ## modules and global scripts declared therein get installed 23 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 24 | # catkin_python_setup() 25 | 26 | ################################################ 27 | ## Declare ROS messages, services and actions ## 28 | ################################################ 29 | 30 | ## To declare and build messages, services or actions from within this 31 | ## package, follow these steps: 32 | ## * Let MSG_DEP_SET be the set of packages whose message types you use in 33 | ## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). 34 | ## * In the file package.xml: 35 | ## * add a build_depend tag for "message_generation" 36 | ## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET 37 | ## * If MSG_DEP_SET isn't empty the following dependency has been pulled in 38 | ## but can be declared for certainty nonetheless: 39 | ## * add a run_depend tag for "message_runtime" 40 | ## * In this file (CMakeLists.txt): 41 | ## * add "message_generation" and every package in MSG_DEP_SET to 42 | ## find_package(catkin REQUIRED COMPONENTS ...) 43 | ## * add "message_runtime" and every package in MSG_DEP_SET to 44 | ## catkin_package(CATKIN_DEPENDS ...) 45 | ## * uncomment the add_*_files sections below as needed 46 | ## and list every .msg/.srv/.action file to be processed 47 | ## * uncomment the generate_messages entry below 48 | ## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) 49 | 50 | ## Generate messages in the 'msg' folder 51 | add_message_files( 52 | FILES 53 | PidTune.msg 54 | ) 55 | 56 | ## Generate services in the 'srv' folder 57 | # add_service_files( 58 | # FILES 59 | # Service1.srv 60 | # Service2.srv 61 | # ) 62 | 63 | ## Generate actions in the 'action' folder 64 | # add_action_files( 65 | # FILES 66 | # Action1.action 67 | # Action2.action 68 | # ) 69 | 70 | ## Generate added messages and services with any dependencies listed here 71 | generate_messages( 72 | DEPENDENCIES 73 | std_msgs 74 | ) 75 | 76 | ################################################ 77 | ## Declare ROS dynamic reconfigure parameters ## 78 | ################################################ 79 | 80 | ## To declare and build dynamic reconfigure parameters within this 81 | ## package, follow these steps: 82 | ## * In the file package.xml: 83 | ## * add a build_depend and a run_depend tag for "dynamic_reconfigure" 84 | ## * In this file (CMakeLists.txt): 85 | ## * add "dynamic_reconfigure" to 86 | ## find_package(catkin REQUIRED COMPONENTS ...) 87 | ## * uncomment the "generate_dynamic_reconfigure_options" section below 88 | ## and list every .cfg file to be processed 89 | 90 | ## Generate dynamic reconfigure parameters in the 'cfg' folder 91 | # generate_dynamic_reconfigure_options( 92 | # cfg/DynReconf1.cfg 93 | # cfg/DynReconf2.cfg 94 | # ) 95 | 96 | ################################### 97 | ## catkin specific configuration ## 98 | ################################### 99 | ## The catkin_package macro generates cmake config files for your package 100 | ## Declare things to be passed to dependent projects 101 | ## INCLUDE_DIRS: uncomment this if your package contains header files 102 | ## LIBRARIES: libraries you create in this project that dependent projects also need 103 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 104 | ## DEPENDS: system dependencies of this project that dependent projects also need 105 | catkin_package( 106 | # INCLUDE_DIRS include 107 | # LIBRARIES pid_tune 108 | # CATKIN_DEPENDS roscpp rospy std_msgs 109 | # DEPENDS system_lib 110 | #message_runtime 111 | ) 112 | 113 | ########### 114 | ## Build ## 115 | ########### 116 | 117 | ## Specify additional locations of header files 118 | ## Your package locations should be listed before other locations 119 | include_directories( 120 | # include 121 | ${catkin_INCLUDE_DIRS} 122 | ) 123 | 124 | ## Declare a C++ library 125 | # add_library(${PROJECT_NAME} 126 | # src/${PROJECT_NAME}/pid_tune.cpp 127 | # ) 128 | 129 | ## Add cmake target dependencies of the library 130 | ## as an example, code may need to be generated before libraries 131 | ## either from message generation or dynamic reconfigure 132 | # add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 133 | 134 | ## Declare a C++ executable 135 | ## With catkin_make all packages are built within a single CMake context 136 | ## The recommended prefix ensures that target names across packages don't collide 137 | # add_executable(${PROJECT_NAME}_node src/pid_tune_node.cpp) 138 | 139 | ## Rename C++ executable without prefix 140 | ## The above recommended prefix causes long target names, the following renames the 141 | ## target back to the shorter version for ease of user use 142 | ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" 143 | # set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") 144 | 145 | ## Add cmake target dependencies of the executable 146 | ## same as for the library above 147 | # add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 148 | 149 | ## Specify libraries to link a library or executable target against 150 | # target_link_libraries(${PROJECT_NAME}_node 151 | # ${catkin_LIBRARIES} 152 | # ) 153 | 154 | ############# 155 | ## Install ## 156 | ############# 157 | 158 | # all install targets should use catkin DESTINATION variables 159 | # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html 160 | 161 | ## Mark executable scripts (Python etc.) for installation 162 | ## in contrast to setup.py, you can choose the destination 163 | # install(PROGRAMS 164 | # scripts/my_python_script 165 | # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 166 | # ) 167 | 168 | ## Mark executables and/or libraries for installation 169 | # install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node 170 | # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 171 | # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 172 | # RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 173 | # ) 174 | 175 | ## Mark cpp header files for installation 176 | # install(DIRECTORY include/${PROJECT_NAME}/ 177 | # DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 178 | # FILES_MATCHING PATTERN "*.h" 179 | # PATTERN ".svn" EXCLUDE 180 | # ) 181 | 182 | ## Mark other files for installation (e.g. launch and bag files, etc.) 183 | # install(FILES 184 | # # myfile1 185 | # # myfile2 186 | # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 187 | # ) 188 | 189 | ############# 190 | ## Testing ## 191 | ############# 192 | 193 | ## Add gtest based cpp test target and link libraries 194 | # catkin_add_gtest(${PROJECT_NAME}-test test/test_pid_tune.cpp) 195 | # if(TARGET ${PROJECT_NAME}-test) 196 | # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) 197 | # endif() 198 | 199 | ## Add folders to be run by python nosetests 200 | # catkin_add_nosetests(test) 201 | --------------------------------------------------------------------------------