From a6159ad727c0332fcf14a5c5c61fda5fe6360568 Mon Sep 17 00:00:00 2001 From: Kayman Date: Mon, 14 Aug 2017 16:48:46 +0900 Subject: [PATCH 01/66] added missing depend --- op3_demo/CMakeLists.txt | 7 ++++--- op3_demo/package.xml | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/op3_demo/CMakeLists.txt b/op3_demo/CMakeLists.txt index dc1fdea..53f21c4 100644 --- a/op3_demo/CMakeLists.txt +++ b/op3_demo/CMakeLists.txt @@ -13,6 +13,7 @@ find_package(catkin REQUIRED COMPONENTS sensor_msgs ball_detector op3_walking_module_msgs + robotis_controller_msgs cmake_modules robotis_math ) @@ -45,7 +46,7 @@ include_directories( ${Eigen_INCLUDE_DIRS} ) -add_executable(op_demo_node +add_executable(op_demo_node src/demo_node.cpp src/soccer/soccer_demo.cpp src/soccer/ball_tracker.cpp @@ -62,7 +63,7 @@ target_link_libraries(op_demo_node yaml-cpp ) -add_executable(self_test_node +add_executable(self_test_node src/test_node.cpp src/soccer/soccer_demo.cpp src/soccer/ball_tracker.cpp @@ -118,4 +119,4 @@ target_link_libraries(self_test_node ################################################################################ # Test -################################################################################ \ No newline at end of file +################################################################################ diff --git a/op3_demo/package.xml b/op3_demo/package.xml index b376b44..3e3c524 100644 --- a/op3_demo/package.xml +++ b/op3_demo/package.xml @@ -10,19 +10,21 @@ kayman Pyo - catkin + catkin roscpp roslib sensor_msgs ball_detector + robotis_controller_msgs op3_walking_module_msgs cmake_modules - robotis_math + robotis_math roscpp roslib sensor_msgs ball_detector + robotis_controller_msgs op3_walking_module_msgs cmake_modules robotis_math - \ No newline at end of file + From 76489376bfcc1a9b75663bb934dfddf7a2a8d227 Mon Sep 17 00:00:00 2001 From: zerom Date: Tue, 22 Aug 2017 09:31:03 +0900 Subject: [PATCH 02/66] Changing file permissions --- ball_detector/cfg/detector_params.cfg | 0 ball_detector/cfg/detector_params_blue.cfg | 0 ball_detector/cfg/detector_params_red.cfg | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 ball_detector/cfg/detector_params.cfg mode change 100644 => 100755 ball_detector/cfg/detector_params_blue.cfg mode change 100644 => 100755 ball_detector/cfg/detector_params_red.cfg diff --git a/ball_detector/cfg/detector_params.cfg b/ball_detector/cfg/detector_params.cfg old mode 100644 new mode 100755 diff --git a/ball_detector/cfg/detector_params_blue.cfg b/ball_detector/cfg/detector_params_blue.cfg old mode 100644 new mode 100755 diff --git a/ball_detector/cfg/detector_params_red.cfg b/ball_detector/cfg/detector_params_red.cfg old mode 100644 new mode 100755 From bea1e9993bad2247f54ebf3988c8590b3c0d3bde Mon Sep 17 00:00:00 2001 From: Yoshimaru Tanaka Date: Wed, 20 Sep 2017 19:49:40 +0900 Subject: [PATCH 03/66] Added dependency of op3_action_module_msgs in CMakeLists.txt. --- op3_demo/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/op3_demo/CMakeLists.txt b/op3_demo/CMakeLists.txt index dc1fdea..d8b3523 100644 --- a/op3_demo/CMakeLists.txt +++ b/op3_demo/CMakeLists.txt @@ -13,6 +13,7 @@ find_package(catkin REQUIRED COMPONENTS sensor_msgs ball_detector op3_walking_module_msgs + op3_action_module_msgs cmake_modules robotis_math ) @@ -118,4 +119,4 @@ target_link_libraries(self_test_node ################################################################################ # Test -################################################################################ \ No newline at end of file +################################################################################ From 59b786a27bf61f6c0c2194bed62426e52d57bc1a Mon Sep 17 00:00:00 2001 From: Kayman Date: Wed, 11 Oct 2017 17:09:11 +0900 Subject: [PATCH 04/66] added missing package in find_package() --- ball_detector/CMakeLists.txt | 34 +--------------------------------- op3_demo/CMakeLists.txt | 2 ++ op3_demo/package.xml | 4 ++++ 3 files changed, 7 insertions(+), 33 deletions(-) diff --git a/ball_detector/CMakeLists.txt b/ball_detector/CMakeLists.txt index a25b556..1e4219f 100644 --- a/ball_detector/CMakeLists.txt +++ b/ball_detector/CMakeLists.txt @@ -57,7 +57,7 @@ add_executable(ball_detector_node src/ball_detector.cpp src/ball_detector_node.cpp) -add_dependencies(ball_detector_node ${PROJECT_NAME}_gencfg) +add_dependencies(ball_detector_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) target_link_libraries(ball_detector_node ${catkin_LIBRARIES} @@ -68,38 +68,6 @@ target_link_libraries(ball_detector_node # Install ################################################################################ -# all install targets should use catkin DESTINATION variables -# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html - -## Mark executable scripts (Python etc.) for installation -## in contrast to setup.py, you can choose the destination -# install(PROGRAMS -# scripts/my_python_script -# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) - -## Mark executables and/or libraries for installation -# install(TARGETS ball_detector ball_detector_node -# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) - -## Mark cpp header files for installation -# install(DIRECTORY include/${PROJECT_NAME}/ -# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} -# FILES_MATCHING PATTERN "*.h" -# PATTERN ".svn" EXCLUDE -# ) - -## Mark other files for installation (e.g. launch and bag files, etc.) -# install(FILES -# # myfile1 -# # myfile2 -# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} -# ) - - ################################################################################ # Test ################################################################################ \ No newline at end of file diff --git a/op3_demo/CMakeLists.txt b/op3_demo/CMakeLists.txt index dc1fdea..ed60190 100644 --- a/op3_demo/CMakeLists.txt +++ b/op3_demo/CMakeLists.txt @@ -13,6 +13,8 @@ find_package(catkin REQUIRED COMPONENTS sensor_msgs ball_detector op3_walking_module_msgs + op3_action_module_msgs + robotis_controller_msgs cmake_modules robotis_math ) diff --git a/op3_demo/package.xml b/op3_demo/package.xml index b376b44..fd1b229 100644 --- a/op3_demo/package.xml +++ b/op3_demo/package.xml @@ -15,14 +15,18 @@ roslib sensor_msgs ball_detector + robotis_controller_msgs op3_walking_module_msgs + op3_action_module_msgs cmake_modules robotis_math roscpp roslib sensor_msgs ball_detector + robotis_controller_msgs op3_walking_module_msgs + op3_action_module_msgs cmake_modules robotis_math \ No newline at end of file From 8b350ee645d47e67f80419c4b0329a452059cc89 Mon Sep 17 00:00:00 2001 From: Kayman Date: Thu, 26 Oct 2017 19:51:28 +0900 Subject: [PATCH 05/66] Changed license from BSD to Apache2.0 --- LICENSE | 227 ++++++++++++++++-- .../include/ball_detector/ball_detector.h | 42 ++-- .../ball_detector/ball_detector_config.h | 42 ++-- ball_detector/package.xml | 2 +- ball_detector/src/ball_detector.cpp | 42 ++-- ball_detector/src/ball_detector_node.cpp | 42 ++-- op3_demo/include/op3_demo/action_demo.h | 42 ++-- op3_demo/include/op3_demo/ball_follower.h | 46 ++-- op3_demo/include/op3_demo/ball_tracker.h | 42 ++-- op3_demo/include/op3_demo/button_test.h | 42 ++-- op3_demo/include/op3_demo/face_tracker.h | 42 ++-- op3_demo/include/op3_demo/mic_test.h | 42 ++-- op3_demo/include/op3_demo/op_demo.h | 42 ++-- op3_demo/include/op3_demo/soccer_demo.h | 42 ++-- op3_demo/include/op3_demo/vision_demo.h | 42 ++-- op3_demo/package.xml | 2 +- op3_demo/src/action/action_demo.cpp | 42 ++-- op3_demo/src/demo_node.cpp | 42 ++-- op3_demo/src/soccer/ball_follower.cpp | 42 ++-- op3_demo/src/soccer/ball_tracker.cpp | 42 ++-- op3_demo/src/soccer/soccer_demo.cpp | 42 ++-- op3_demo/src/test/button_test.cpp | 42 ++-- op3_demo/src/test/mic_test.cpp | 42 ++-- op3_demo/src/test_node.cpp | 42 ++-- op3_demo/src/vision/face_tracker.cpp | 42 ++-- op3_demo/src/vision/vision_demo.cpp | 42 ++-- robotis_op3_demo/package.xml | 4 +- 27 files changed, 529 insertions(+), 676 deletions(-) diff --git a/LICENSE b/LICENSE index 5298325..c0ee812 100644 --- a/LICENSE +++ b/LICENSE @@ -1,26 +1,201 @@ -Software License Agreement (BSD License) - -Copyright (c) 2014, ROBOTIS Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of ROBOTIS nor the names of its contributors may be - used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY ROBOTIS "AS IS" AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL ROBOTIS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/ball_detector/include/ball_detector/ball_detector.h b/ball_detector/include/ball_detector/ball_detector.h index 578d9be..bb65988 100644 --- a/ball_detector/include/ball_detector/ball_detector.h +++ b/ball_detector/include/ball_detector/ball_detector.h @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/ball_detector/include/ball_detector/ball_detector_config.h b/ball_detector/include/ball_detector/ball_detector_config.h index 7182697..6062145 100644 --- a/ball_detector/include/ball_detector/ball_detector_config.h +++ b/ball_detector/include/ball_detector/ball_detector_config.h @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/ball_detector/package.xml b/ball_detector/package.xml index 62618a7..91ee2a7 100644 --- a/ball_detector/package.xml +++ b/ball_detector/package.xml @@ -7,7 +7,7 @@ It requires and input image and publish, at frame rate, a marked image and a stamped array of circle centers and radius. - BSD + Apache License 2.0 kayman Pyo diff --git a/ball_detector/src/ball_detector.cpp b/ball_detector/src/ball_detector.cpp index 77b00b9..c41c716 100644 --- a/ball_detector/src/ball_detector.cpp +++ b/ball_detector/src/ball_detector.cpp @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/ball_detector/src/ball_detector_node.cpp b/ball_detector/src/ball_detector_node.cpp index d54bb4e..7edfae6 100644 --- a/ball_detector/src/ball_detector_node.cpp +++ b/ball_detector/src/ball_detector_node.cpp @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/include/op3_demo/action_demo.h b/op3_demo/include/op3_demo/action_demo.h index e53b9c4..bae084b 100644 --- a/op3_demo/include/op3_demo/action_demo.h +++ b/op3_demo/include/op3_demo/action_demo.h @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/include/op3_demo/ball_follower.h b/op3_demo/include/op3_demo/ball_follower.h index 86b10fe..9e12ffc 100644 --- a/op3_demo/include/op3_demo/ball_follower.h +++ b/op3_demo/include/op3_demo/ball_follower.h @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ @@ -97,8 +83,8 @@ class BallFollower void setWalkingParam(double x_move, double y_move, double rotation_angle, bool balance = true); bool getWalkingParam(); void calcFootstep(double target_distance, double target_angle, double delta_time, - double& fb_move, double& rl_angle); - + double& fb_move, double& rl_angle); + //ros node handle ros::NodeHandle nh_; diff --git a/op3_demo/include/op3_demo/ball_tracker.h b/op3_demo/include/op3_demo/ball_tracker.h index 5c95762..2304a43 100644 --- a/op3_demo/include/op3_demo/ball_tracker.h +++ b/op3_demo/include/op3_demo/ball_tracker.h @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/include/op3_demo/button_test.h b/op3_demo/include/op3_demo/button_test.h index 2647911..127c978 100644 --- a/op3_demo/include/op3_demo/button_test.h +++ b/op3_demo/include/op3_demo/button_test.h @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/include/op3_demo/face_tracker.h b/op3_demo/include/op3_demo/face_tracker.h index 75389ee..a5b3ae8 100644 --- a/op3_demo/include/op3_demo/face_tracker.h +++ b/op3_demo/include/op3_demo/face_tracker.h @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/include/op3_demo/mic_test.h b/op3_demo/include/op3_demo/mic_test.h index aea0295..7cd025a 100644 --- a/op3_demo/include/op3_demo/mic_test.h +++ b/op3_demo/include/op3_demo/mic_test.h @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/include/op3_demo/op_demo.h b/op3_demo/include/op3_demo/op_demo.h index ee699b0..25641a0 100644 --- a/op3_demo/include/op3_demo/op_demo.h +++ b/op3_demo/include/op3_demo/op_demo.h @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/include/op3_demo/soccer_demo.h b/op3_demo/include/op3_demo/soccer_demo.h index 85f5837..d18343f 100644 --- a/op3_demo/include/op3_demo/soccer_demo.h +++ b/op3_demo/include/op3_demo/soccer_demo.h @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/include/op3_demo/vision_demo.h b/op3_demo/include/op3_demo/vision_demo.h index f652335..b50918d 100644 --- a/op3_demo/include/op3_demo/vision_demo.h +++ b/op3_demo/include/op3_demo/vision_demo.h @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/package.xml b/op3_demo/package.xml index 10ebf2e..68baa53 100644 --- a/op3_demo/package.xml +++ b/op3_demo/package.xml @@ -6,7 +6,7 @@ op3 default demo It includes three demontrations(soccer demo, vision demo, action script demo) - BSD + Apache License 2.0 kayman Pyo diff --git a/op3_demo/src/action/action_demo.cpp b/op3_demo/src/action/action_demo.cpp index b257ef5..68b84ff 100644 --- a/op3_demo/src/action/action_demo.cpp +++ b/op3_demo/src/action/action_demo.cpp @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/src/demo_node.cpp b/op3_demo/src/demo_node.cpp index 1be5377..fd6742a 100644 --- a/op3_demo/src/demo_node.cpp +++ b/op3_demo/src/demo_node.cpp @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/src/soccer/ball_follower.cpp b/op3_demo/src/soccer/ball_follower.cpp index c5b0e84..f59a23e 100644 --- a/op3_demo/src/soccer/ball_follower.cpp +++ b/op3_demo/src/soccer/ball_follower.cpp @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/src/soccer/ball_tracker.cpp b/op3_demo/src/soccer/ball_tracker.cpp index 3f4cde0..b7d9ad2 100644 --- a/op3_demo/src/soccer/ball_tracker.cpp +++ b/op3_demo/src/soccer/ball_tracker.cpp @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/src/soccer/soccer_demo.cpp b/op3_demo/src/soccer/soccer_demo.cpp index 394c3a1..d63622e 100644 --- a/op3_demo/src/soccer/soccer_demo.cpp +++ b/op3_demo/src/soccer/soccer_demo.cpp @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/src/test/button_test.cpp b/op3_demo/src/test/button_test.cpp index f5c2d61..415d182 100644 --- a/op3_demo/src/test/button_test.cpp +++ b/op3_demo/src/test/button_test.cpp @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/src/test/mic_test.cpp b/op3_demo/src/test/mic_test.cpp index dd0edfd..e1f6757 100644 --- a/op3_demo/src/test/mic_test.cpp +++ b/op3_demo/src/test/mic_test.cpp @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/src/test_node.cpp b/op3_demo/src/test_node.cpp index b1ab4a2..3ed2aa3 100644 --- a/op3_demo/src/test_node.cpp +++ b/op3_demo/src/test_node.cpp @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/src/vision/face_tracker.cpp b/op3_demo/src/vision/face_tracker.cpp index 2345b81..572eec2 100644 --- a/op3_demo/src/vision/face_tracker.cpp +++ b/op3_demo/src/vision/face_tracker.cpp @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/op3_demo/src/vision/vision_demo.cpp b/op3_demo/src/vision/vision_demo.cpp index ac205fa..5058ada 100644 --- a/op3_demo/src/vision/vision_demo.cpp +++ b/op3_demo/src/vision/vision_demo.cpp @@ -1,32 +1,18 @@ /******************************************************************************* - * Copyright (c) 2016, ROBOTIS CO., LTD. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * * Neither the name of ROBOTIS nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *******************************************************************************/ +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ /* Author: Kayman Jung */ diff --git a/robotis_op3_demo/package.xml b/robotis_op3_demo/package.xml index 112c0e7..bba5f7c 100644 --- a/robotis_op3_demo/package.xml +++ b/robotis_op3_demo/package.xml @@ -6,7 +6,7 @@ ROS packages for the robotis_op3_demo (meta package) - BSD + Apache License 2.0 Kayman Pyo @@ -21,4 +21,4 @@ - \ No newline at end of file + From 9559b06983f6364ce4c32504d8d767b01df4c8f6 Mon Sep 17 00:00:00 2001 From: Kayman Date: Wed, 8 Nov 2017 17:53:39 +0900 Subject: [PATCH 06/66] first commit for walking demo. --- .../launch/ball_detector_from_usb_cam.launch | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ball_detector/launch/ball_detector_from_usb_cam.launch b/ball_detector/launch/ball_detector_from_usb_cam.launch index 2ae61c6..1535edd 100644 --- a/ball_detector/launch/ball_detector_from_usb_cam.launch +++ b/ball_detector/launch/ball_detector_from_usb_cam.launch @@ -1,14 +1,15 @@ - + - - - + + + + @@ -16,6 +17,8 @@ + - + @@ -34,4 +37,3 @@ - From 72afe216cc310b2f0de1a09240b0d89e612c279c Mon Sep 17 00:00:00 2001 From: Kayman Date: Fri, 23 Feb 2018 14:14:32 +0900 Subject: [PATCH 07/66] added msg and srv for web setting tool applied test code --- ball_detector/CMakeLists.txt | 9 ++++++++- .../include/ball_detector/ball_detector.h | 4 ++++ ball_detector/msg/BallDetectorParams.msg | 16 ++++++++++++++++ ball_detector/src/ball_detector.cpp | 19 +++++++++++++++++++ ball_detector/srv/GetParameters.srv | 3 +++ ball_detector/srv/SetParameters.srv | 3 +++ 6 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 ball_detector/msg/BallDetectorParams.msg create mode 100644 ball_detector/srv/GetParameters.srv create mode 100644 ball_detector/srv/SetParameters.srv diff --git a/ball_detector/CMakeLists.txt b/ball_detector/CMakeLists.txt index 1e4219f..6e4d658 100644 --- a/ball_detector/CMakeLists.txt +++ b/ball_detector/CMakeLists.txt @@ -24,6 +24,13 @@ find_package(catkin REQUIRED COMPONENTS add_message_files( FILES circleSetStamped.msg + BallDetectorParams.msg +) + +add_service_files( + FILES + GetParameters.srv + SetParameters.srv ) generate_messages( @@ -70,4 +77,4 @@ target_link_libraries(ball_detector_node ################################################################################ # Test -################################################################################ \ No newline at end of file +################################################################################ diff --git a/ball_detector/include/ball_detector/ball_detector.h b/ball_detector/include/ball_detector/ball_detector.h index bb65988..ad147a5 100644 --- a/ball_detector/include/ball_detector/ball_detector.h +++ b/ball_detector/include/ball_detector/ball_detector.h @@ -27,6 +27,7 @@ //ros dependencies #include #include +#include #include #include #include @@ -70,6 +71,8 @@ class BallDetector void dynParamCallback(ball_detector::detectorParamsConfig &config, uint32_t level); void enableCallback(const std_msgs::Bool::ConstPtr &msg); + void paramCommandCallback(const std_msgs::String::ConstPtr &msg); + void printConfig(); void saveConfig(); void setInputImage(const cv::Mat & inIm); @@ -86,6 +89,7 @@ class BallDetector ros::NodeHandle nh_; ros::Subscriber enable_sub_; + ros::Subscriber param_command_sub_; //image publisher/subscriber image_transport::ImageTransport it_; diff --git a/ball_detector/msg/BallDetectorParams.msg b/ball_detector/msg/BallDetectorParams.msg new file mode 100644 index 0000000..e72a4ad --- /dev/null +++ b/ball_detector/msg/BallDetectorParams.msg @@ -0,0 +1,16 @@ +# This represents the parameters of ball_detector + +uint32 gaussian_blur_size # only odd number, 1 - 11 +float32 gaussian_blur_sigma # 1 - 5 +float32 canny_edge_th # 50 - 200 +float32 hough_accum_resolution # 1 - 8 +float32 hough_accum_th # 10 - 200 +float32 min_circle_dist # 10 - 200 +uint32 min_radius # 10 - 200 +uint32 max_radius # 100 - 600 +uint32 filter_h_min # 0 - 359 +uint32 filter_h_max +uint32 filter_s_min # 0 - 255 +uint32 filter_s_max +uint32 filter_v_min # 0 - 255 +uint32 filter_v_max diff --git a/ball_detector/src/ball_detector.cpp b/ball_detector/src/ball_detector.cpp index c41c716..3b54a6c 100644 --- a/ball_detector/src/ball_detector.cpp +++ b/ball_detector/src/ball_detector.cpp @@ -79,6 +79,7 @@ BallDetector::BallDetector() enable_sub_ = nh_.subscribe("enable", 1, &BallDetector::enableCallback, this); image_sub_ = it_.subscribe("image_in", 1, &BallDetector::imageCallback, this); camera_info_sub_ = nh_.subscribe("cameraInfo_in", 100, &BallDetector::cameraInfoCallback, this); + param_command_sub_ = nh_.subscribe("param_command", 1, &BallDetector::paramCommandCallback, this); //initializes newImageFlag new_image_flag_ = false; @@ -260,6 +261,24 @@ void BallDetector::cameraInfoCallback(const sensor_msgs::CameraInfo & msg) camera_info_msg_ = msg; } +void BallDetector::paramCommandCallback(const std_msgs::String::ConstPtr &msg) +{ + if(msg->data == "debug") + { + params_config_.debug = true; + saveConfig(); + } + else if(msg->data == "normal") + { + params_config_.debug = false; + saveConfig(); + } + else if(msg->data == "reset") + { + // load default parameters and apply + } +} + void BallDetector::printConfig() { if (init_param_ == false) diff --git a/ball_detector/srv/GetParameters.srv b/ball_detector/srv/GetParameters.srv new file mode 100644 index 0000000..eea6f98 --- /dev/null +++ b/ball_detector/srv/GetParameters.srv @@ -0,0 +1,3 @@ + +--- +BallDetectorParams returns diff --git a/ball_detector/srv/SetParameters.srv b/ball_detector/srv/SetParameters.srv new file mode 100644 index 0000000..0cb13ed --- /dev/null +++ b/ball_detector/srv/SetParameters.srv @@ -0,0 +1,3 @@ +BallDetectorParams params +--- +BallDetectorParams returns From 40d99493da3b2b325b6a4db61093e6bde6deeef7 Mon Sep 17 00:00:00 2001 From: Kayman Date: Fri, 23 Feb 2018 14:16:52 +0900 Subject: [PATCH 08/66] changed some for web setting --- ball_detector/launch/ball_detector_from_usb_cam.launch | 3 +-- op3_demo/launch/demo.launch | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ball_detector/launch/ball_detector_from_usb_cam.launch b/ball_detector/launch/ball_detector_from_usb_cam.launch index 1535edd..0809458 100644 --- a/ball_detector/launch/ball_detector_from_usb_cam.launch +++ b/ball_detector/launch/ball_detector_from_usb_cam.launch @@ -17,8 +17,7 @@ - + - + + + + + From 72933c92ea084ffbe68ddedeb5ae44d01f3d27d8 Mon Sep 17 00:00:00 2001 From: Kayman Date: Fri, 23 Feb 2018 16:24:03 +0900 Subject: [PATCH 09/66] added service for setting ball_detector params --- .../include/ball_detector/ball_detector.h | 10 +++- ball_detector/src/ball_detector.cpp | 48 +++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/ball_detector/include/ball_detector/ball_detector.h b/ball_detector/include/ball_detector/ball_detector.h index ad147a5..e8fff30 100644 --- a/ball_detector/include/ball_detector/ball_detector.h +++ b/ball_detector/include/ball_detector/ball_detector.h @@ -37,6 +37,8 @@ #include "ball_detector/circleSetStamped.h" #include "ball_detector/ball_detector_config.h" #include "ball_detector/detectorParamsConfig.h" +#include "ball_detector/GetParameters.h" +#include "ball_detector/SetParameters.h" namespace robotis_op { @@ -72,6 +74,8 @@ class BallDetector void enableCallback(const std_msgs::Bool::ConstPtr &msg); void paramCommandCallback(const std_msgs::String::ConstPtr &msg); + bool setParamCallback(ball_detector::SetParameters::Request &req, ball_detector::SetParameters::Response &res); + bool getParamCallback(ball_detector::GetParameters::Request &req, ball_detector::GetParameters::Response &res); void printConfig(); void saveConfig(); @@ -89,7 +93,6 @@ class BallDetector ros::NodeHandle nh_; ros::Subscriber enable_sub_; - ros::Subscriber param_command_sub_; //image publisher/subscriber image_transport::ImageTransport it_; @@ -116,6 +119,11 @@ class BallDetector std::string param_path_; bool has_path_; + // web setting + ros::Subscriber param_command_sub_; + ros::ServiceServer get_param_client_; + ros::ServiceServer set_param_client_; + //flag indicating a new image has been received bool new_image_flag_; diff --git a/ball_detector/src/ball_detector.cpp b/ball_detector/src/ball_detector.cpp index 3b54a6c..0d387db 100644 --- a/ball_detector/src/ball_detector.cpp +++ b/ball_detector/src/ball_detector.cpp @@ -88,6 +88,10 @@ BallDetector::BallDetector() callback_fnc_ = boost::bind(&BallDetector::dynParamCallback, this, _1, _2); param_server_.setCallback(callback_fnc_); + // web setting + set_param_client_ = nh_.advertiseService("set_param", &BallDetector::setParamCallback, this); + get_param_client_ = nh_.advertiseService("get_param", &BallDetector::getParamCallback, this); + //sets config and prints it params_config_ = detect_config; init_param_ = true; @@ -279,6 +283,50 @@ void BallDetector::paramCommandCallback(const std_msgs::String::ConstPtr &msg) } } +bool BallDetector::setParamCallback(ball_detector::SetParameters::Request &req, ball_detector::SetParameters::Response &res) +{ + params_config_.gaussian_blur_size = req.params.gaussian_blur_size; + params_config_.gaussian_blur_sigma = req.params.gaussian_blur_sigma; + params_config_.canny_edge_th = req.params.canny_edge_th; + params_config_.hough_accum_resolution = req.params.hough_accum_resolution; + params_config_.min_circle_dist = req.params.min_circle_dist; + params_config_.hough_accum_th = req.params.hough_accum_th; + params_config_.min_radius = req.params.min_radius; + params_config_.max_radius = req.params.max_radius; + params_config_.filter_threshold.h_min = req.params.filter_h_min; + params_config_.filter_threshold.h_max = req.params.filter_h_max; + params_config_.filter_threshold.s_min = req.params.filter_s_min; + params_config_.filter_threshold.s_max = req.params.filter_s_max; + params_config_.filter_threshold.v_min = req.params.filter_v_min; + params_config_.filter_threshold.v_max = req.params.filter_v_max; + + saveConfig(); + + res.returns = req.params; + + return true; +} + +bool BallDetector::getParamCallback(ball_detector::GetParameters::Request &req, ball_detector::GetParameters::Response &res) +{ + res.returns.gaussian_blur_size = params_config_.gaussian_blur_size; + res.returns.gaussian_blur_sigma = params_config_.gaussian_blur_sigma; + res.returns.canny_edge_th = params_config_.canny_edge_th; + res.returns.hough_accum_resolution = params_config_.hough_accum_resolution; + res.returns.min_circle_dist = params_config_.min_circle_dist; + res.returns.hough_accum_th = params_config_.hough_accum_th; + res.returns.min_radius = params_config_.min_radius; + res.returns.max_radius = params_config_.max_radius; + res.returns.filter_h_min = params_config_.filter_threshold.h_min; + res.returns.filter_h_max = params_config_.filter_threshold.h_max; + res.returns.filter_s_min = params_config_.filter_threshold.s_min; + res.returns.filter_s_max = params_config_.filter_threshold.s_max; + res.returns.filter_v_min = params_config_.filter_threshold.v_min; + res.returns.filter_v_max = params_config_.filter_threshold.v_max; + + return true; +} + void BallDetector::printConfig() { if (init_param_ == false) From d1248b8e84f7a0c8b8d4aa93ca8f42ef8380766a Mon Sep 17 00:00:00 2001 From: Kayman Date: Fri, 23 Feb 2018 20:33:09 +0900 Subject: [PATCH 10/66] added function of reset param changed default parameter value --- ball_detector/CMakeLists.txt | 1 + .../include/ball_detector/ball_detector.h | 5 + .../launch/ball_detector_params_default.yaml | 16 +-- ball_detector/package.xml | 4 +- ball_detector/src/ball_detector.cpp | 110 +++++++++++++++--- 5 files changed, 110 insertions(+), 26 deletions(-) diff --git a/ball_detector/CMakeLists.txt b/ball_detector/CMakeLists.txt index 6e4d658..a79af76 100644 --- a/ball_detector/CMakeLists.txt +++ b/ball_detector/CMakeLists.txt @@ -8,6 +8,7 @@ project(ball_detector) # Packages ################################################################################ find_package(catkin REQUIRED COMPONENTS + roslib cv_bridge geometry_msgs image_transport diff --git a/ball_detector/include/ball_detector/ball_detector.h b/ball_detector/include/ball_detector/ball_detector.h index e8fff30..6e0a3ef 100644 --- a/ball_detector/include/ball_detector/ball_detector.h +++ b/ball_detector/include/ball_detector/ball_detector.h @@ -26,6 +26,7 @@ //ros dependencies #include +#include #include #include #include @@ -76,6 +77,8 @@ class BallDetector void paramCommandCallback(const std_msgs::String::ConstPtr &msg); bool setParamCallback(ball_detector::SetParameters::Request &req, ball_detector::SetParameters::Response &res); bool getParamCallback(ball_detector::GetParameters::Request &req, ball_detector::GetParameters::Response &res); + void resetParameter(); + void publishParam(); void printConfig(); void saveConfig(); @@ -120,6 +123,8 @@ class BallDetector bool has_path_; // web setting + std::string default_setting_path_; + ros::Publisher param_pub_; ros::Subscriber param_command_sub_; ros::ServiceServer get_param_client_; ros::ServiceServer set_param_client_; diff --git a/ball_detector/launch/ball_detector_params_default.yaml b/ball_detector/launch/ball_detector_params_default.yaml index 7310922..a97969a 100644 --- a/ball_detector/launch/ball_detector_params_default.yaml +++ b/ball_detector/launch/ball_detector_params_default.yaml @@ -1,16 +1,16 @@ gaussian_blur_size: 7 -gaussian_blur_sigma: 2.52 -canny_edge_th: 100.5 +gaussian_blur_sigma: 2.0 +canny_edge_th: 100 hough_accum_resolution: 1 -min_circle_dist: 28.5 -hough_accum_th: 26.6 -min_radius: 25 -max_radius: 150 +min_circle_dist: 100 +hough_accum_th: 28 +min_radius: 20 +max_radius: 300 filter_h_min: 350 filter_h_max: 20 -filter_s_min: 90 +filter_s_min: 220 filter_s_max: 255 -filter_v_min: 86 +filter_v_min: 30 filter_v_max: 255 use_second_filter: true filter2_h_min: 30 diff --git a/ball_detector/package.xml b/ball_detector/package.xml index 91ee2a7..79f988f 100644 --- a/ball_detector/package.xml +++ b/ball_detector/package.xml @@ -11,7 +11,8 @@ kayman Pyo - catkin + catkin + roslib cv_bridge geometry_msgs image_transport @@ -20,6 +21,7 @@ std_msgs dynamic_reconfigure message_generation + roslib cv_bridge geometry_msgs image_transport diff --git a/ball_detector/src/ball_detector.cpp b/ball_detector/src/ball_detector.cpp index 0d387db..55aa21e 100644 --- a/ball_detector/src/ball_detector.cpp +++ b/ball_detector/src/ball_detector.cpp @@ -25,12 +25,12 @@ namespace robotis_op { BallDetector::BallDetector() - : nh_(ros::this_node::getName()), - it_(this->nh_), - enable_(true), - params_config_(), - init_param_(false), - not_found_count_(0) + : nh_(ros::this_node::getName()), + it_(this->nh_), + enable_(true), + params_config_(), + init_param_(false), + not_found_count_(0) { has_path_ = nh_.getParam("yaml_path", param_path_); @@ -79,7 +79,6 @@ BallDetector::BallDetector() enable_sub_ = nh_.subscribe("enable", 1, &BallDetector::enableCallback, this); image_sub_ = it_.subscribe("image_in", 1, &BallDetector::imageCallback, this); camera_info_sub_ = nh_.subscribe("cameraInfo_in", 100, &BallDetector::cameraInfoCallback, this); - param_command_sub_ = nh_.subscribe("param_command", 1, &BallDetector::paramCommandCallback, this); //initializes newImageFlag new_image_flag_ = false; @@ -89,8 +88,11 @@ BallDetector::BallDetector() param_server_.setCallback(callback_fnc_); // web setting + param_pub_ = nh_.advertise("current_params", 1); + param_command_sub_ = nh_.subscribe("param_command", 1, &BallDetector::paramCommandCallback, this); set_param_client_ = nh_.advertiseService("set_param", &BallDetector::setParamCallback, this); get_param_client_ = nh_.advertiseService("get_param", &BallDetector::getParamCallback, this); + default_setting_path_ = ros::package::getPath(ROS_PACKAGE_NAME) + "/launch/ball_detector_params_default.yaml"; //sets config and prints it params_config_ = detect_config; @@ -145,15 +147,15 @@ void BallDetector::publishImage() cv_img_pub_.header.frame_id = image_frame_id_; switch (img_encoding_) { - case IMG_RGB8: - cv_img_pub_.encoding = sensor_msgs::image_encodings::RGB8; - break; - case IMG_MONO: - cv_img_pub_.encoding = sensor_msgs::image_encodings::MONO8; - break; - default: - cv_img_pub_.encoding = sensor_msgs::image_encodings::MONO8; - break; + case IMG_RGB8: + cv_img_pub_.encoding = sensor_msgs::image_encodings::RGB8; + break; + case IMG_MONO: + cv_img_pub_.encoding = sensor_msgs::image_encodings::MONO8; + break; + default: + cv_img_pub_.encoding = sensor_msgs::image_encodings::MONO8; + break; } getOutputImage(cv_img_pub_.image); image_pub_.publish(cv_img_pub_.toImageMsg()); @@ -307,7 +309,7 @@ bool BallDetector::setParamCallback(ball_detector::SetParameters::Request &req, return true; } -bool BallDetector::getParamCallback(ball_detector::GetParameters::Request &req, ball_detector::GetParameters::Response &res) +bool BallDetector:: getParamCallback(ball_detector::GetParameters::Request &req, ball_detector::GetParameters::Response &res) { res.returns.gaussian_blur_size = params_config_.gaussian_blur_size; res.returns.gaussian_blur_sigma = params_config_.gaussian_blur_sigma; @@ -327,6 +329,80 @@ bool BallDetector::getParamCallback(ball_detector::GetParameters::Request &req, return true; } +void BallDetector::resetParameter() +{ + + YAML::Node doc; + + try + { + // load yaml + doc = YAML::LoadFile(default_setting_path_.c_str()); + + // parse + params_config_.gaussian_blur_size = doc["gaussian_blur_size"].as(); + params_config_.gaussian_blur_sigma = doc["gaussian_blur_sigma"].as(); + params_config_.canny_edge_th = doc["canny_edge_th"].as(); + params_config_.hough_accum_resolution = doc["hough_accum_resolution"].as(); + params_config_.min_circle_dist = doc["min_circle_dist"].as(); + params_config_.hough_accum_th = doc["hough_accum_th"].as(); + params_config_.min_radius = doc["min_radius"].as(); + params_config_.max_radius = doc["max_radius"].as(); + params_config_.filter_threshold.h_min = doc["filter_h_min"].as(); + params_config_.filter_threshold.h_max = doc["filter_h_max"].as(); + params_config_.filter_threshold.s_min = doc["filter_s_min"].as(); + params_config_.filter_threshold.s_max = doc["filter_s_max"].as(); + params_config_.filter_threshold.v_min = doc["filter_v_min"].as(); + params_config_.filter_threshold.v_max = doc["filter_v_max"].as(); + params_config_.use_second_filter = doc["use_second_filter"].as(); + params_config_.filter2_threshold.h_min = doc["filter2_h_min"].as(); + params_config_.filter2_threshold.h_max = doc["filter2_h_max"].as(); + params_config_.filter2_threshold.s_min = doc["filter2_s_min"].as(); + params_config_.filter2_threshold.s_max = doc["filter2_s_max"].as(); + params_config_.filter2_threshold.v_min = doc["filter2_v_min"].as(); + params_config_.filter2_threshold.v_max = doc["filter2_v_max"].as(); + params_config_.ellipse_size = doc["ellipse_size"].as(); + params_config_.debug = doc["filter_debug"].as(); + + // gaussian_blur has to be odd number. + if (params_config_.gaussian_blur_size % 2 == 0) + params_config_.gaussian_blur_size -= 1; + if (params_config_.gaussian_blur_size <= 0) + params_config_.gaussian_blur_size = 1; + + printConfig(); + saveConfig(); + + publishParam(); + } catch (const std::exception& e) + { + ROS_ERROR_STREAM("Failed to Get default parameters : " << default_setting_path_); + return; + } +} + +void BallDetector::publishParam() +{ + ball_detector::BallDetectorParams params; + + params.gaussian_blur_size = params_config_.gaussian_blur_size; + params.gaussian_blur_sigma = params_config_.gaussian_blur_sigma; + params.canny_edge_th = params_config_.canny_edge_th; + params.hough_accum_resolution = params_config_.hough_accum_resolution; + params.min_circle_dist = params_config_.min_circle_dist; + params.hough_accum_th = params_config_.hough_accum_th; + params.min_radius = params_config_.min_radius; + params.max_radius = params_config_.max_radius; + params.filter_h_min = params_config_.filter_threshold.h_min; + params.filter_h_max = params_config_.filter_threshold.h_max; + params.filter_s_min = params_config_.filter_threshold.s_min; + params.filter_s_max = params_config_.filter_threshold.s_max; + params.filter_v_min = params_config_.filter_threshold.v_min; + params.filter_v_max = params_config_.filter_threshold.v_max; + + param_pub_.publish(params); +} + void BallDetector::printConfig() { if (init_param_ == false) From e1f3607568848be117a314b2906ebc3b33b92f83 Mon Sep 17 00:00:00 2001 From: Kayman Date: Fri, 23 Feb 2018 20:41:24 +0900 Subject: [PATCH 11/66] fixed some line --- ball_detector/src/ball_detector.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ball_detector/src/ball_detector.cpp b/ball_detector/src/ball_detector.cpp index 55aa21e..945654b 100644 --- a/ball_detector/src/ball_detector.cpp +++ b/ball_detector/src/ball_detector.cpp @@ -282,6 +282,7 @@ void BallDetector::paramCommandCallback(const std_msgs::String::ConstPtr &msg) else if(msg->data == "reset") { // load default parameters and apply + resetParameter(); } } From c064c779e1158eb73240c5ea8e59666d7ef601e5 Mon Sep 17 00:00:00 2001 From: Kayman Date: Fri, 23 Feb 2018 21:03:49 +0900 Subject: [PATCH 12/66] added missing parameter --- ball_detector/launch/ball_detector_params_default.yaml | 4 ++-- ball_detector/msg/BallDetectorParams.msg | 1 + ball_detector/src/ball_detector.cpp | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ball_detector/launch/ball_detector_params_default.yaml b/ball_detector/launch/ball_detector_params_default.yaml index a97969a..be36dee 100644 --- a/ball_detector/launch/ball_detector_params_default.yaml +++ b/ball_detector/launch/ball_detector_params_default.yaml @@ -12,7 +12,7 @@ filter_s_min: 220 filter_s_max: 255 filter_v_min: 30 filter_v_max: 255 -use_second_filter: true +use_second_filter: false filter2_h_min: 30 filter2_h_max: 355 filter2_s_min: 0 @@ -20,4 +20,4 @@ filter2_s_max: 40 filter2_v_min: 200 filter2_v_max: 255 ellipse_size: 1 -filter_debug: false \ No newline at end of file +filter_debug: false diff --git a/ball_detector/msg/BallDetectorParams.msg b/ball_detector/msg/BallDetectorParams.msg index e72a4ad..cd1c210 100644 --- a/ball_detector/msg/BallDetectorParams.msg +++ b/ball_detector/msg/BallDetectorParams.msg @@ -14,3 +14,4 @@ uint32 filter_s_min # 0 - 255 uint32 filter_s_max uint32 filter_v_min # 0 - 255 uint32 filter_v_max +uint32 ellipse_size # 1 - 9 diff --git a/ball_detector/src/ball_detector.cpp b/ball_detector/src/ball_detector.cpp index 945654b..a38c2b7 100644 --- a/ball_detector/src/ball_detector.cpp +++ b/ball_detector/src/ball_detector.cpp @@ -302,6 +302,7 @@ bool BallDetector::setParamCallback(ball_detector::SetParameters::Request &req, params_config_.filter_threshold.s_max = req.params.filter_s_max; params_config_.filter_threshold.v_min = req.params.filter_v_min; params_config_.filter_threshold.v_max = req.params.filter_v_max; + params_config_.ellipse_size = req.params.ellipse_size; saveConfig(); @@ -326,6 +327,7 @@ bool BallDetector:: getParamCallback(ball_detector::GetParameters::Request &req, res.returns.filter_s_max = params_config_.filter_threshold.s_max; res.returns.filter_v_min = params_config_.filter_threshold.v_min; res.returns.filter_v_max = params_config_.filter_threshold.v_max; + res.returns.ellipse_size = params_config_.ellipse_size; return true; } @@ -400,6 +402,7 @@ void BallDetector::publishParam() params.filter_s_max = params_config_.filter_threshold.s_max; params.filter_v_min = params_config_.filter_threshold.v_min; params.filter_v_max = params_config_.filter_threshold.v_max; + params.filter_v_max = params_config_.ellipse_size; param_pub_.publish(params); } From 390866a7557ca2e8f49430f890056fa9ed204953 Mon Sep 17 00:00:00 2001 From: Kayman Date: Fri, 23 Feb 2018 21:04:24 +0900 Subject: [PATCH 13/66] changed default params --- ball_detector/launch/ball_detector_params.yaml | 14 +++++++------- .../launch/ball_detector_params_default.yaml | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ball_detector/launch/ball_detector_params.yaml b/ball_detector/launch/ball_detector_params.yaml index 86bd8e9..dd4c366 100644 --- a/ball_detector/launch/ball_detector_params.yaml +++ b/ball_detector/launch/ball_detector_params.yaml @@ -6,18 +6,18 @@ min_circle_dist: 100 hough_accum_th: 28 min_radius: 20 max_radius: 300 -filter_h_min: 350 -filter_h_max: 20 -filter_s_min: 230 +filter_h_min: 247 +filter_h_max: 221 +filter_s_min: 220 filter_s_max: 255 filter_v_min: 30 filter_v_max: 255 use_second_filter: false filter2_h_min: 40 filter2_h_max: 345 -filter2_s_min: 0 -filter2_s_max: 44 +filter2_s_min: 1 +filter2_s_max: 45 filter2_v_min: 90 filter2_v_max: 255 -ellipse_size: 3 -filter_debug: false \ No newline at end of file +ellipse_size: 5 +filter_debug: true \ No newline at end of file diff --git a/ball_detector/launch/ball_detector_params_default.yaml b/ball_detector/launch/ball_detector_params_default.yaml index a97969a..439d4f1 100644 --- a/ball_detector/launch/ball_detector_params_default.yaml +++ b/ball_detector/launch/ball_detector_params_default.yaml @@ -10,9 +10,9 @@ filter_h_min: 350 filter_h_max: 20 filter_s_min: 220 filter_s_max: 255 -filter_v_min: 30 +filter_v_min: 80 filter_v_max: 255 -use_second_filter: true +use_second_filter: false filter2_h_min: 30 filter2_h_max: 355 filter2_s_min: 0 From a6480f8c802b4b37f4b0029e34704753ba44491c Mon Sep 17 00:00:00 2001 From: Kayman Date: Fri, 23 Feb 2018 21:14:05 +0900 Subject: [PATCH 14/66] fixed typo --- ball_detector/src/ball_detector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ball_detector/src/ball_detector.cpp b/ball_detector/src/ball_detector.cpp index a38c2b7..fb37112 100644 --- a/ball_detector/src/ball_detector.cpp +++ b/ball_detector/src/ball_detector.cpp @@ -402,7 +402,7 @@ void BallDetector::publishParam() params.filter_s_max = params_config_.filter_threshold.s_max; params.filter_v_min = params_config_.filter_threshold.v_min; params.filter_v_max = params_config_.filter_threshold.v_max; - params.filter_v_max = params_config_.ellipse_size; + params.ellipse_size = params_config_.ellipse_size; param_pub_.publish(params); } From a4eec6160ee8ffe838acce98457b9ed4cfcec012 Mon Sep 17 00:00:00 2001 From: Kayman Date: Mon, 26 Feb 2018 19:38:33 +0900 Subject: [PATCH 15/66] changed a launch file in order to move the camera setting to op3_camera_setting package --- .../launch/ball_detector_from_usb_cam.launch | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/ball_detector/launch/ball_detector_from_usb_cam.launch b/ball_detector/launch/ball_detector_from_usb_cam.launch index 0809458..e84838b 100644 --- a/ball_detector/launch/ball_detector_from_usb_cam.launch +++ b/ball_detector/launch/ball_detector_from_usb_cam.launch @@ -4,33 +4,23 @@ - - - - - - - - - - - - - + + + + + + + + + From 6de2df04572e77dfc96a4bc471ee1f60da150d35 Mon Sep 17 00:00:00 2001 From: Kayman Date: Tue, 27 Feb 2018 10:24:54 +0900 Subject: [PATCH 16/66] added callback function for control on the web --- op3_demo/include/op3_demo/action_demo.h | 2 + op3_demo/include/op3_demo/vision_demo.h | 1 + op3_demo/src/action/action_demo.cpp | 17 ++++++++ op3_demo/src/demo_node.cpp | 55 +++++++++++++++++++++++++ op3_demo/src/soccer/soccer_demo.cpp | 2 +- op3_demo/src/vision/vision_demo.cpp | 39 +++++++----------- 6 files changed, 92 insertions(+), 24 deletions(-) diff --git a/op3_demo/include/op3_demo/action_demo.h b/op3_demo/include/op3_demo/action_demo.h index bae084b..f96e6ef 100644 --- a/op3_demo/include/op3_demo/action_demo.h +++ b/op3_demo/include/op3_demo/action_demo.h @@ -88,12 +88,14 @@ class ActionDemo : public OPDemo void actionSetNameCallback(const std_msgs::String::ConstPtr& msg); void buttonHandlerCallback(const std_msgs::String::ConstPtr& msg); + void demoCommandCallback(const std_msgs::String::ConstPtr &msg); ros::Publisher module_control_pub_; ros::Publisher motion_index_pub_; ros::Publisher play_sound_pub_; ros::Subscriber buttuon_sub_; + ros::Subscriber demo_command_sub_; ros::ServiceClient is_running_client_; diff --git a/op3_demo/include/op3_demo/vision_demo.h b/op3_demo/include/op3_demo/vision_demo.h index b50918d..75d90ac 100644 --- a/op3_demo/include/op3_demo/vision_demo.h +++ b/op3_demo/include/op3_demo/vision_demo.h @@ -56,6 +56,7 @@ class VisionDemo : public OPDemo void buttonHandlerCallback(const std_msgs::String::ConstPtr& msg); void facePositionCallback(const std_msgs::Int32MultiArray::ConstPtr &msg); + void demoCommandCallback(const std_msgs::String::ConstPtr &msg); void setModuleToDemo(const std::string &module_name); diff --git a/op3_demo/src/action/action_demo.cpp b/op3_demo/src/action/action_demo.cpp index 68b84ff..c14339b 100644 --- a/op3_demo/src/action/action_demo.cpp +++ b/op3_demo/src/action/action_demo.cpp @@ -37,6 +37,8 @@ ActionDemo::ActionDemo() std::string default_play_list = "default"; play_list_name_ = nh.param("action_script_play_list", default_play_list); + demo_command_sub_ = nh.subscribe("/robotis/demo_command", 1, &ActionDemo::demoCommandCallback, this); + parseActionScript (script_path_); boost::thread queue_thread = boost::thread(boost::bind(&ActionDemo::callbackThread, this)); @@ -360,4 +362,19 @@ void ActionDemo::setModuleToDemo(const std::string &module_name) std::cout << "enable module : " << module_name << std::endl; } +void ActionDemo::demoCommandCallback(const std_msgs::String::ConstPtr &msg) +{ + if (enable_ == false) + return; + + if (msg->data == "start") + { + resumeProcess(); + } + else if (msg->data == "stop") + { + pauseProcess(); + } +} + } /* namespace robotis_op */ diff --git a/op3_demo/src/demo_node.cpp b/op3_demo/src/demo_node.cpp index fd6742a..19b0643 100644 --- a/op3_demo/src/demo_node.cpp +++ b/op3_demo/src/demo_node.cpp @@ -41,6 +41,8 @@ void setLED(int led); bool checkManagerRunning(std::string& manager_name); void dxlTorqueChecker(); +void demoModeCommandCallback(const std_msgs::String::ConstPtr &msg); + const int SPIN_RATE = 30; const bool DEBUG_PRINT = false; @@ -73,6 +75,7 @@ int main(int argc, char **argv) led_pub = nh.advertise("/robotis/sync_write_item", 0); dxl_torque_pub = nh.advertise("/robotis/dxl_torque", 0); ros::Subscriber buttuon_sub = nh.subscribe("/robotis/open_cr/button", 1, buttonHandlerCallback); + ros::Subscriber mode_command_sub = nh.subscribe("/robotis/command_mode", 1, demoModeCommandCallback); default_mp3_path = ros::package::getPath("op3_demo") + "/Data/mp3/"; @@ -313,3 +316,55 @@ void dxlTorqueChecker() dxl_torque_pub.publish(check_msg); } + +void demoModeCommandCallback(const std_msgs::String::ConstPtr &msg) +{ + // In demo mode + if (current_status != Ready) + { + if (msg->data == "ready") + { + // go to mode selection status + desired_status = Ready; + apply_desired = true; + + playSound(default_mp3_path + "Demonstration ready mode.mp3"); + setLED(0x01 | 0x02 | 0x04); + } + } + // In ready mode + else + { + if(msg->data == "soccer") + { + desired_status = SoccerDemo; + apply_desired = true; + + // play sound + dxlTorqueChecker(); + playSound(default_mp3_path + "Start soccer demonstration.mp3"); + ROS_INFO_COND(DEBUG_PRINT, "= Start Demo Mode : %d", desired_status); + } + else if(msg->data == "vision") + { + desired_status = VisionDemo; + apply_desired = true; + + // play sound + dxlTorqueChecker(); + playSound(default_mp3_path + "Start vision processing demonstration.mp3"); + ROS_INFO_COND(DEBUG_PRINT, "= Start Demo Mode : %d", desired_status); + } + else if(msg->data == "action") + { + desired_status = ActionDemo; + apply_desired = true; + + // play sound + dxlTorqueChecker(); + playSound(default_mp3_path + "Start motion demonstration.mp3"); + ROS_INFO_COND(DEBUG_PRINT, "= Start Demo Mode : %d", desired_status); + } + } +} + diff --git a/op3_demo/src/soccer/soccer_demo.cpp b/op3_demo/src/soccer/soccer_demo.cpp index d63622e..c361764 100644 --- a/op3_demo/src/soccer/soccer_demo.cpp +++ b/op3_demo/src/soccer/soccer_demo.cpp @@ -208,7 +208,7 @@ void SoccerDemo::callbackThread() rgb_led_pub_ = nh.advertise("/robotis/sync_write_item", 0); buttuon_sub_ = nh.subscribe("/robotis/open_cr/button", 1, &SoccerDemo::buttonHandlerCallback, this); - demo_command_sub_ = nh.subscribe("/ball_tracker/command", 1, &SoccerDemo::demoCommandCallback, this); + demo_command_sub_ = nh.subscribe("/robotis/demo_command", 1, &SoccerDemo::demoCommandCallback, this); imu_data_sub_ = nh.subscribe("/robotis/open_cr/imu", 1, &SoccerDemo::imuDataCallback, this); is_running_client_ = nh.serviceClient("/robotis/action/is_running"); diff --git a/op3_demo/src/vision/vision_demo.cpp b/op3_demo/src/vision/vision_demo.cpp index 5058ada..fbe9060 100644 --- a/op3_demo/src/vision/vision_demo.cpp +++ b/op3_demo/src/vision/vision_demo.cpp @@ -141,29 +141,7 @@ void VisionDemo::buttonHandlerCallback(const std_msgs::String::ConstPtr& msg) if (msg->data == "start") { -// switch (play_status_) -// { -// case PlayAction: -// { -// pauseProcess(); -// break; -// } -// -// case PauseAction: -// { -// resumeProcess(); -// break; -// } -// -// case StopAction: -// { -// resumeProcess(); -// break; -// } -// -// default: -// break; -// } + } else if (msg->data == "mode") { @@ -171,6 +149,21 @@ void VisionDemo::buttonHandlerCallback(const std_msgs::String::ConstPtr& msg) } } +void VisionDemo::demoCommandCallback(const std_msgs::String::ConstPtr &msg) +{ + if (enable_ == false) + return; + + if (msg->data == "start") + { + + } + else if (msg->data == "stop") + { + + } +} + void VisionDemo::setModuleToDemo(const std::string &module_name) { std_msgs::String control_msg; From 2549fe19b9cab43c646fbcaa5fdff29255a8d7cc Mon Sep 17 00:00:00 2001 From: Kayman Date: Tue, 27 Feb 2018 10:27:39 +0900 Subject: [PATCH 17/66] changed topic name --- op3_demo/src/demo_node.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/op3_demo/src/demo_node.cpp b/op3_demo/src/demo_node.cpp index 19b0643..91429c1 100644 --- a/op3_demo/src/demo_node.cpp +++ b/op3_demo/src/demo_node.cpp @@ -75,7 +75,7 @@ int main(int argc, char **argv) led_pub = nh.advertise("/robotis/sync_write_item", 0); dxl_torque_pub = nh.advertise("/robotis/dxl_torque", 0); ros::Subscriber buttuon_sub = nh.subscribe("/robotis/open_cr/button", 1, buttonHandlerCallback); - ros::Subscriber mode_command_sub = nh.subscribe("/robotis/command_mode", 1, demoModeCommandCallback); + ros::Subscriber mode_command_sub = nh.subscribe("/robotis/mode_command", 1, demoModeCommandCallback); default_mp3_path = ros::package::getPath("op3_demo") + "/Data/mp3/"; @@ -256,7 +256,7 @@ void buttonHandlerCallback(const std_msgs::String::ConstPtr& msg) case ActionDemo: playSound(default_mp3_path + "Interactive motion mode.mp3"); - setLED(0x04); + setLED(0x04);ball_tracker break; default: From 9dcb075e329d229091ac16ff70a22dcef77465bb Mon Sep 17 00:00:00 2001 From: Kayman Date: Tue, 27 Feb 2018 10:28:19 +0900 Subject: [PATCH 18/66] changed parameter setting value --- .../launch/ball_detector_params.yaml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ball_detector/launch/ball_detector_params.yaml b/ball_detector/launch/ball_detector_params.yaml index dd4c366..b7c5ec4 100644 --- a/ball_detector/launch/ball_detector_params.yaml +++ b/ball_detector/launch/ball_detector_params.yaml @@ -6,18 +6,18 @@ min_circle_dist: 100 hough_accum_th: 28 min_radius: 20 max_radius: 300 -filter_h_min: 247 -filter_h_max: 221 -filter_s_min: 220 +filter_h_min: 350 +filter_h_max: 20 +filter_s_min: 222 filter_s_max: 255 -filter_v_min: 30 +filter_v_min: 65 filter_v_max: 255 use_second_filter: false -filter2_h_min: 40 -filter2_h_max: 345 -filter2_s_min: 1 -filter2_s_max: 45 -filter2_v_min: 90 +filter2_h_min: 30 +filter2_h_max: 355 +filter2_s_min: 0 +filter2_s_max: 40 +filter2_v_min: 200 filter2_v_max: 255 -ellipse_size: 5 -filter_debug: true \ No newline at end of file +ellipse_size: 2 +filter_debug: false \ No newline at end of file From af6206c321344021518f20a5f7c4eb129e44e486 Mon Sep 17 00:00:00 2001 From: Kayman Date: Tue, 27 Feb 2018 10:32:56 +0900 Subject: [PATCH 19/66] fixed minor bug --- op3_demo/src/demo_node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op3_demo/src/demo_node.cpp b/op3_demo/src/demo_node.cpp index 91429c1..8039aff 100644 --- a/op3_demo/src/demo_node.cpp +++ b/op3_demo/src/demo_node.cpp @@ -256,7 +256,7 @@ void buttonHandlerCallback(const std_msgs::String::ConstPtr& msg) case ActionDemo: playSound(default_mp3_path + "Interactive motion mode.mp3"); - setLED(0x04);ball_tracker + setLED(0x04); break; default: From f8e7806adb60b55cf4befb0edb47260d827408b2 Mon Sep 17 00:00:00 2001 From: Kayman Date: Tue, 27 Feb 2018 10:59:27 +0900 Subject: [PATCH 20/66] changed delay to wait for changing module --- op3_demo/src/action/action_demo.cpp | 2 +- op3_demo/src/soccer/soccer_demo.cpp | 4 ++-- op3_demo/src/vision/vision_demo.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/op3_demo/src/action/action_demo.cpp b/op3_demo/src/action/action_demo.cpp index c14339b..67bb393 100644 --- a/op3_demo/src/action/action_demo.cpp +++ b/op3_demo/src/action/action_demo.cpp @@ -53,7 +53,7 @@ void ActionDemo::setDemoEnable() { setModuleToDemo("action_module"); - usleep(10 * 1000); + usleep(100 * 1000); enable_ = true; diff --git a/op3_demo/src/soccer/soccer_demo.cpp b/op3_demo/src/soccer/soccer_demo.cpp index c361764..d4f2410 100644 --- a/op3_demo/src/soccer/soccer_demo.cpp +++ b/op3_demo/src/soccer/soccer_demo.cpp @@ -414,7 +414,7 @@ void SoccerDemo::startSoccerMode() { setModuleToDemo("action_module"); - usleep(10 * 1000); + usleep(100 * 1000); playMotion(WalkingReady); @@ -422,7 +422,7 @@ void SoccerDemo::startSoccerMode() setBodyModuleToDemo("walking_module"); - usleep(10 * 1000); + usleep(20 * 1000); ROS_INFO("Start Soccer Demo"); on_following_ball_ = true; diff --git a/op3_demo/src/vision/vision_demo.cpp b/op3_demo/src/vision/vision_demo.cpp index fbe9060..7de7362 100644 --- a/op3_demo/src/vision/vision_demo.cpp +++ b/op3_demo/src/vision/vision_demo.cpp @@ -52,7 +52,7 @@ void VisionDemo::setDemoEnable() setModuleToDemo("head_control_module"); - usleep(10 * 1000); + usleep(20 * 1000); enable_ = true; face_tracker_.startTracking(); From 6fe214d9b050b814d0b31dd23f86fa96d61eae9f Mon Sep 17 00:00:00 2001 From: Kayman Date: Tue, 27 Feb 2018 11:14:05 +0900 Subject: [PATCH 21/66] fixed wrong path of yaml --- op3_demo/src/soccer/soccer_demo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op3_demo/src/soccer/soccer_demo.cpp b/op3_demo/src/soccer/soccer_demo.cpp index d4f2410..bd887b7 100644 --- a/op3_demo/src/soccer/soccer_demo.cpp +++ b/op3_demo/src/soccer/soccer_demo.cpp @@ -42,7 +42,7 @@ SoccerDemo::SoccerDemo() ros::NodeHandle nh(ros::this_node::getName()); - std::string default_path = ros::package::getPath("op3_gui_demo") + "/config/demo_config.yaml"; + std::string default_path = ros::package::getPath("op3_gui_demo") + "/config/gui_config.yaml"; std::string path = nh.param("demo_config", default_path); parseJointNameFromYaml(path); From 251b9c8e197f09071de64ea916dbd8701a96a3ff Mon Sep 17 00:00:00 2001 From: Kayman Date: Tue, 27 Feb 2018 17:16:15 +0900 Subject: [PATCH 22/66] changed action stop --- op3_demo/include/op3_demo/action_demo.h | 1 + op3_demo/src/action/action_demo.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/op3_demo/include/op3_demo/action_demo.h b/op3_demo/include/op3_demo/action_demo.h index f96e6ef..bac1eab 100644 --- a/op3_demo/include/op3_demo/action_demo.h +++ b/op3_demo/include/op3_demo/action_demo.h @@ -55,6 +55,7 @@ class ActionDemo : public OPDemo PlayAction = 1, PauseAction = 2, StopAction = 3, + ReadyAction = 4, }; const int SPIN_RATE; diff --git a/op3_demo/src/action/action_demo.cpp b/op3_demo/src/action/action_demo.cpp index 67bb393..76a238c 100644 --- a/op3_demo/src/action/action_demo.cpp +++ b/op3_demo/src/action/action_demo.cpp @@ -110,6 +110,8 @@ void ActionDemo::process() stopMP3(); brakeAction(); + play_status_ = ReadyAction; + break; } @@ -118,6 +120,8 @@ void ActionDemo::process() stopMP3(); stopAction(); + play_status_ = ReadyAction; + break; } From f9e9dc0cd6780a69fd39f4ab8717f5da1a8d9391 Mon Sep 17 00:00:00 2001 From: Kayman Date: Wed, 28 Feb 2018 10:12:58 +0900 Subject: [PATCH 23/66] changed op3_demo launch file --- ball_detector/launch/ball_detector_params.yaml | 6 +++--- op3_demo/launch/demo.launch | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ball_detector/launch/ball_detector_params.yaml b/ball_detector/launch/ball_detector_params.yaml index b7c5ec4..d6310e1 100644 --- a/ball_detector/launch/ball_detector_params.yaml +++ b/ball_detector/launch/ball_detector_params.yaml @@ -8,9 +8,9 @@ min_radius: 20 max_radius: 300 filter_h_min: 350 filter_h_max: 20 -filter_s_min: 222 +filter_s_min: 220 filter_s_max: 255 -filter_v_min: 65 +filter_v_min: 80 filter_v_max: 255 use_second_filter: false filter2_h_min: 30 @@ -19,5 +19,5 @@ filter2_s_min: 0 filter2_s_max: 40 filter2_v_min: 200 filter2_v_max: 255 -ellipse_size: 2 +ellipse_size: 1 filter_debug: false \ No newline at end of file diff --git a/op3_demo/launch/demo.launch b/op3_demo/launch/demo.launch index 17db508..391a9f3 100644 --- a/op3_demo/launch/demo.launch +++ b/op3_demo/launch/demo.launch @@ -18,8 +18,7 @@ - - + From f0f3b2f98de3dd15cb6bcfff4337e7f2faf27863 Mon Sep 17 00:00:00 2001 From: Yoonseok Pyo Date: Fri, 2 Mar 2018 16:13:44 +0900 Subject: [PATCH 24/66] Create .travis.yml --- .travis.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..ee670e4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,35 @@ +# This config file for Travis CI utilizes ros-industrial/industrial_ci package. +# For more info for the package, see https://github.com/ros-industrial/industrial_ci/blob/master/README.rst + +dist: trusty +sudo: required +services: + - docker +language: generic +python: + - "2.7" +compiler: + - gcc +notifications: + email: + on_success: always + on_failure: always + recipients: + - pyo@robotis.com +env: + matrix: + - ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu USE_DEB=true + - ROS_DISTRO="kinetic" PRERELEASE=true PRERELEASE_DOWNSTREAM_DEPTH=0 +matrix: + allow_failures: + - env: ROS_DISTRO="kinetic" PRERELEASE=true PRERELEASE_DOWNSTREAM_DEPTH=0 +branches: + only: + - master + - develop + - kinetic-devel +install: + - git clone https://github.com/ros-industrial/industrial_ci.git .ci_config +script: + - source .ci_config/travis.sh + From fe3117af0c5a113102fcc16bf73c91ebdd4b671e Mon Sep 17 00:00:00 2001 From: Kayman Date: Tue, 13 Mar 2018 21:00:38 +0900 Subject: [PATCH 25/66] decreased the count of copying image. added command to face_tracker_node. --- .../include/ball_detector/ball_detector.h | 3 + ball_detector/src/ball_detector.cpp | 135 ++++++++++++++++-- ball_detector/src/ball_detector_node.cpp | 1 + op3_demo/include/op3_demo/face_tracker.h | 1 + op3_demo/include/op3_demo/vision_demo.h | 3 +- op3_demo/launch/face_detection_op3.launch | 1 + op3_demo/src/test_node.cpp | 4 + op3_demo/src/vision/face_tracker.cpp | 5 +- op3_demo/src/vision/vision_demo.cpp | 12 +- 9 files changed, 152 insertions(+), 13 deletions(-) diff --git a/ball_detector/include/ball_detector/ball_detector.h b/ball_detector/include/ball_detector/ball_detector.h index 6e0a3ef..b246ff3 100644 --- a/ball_detector/include/ball_detector/ball_detector.h +++ b/ball_detector/include/ball_detector/ball_detector.h @@ -83,13 +83,16 @@ class BallDetector void printConfig(); void saveConfig(); void setInputImage(const cv::Mat & inIm); + void setInputImage(const cv::Mat & inIm, cv::Mat &in_filter_img); void getOutputImage(cv::Mat & outIm); void filterImage(); + void filterImage(const cv::Mat &in_filter_img, cv::Mat &out_filter_img); void makeFilterMask(const cv::Mat &source_img, cv::Mat &mask_img, int range); void makeFilterMaskFromBall(const cv::Mat &source_img, cv::Mat &mask_img); void inRangeHsv(const cv::Mat &input_img, const HsvFilter &filter_value, cv::Mat &output_img); void mophology(const cv::Mat &intput_img, cv::Mat &output_img, int ellipse_size); void houghDetection(const unsigned int imgEncoding); + void houghDetection2(const cv::Mat &input_hough); void drawOutputImage(); //ros node handle diff --git a/ball_detector/src/ball_detector.cpp b/ball_detector/src/ball_detector.cpp index fb37112..df4fe80 100644 --- a/ball_detector/src/ball_detector.cpp +++ b/ball_detector/src/ball_detector.cpp @@ -125,14 +125,25 @@ void BallDetector::process() if (cv_img_ptr_sub_ != NULL) { - //sets input image - setInputImage(cv_img_ptr_sub_->image); + cv::Mat img_hsv, img_filtered; - // test image filtering - filterImage(); + // set input image + setInputImage(cv_img_ptr_sub_->image, img_hsv); + + // image filtering + filterImage(img_hsv, img_filtered); //detect circles - houghDetection(this->img_encoding_); + houghDetection2(img_filtered); + +// // set input image +// setInputImage(cv_img_ptr_sub_->image); + +// // image filtering +// filterImage(); + +// //detect circles +// houghDetection(this->img_encoding_); } } @@ -184,8 +195,8 @@ void BallDetector::publishCircles() // left(-1), right(+1) for (int idx = 0; idx < circles_.size(); idx++) { - circles_msg_.circles[idx].x = circles_[idx][0] / in_image_.cols * 2 - 1; // x (-1 ~ 1) - circles_msg_.circles[idx].y = circles_[idx][1] / in_image_.rows * 2 - 1; // y (-1 ~ 1) + circles_msg_.circles[idx].x = circles_[idx][0] / out_image_.cols * 2 - 1; // x (-1 ~ 1) + circles_msg_.circles[idx].y = circles_[idx][1] / out_image_.rows * 2 - 1; // y (-1 ~ 1) circles_msg_.circles[idx].z = circles_[idx][2]; // radius } @@ -482,6 +493,14 @@ void BallDetector::setInputImage(const cv::Mat & inIm) out_image_ = in_image_.clone(); } +void BallDetector::setInputImage(const cv::Mat & inIm, cv::Mat &in_filter_img) +{ + cv::cvtColor(inIm, in_filter_img, cv::COLOR_RGB2HSV); + + if (params_config_.debug == false) + out_image_ = inIm.clone(); +} + void BallDetector::getOutputImage(cv::Mat & outIm) { this->drawOutputImage(); @@ -522,6 +541,42 @@ void BallDetector::filterImage() cv::cvtColor(img_filtered, in_image_, cv::COLOR_GRAY2RGB); } +void BallDetector::filterImage(const cv::Mat &in_filter_img, cv::Mat &out_filter_img) +{ + if (!in_filter_img.data) + return; + + inRangeHsv(in_filter_img, params_config_.filter_threshold, out_filter_img); + + // mophology : open and close + mophology(out_filter_img, out_filter_img, params_config_.ellipse_size); + + if (params_config_.use_second_filter == true) + { + // mask + cv::Mat img_mask; + + // check hsv range + cv::Mat img_filtered2; + inRangeHsv(in_filter_img, params_config_.filter2_threshold, img_filtered2); + + makeFilterMaskFromBall(out_filter_img, img_mask); + cv::bitwise_and(img_filtered2, img_mask, img_filtered2); + + // or + cv::bitwise_or(out_filter_img, img_filtered2, out_filter_img); + } + + mophology(out_filter_img, out_filter_img, params_config_.ellipse_size); + +// cv::cvtColor(img_filtered, in_image_, cv::COLOR_GRAY2RGB); + + //draws results to output Image + if (params_config_.debug == true) + cv::cvtColor(out_filter_img, out_image_, cv::COLOR_GRAY2RGB); +// out_image_ = in_image_.clone(); +} + void BallDetector::makeFilterMask(const cv::Mat &source_img, cv::Mat &mask_img, int range) { // source_img. @@ -707,6 +762,68 @@ void BallDetector::houghDetection(const unsigned int imgEncoding) } } +void BallDetector::houghDetection2(const cv::Mat &input_hough) +{ +// cv::Mat gray_image; + std::vector circles_current; + std::vector prev_circles = circles_; + + //clear previous circles + circles_.clear(); + + // If input image is RGB, convert it to gray +// if (imgEncoding == IMG_RGB8) +// cv::cvtColor(input_hough, gray_image, CV_RGB2GRAY); + + + //Reduce the noise so we avoid false circle detection + cv::GaussianBlur(input_hough, input_hough, + cv::Size(params_config_.gaussian_blur_size, params_config_.gaussian_blur_size), + params_config_.gaussian_blur_sigma); + + double hough_accum_th = params_config_.hough_accum_th; + + + //Apply the Hough Transform to find the circles + cv::HoughCircles(input_hough, circles_current, CV_HOUGH_GRADIENT, params_config_.hough_accum_resolution, + params_config_.min_circle_dist, params_config_.canny_edge_th, hough_accum_th, + params_config_.min_radius, params_config_.max_radius); + + if (circles_current.size() == 0) + not_found_count_ += 1; + else + not_found_count_ = 0; + + double alpha = 0.2; + + for (int ix = 0; ix < circles_current.size(); ix++) + { + cv::Point2d center = cv::Point(circles_current[ix][0], circles_current[ix][1]); + double radius = circles_current[ix][2]; + + for (int prev_ix = 0; prev_ix < prev_circles.size(); prev_ix++) + { + cv::Point2d prev_center = cv::Point(prev_circles[prev_ix][0], prev_circles[prev_ix][1]); + double prev_radius = prev_circles[prev_ix][2]; + + cv::Point2d diff = center - prev_center; + double radius_th = std::max(radius, prev_radius) * 0.75; + + if (sqrt(diff.dot(diff)) < radius_th) + { + if (abs(radius - prev_radius) < radius_th) + { + circles_current[ix] = circles_current[ix] * alpha + prev_circles[prev_ix] * (1 - alpha); + } + + break; + } + } + + circles_.push_back(circles_current[ix]); + } +} + void BallDetector::drawOutputImage() { cv::Point center_position; @@ -714,8 +831,8 @@ void BallDetector::drawOutputImage() size_t ii; //draws results to output Image - if (params_config_.debug == true) - out_image_ = in_image_.clone(); +// if (params_config_.debug == true) +// out_image_ = in_image_.clone(); for (ii = 0; ii < circles_.size(); ii++) { diff --git a/ball_detector/src/ball_detector_node.cpp b/ball_detector/src/ball_detector_node.cpp index 7edfae6..5560d56 100644 --- a/ball_detector/src/ball_detector_node.cpp +++ b/ball_detector/src/ball_detector_node.cpp @@ -39,6 +39,7 @@ int main(int argc, char **argv) detector.process(); detector.publishImage(); detector.publishCircles(); + } //execute pending callbacks diff --git a/op3_demo/include/op3_demo/face_tracker.h b/op3_demo/include/op3_demo/face_tracker.h index a5b3ae8..0671b24 100644 --- a/op3_demo/include/op3_demo/face_tracker.h +++ b/op3_demo/include/op3_demo/face_tracker.h @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/op3_demo/include/op3_demo/vision_demo.h b/op3_demo/include/op3_demo/vision_demo.h index 75d90ac..470962d 100644 --- a/op3_demo/include/op3_demo/vision_demo.h +++ b/op3_demo/include/op3_demo/vision_demo.h @@ -64,7 +64,8 @@ class VisionDemo : public OPDemo ros::Publisher module_control_pub_; ros::Publisher motion_index_pub_; - ros::Publisher rgb_led_pub_; + ros::Publisher rgb_led_pub_; + ros::Publisher face_tracking_command_pub_; ros::Subscriber buttuon_sub_; ros::Subscriber faceCoord_sub_; diff --git a/op3_demo/launch/face_detection_op3.launch b/op3_demo/launch/face_detection_op3.launch index 155b3cd..afc5f12 100644 --- a/op3_demo/launch/face_detection_op3.launch +++ b/op3_demo/launch/face_detection_op3.launch @@ -17,5 +17,6 @@ + diff --git a/op3_demo/src/test_node.cpp b/op3_demo/src/test_node.cpp index 3ed2aa3..6671097 100644 --- a/op3_demo/src/test_node.cpp +++ b/op3_demo/src/test_node.cpp @@ -193,6 +193,10 @@ int main(int argc, char **argv) //relax to fit output rate loop_rate.sleep(); + + // for debug + if (checkManagerRunning(manager_name) == false) + return 0; } //exit program diff --git a/op3_demo/src/vision/face_tracker.cpp b/op3_demo/src/vision/face_tracker.cpp index 572eec2..36a32a4 100644 --- a/op3_demo/src/vision/face_tracker.cpp +++ b/op3_demo/src/vision/face_tracker.cpp @@ -34,8 +34,7 @@ FaceTracker::FaceTracker() head_scan_pub_ = nh_.advertise("/robotis/head_control/scan_command", 0); face_position_sub_ = nh_.subscribe("/face_position", 1, &FaceTracker::facePositionCallback, this); - face_tracking_command_sub_ = nh_.subscribe("/face_tracker/command", 1, &FaceTracker::faceTrackerCommandCallback, - this); + //face_tracking_command_sub_ = nh_.subscribe("/robotis/demo_command", 1, &FaceTracker::faceTrackerCommandCallback, this); } FaceTracker::~FaceTracker() @@ -73,12 +72,14 @@ void FaceTracker::faceTrackerCommandCallback(const std_msgs::String::ConstPtr &m void FaceTracker::startTracking() { on_tracking_ = true; + ROS_INFO("Start Face tracking"); } void FaceTracker::stopTracking() { on_tracking_ = false; + ROS_INFO("Stop Face tracking"); } diff --git a/op3_demo/src/vision/vision_demo.cpp b/op3_demo/src/vision/vision_demo.cpp index 7de7362..ea91bd8 100644 --- a/op3_demo/src/vision/vision_demo.cpp +++ b/op3_demo/src/vision/vision_demo.cpp @@ -55,6 +55,11 @@ void VisionDemo::setDemoEnable() usleep(20 * 1000); enable_ = true; + + std_msgs::Bool command; + command.data = enable_; + face_tracking_command_pub_.publish(command); + face_tracker_.startTracking(); ROS_INFO("Start Vision Demo"); @@ -68,6 +73,10 @@ void VisionDemo::setDemoDisable() is_tracking_ = false; tracking_status_ = FaceTracker::Waiting; enable_ = false; + + std_msgs::Bool command; + command.data = enable_; + face_tracking_command_pub_.publish(command); } void VisionDemo::process() @@ -95,7 +104,7 @@ void VisionDemo::process() tracking_status_ = tracking_status; //is_tracking_ = is_tracked; - std::cout << "Tracking : " << tracking_status << std::endl; + //std::cout << "Tracking : " << tracking_status << std::endl; } void VisionDemo::processThread() @@ -122,6 +131,7 @@ void VisionDemo::callbackThread() module_control_pub_ = nh.advertise("/robotis/enable_ctrl_module", 0); motion_index_pub_ = nh.advertise("/robotis/action/page_num", 0); rgb_led_pub_ = nh.advertise("/robotis/sync_write_item", 0); + face_tracking_command_pub_ = nh.advertise("/face_tracking/command", 0); buttuon_sub_ = nh.subscribe("/robotis/open_cr/button", 1, &VisionDemo::buttonHandlerCallback, this); faceCoord_sub_ = nh.subscribe("/faceCoord", 1, &VisionDemo::facePositionCallback, this); From 6a7a8159e74daf429be3a5a098b0b088dcd7dfb3 Mon Sep 17 00:00:00 2001 From: Yoonseok Pyo Date: Fri, 16 Mar 2018 16:55:00 +0900 Subject: [PATCH 26/66] Update .travis.yml --- .travis.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index ee670e4..07bc3c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ # This config file for Travis CI utilizes ros-industrial/industrial_ci package. # For more info for the package, see https://github.com/ros-industrial/industrial_ci/blob/master/README.rst -dist: trusty sudo: required +dist: trusty services: - docker language: generic @@ -18,11 +18,8 @@ notifications: - pyo@robotis.com env: matrix: - - ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu USE_DEB=true - - ROS_DISTRO="kinetic" PRERELEASE=true PRERELEASE_DOWNSTREAM_DEPTH=0 -matrix: - allow_failures: - - env: ROS_DISTRO="kinetic" PRERELEASE=true PRERELEASE_DOWNSTREAM_DEPTH=0 + - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian +# - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=debian OS_CODE_NAME=jessie branches: only: - master From e5503b75446a357e09474c7554e661f7154da286 Mon Sep 17 00:00:00 2001 From: Kayman Date: Thu, 22 Mar 2018 16:33:10 +0900 Subject: [PATCH 27/66] changed a method to setting module added parameters of gain for ball_tracking changed variables of camera FOV --- .../launch/ball_detector_params.yaml | 4 +- op3_demo/include/op3_demo/action_demo.h | 4 +- op3_demo/include/op3_demo/ball_tracker.h | 9 +- op3_demo/include/op3_demo/soccer_demo.h | 4 + op3_demo/include/op3_demo/vision_demo.h | 4 +- op3_demo/launch/demo.launch | 2 + op3_demo/launch/self_test.launch | 9 +- op3_demo/src/action/action_demo.cpp | 24 ++- op3_demo/src/soccer/ball_follower.cpp | 4 +- op3_demo/src/soccer/ball_tracker.cpp | 107 ++++++----- op3_demo/src/soccer/soccer_demo.cpp | 174 +++++++++--------- op3_demo/src/test_node.cpp | 93 +++++++++- op3_demo/src/vision/face_tracker.cpp | 2 +- op3_demo/src/vision/vision_demo.cpp | 31 ++-- 14 files changed, 308 insertions(+), 163 deletions(-) diff --git a/ball_detector/launch/ball_detector_params.yaml b/ball_detector/launch/ball_detector_params.yaml index d6310e1..2992b70 100644 --- a/ball_detector/launch/ball_detector_params.yaml +++ b/ball_detector/launch/ball_detector_params.yaml @@ -7,8 +7,8 @@ hough_accum_th: 28 min_radius: 20 max_radius: 300 filter_h_min: 350 -filter_h_max: 20 -filter_s_min: 220 +filter_h_max: 15 +filter_s_min: 200 filter_s_max: 255 filter_v_min: 80 filter_v_max: 255 diff --git a/op3_demo/include/op3_demo/action_demo.h b/op3_demo/include/op3_demo/action_demo.h index bac1eab..32a9435 100644 --- a/op3_demo/include/op3_demo/action_demo.h +++ b/op3_demo/include/op3_demo/action_demo.h @@ -29,6 +29,7 @@ #include "op3_demo/op_demo.h" #include "robotis_controller_msgs/JointCtrlModule.h" +#include "robotis_controller_msgs/SetModule.h" #include "op3_action_module_msgs/IsRunning.h" namespace robotis_op @@ -86,7 +87,7 @@ class ActionDemo : public OPDemo bool isActionRunning(); void setModuleToDemo(const std::string &module_name); - + void callServiceSettingModule(const std::string &module_name); void actionSetNameCallback(const std_msgs::String::ConstPtr& msg); void buttonHandlerCallback(const std_msgs::String::ConstPtr& msg); void demoCommandCallback(const std_msgs::String::ConstPtr &msg); @@ -99,6 +100,7 @@ class ActionDemo : public OPDemo ros::Subscriber demo_command_sub_; ros::ServiceClient is_running_client_; + ros::ServiceClient set_joint_module_client_; std::map action_sound_table_; std::vector play_list_; diff --git a/op3_demo/include/op3_demo/ball_tracker.h b/op3_demo/include/op3_demo/ball_tracker.h index 2304a43..0d3cfac 100644 --- a/op3_demo/include/op3_demo/ball_tracker.h +++ b/op3_demo/include/op3_demo/ball_tracker.h @@ -26,6 +26,7 @@ #include #include #include +//#include #include #include "robotis_controller_msgs/JointCtrlModule.h" @@ -39,7 +40,7 @@ namespace robotis_op // head tracking for looking the ball class BallTracker { - public: +public: enum TrackingStatus { NotFound = -1, @@ -72,7 +73,7 @@ class BallTracker return current_ball_bottom_; } - protected: +protected: const double FOV_WIDTH; const double FOV_HEIGHT; const int NOT_FOUND_THRESHOLD; @@ -92,6 +93,8 @@ class BallTracker ros::Publisher head_joint_pub_; ros::Publisher head_scan_pub_; + // ros::Publisher error_pub_; + ros::Publisher motion_index_pub_; ros::Subscriber ball_position_sub_; @@ -107,7 +110,9 @@ class BallTracker bool on_tracking_; double current_ball_pan_, current_ball_tilt_; double current_ball_bottom_; + double x_error_sum_, y_error_sum_; ros::Time prev_time_; + double p_gain_, d_gain_, i_gain_; }; } diff --git a/op3_demo/include/op3_demo/soccer_demo.h b/op3_demo/include/op3_demo/soccer_demo.h index d18343f..f65d81b 100644 --- a/op3_demo/include/op3_demo/soccer_demo.h +++ b/op3_demo/include/op3_demo/soccer_demo.h @@ -30,6 +30,8 @@ #include "robotis_math/robotis_linear_algebra.h" #include "op3_action_module_msgs/IsRunning.h" #include "robotis_controller_msgs/SyncWriteItem.h" +#include "robotis_controller_msgs/JointCtrlModule.h" +#include "robotis_controller_msgs/SetJointModule.h" namespace robotis_op { @@ -70,6 +72,7 @@ class SoccerDemo : public OPDemo void setBodyModuleToDemo(const std::string &body_module, bool with_head_control = true); void setModuleToDemo(const std::string &module_name); + void callServiceSettingModule(const robotis_controller_msgs::JointCtrlModule &modules); void parseJointNameFromYaml(const std::string &path); bool getJointNameFromID(const int &id, std::string &joint_name); bool getIDFromJointName(const std::string &joint_name, int &id); @@ -101,6 +104,7 @@ class SoccerDemo : public OPDemo ros::Subscriber imu_data_sub_; ros::ServiceClient is_running_client_; + ros::ServiceClient set_joint_module_client_; std::map id_joint_table_; std::map joint_id_table_; diff --git a/op3_demo/include/op3_demo/vision_demo.h b/op3_demo/include/op3_demo/vision_demo.h index 470962d..3ebdc46 100644 --- a/op3_demo/include/op3_demo/vision_demo.h +++ b/op3_demo/include/op3_demo/vision_demo.h @@ -30,6 +30,7 @@ #include "op3_demo/face_tracker.h" #include "robotis_controller_msgs/SyncWriteItem.h" +#include "robotis_controller_msgs/SetModule.h" namespace robotis_op { @@ -59,6 +60,7 @@ class VisionDemo : public OPDemo void demoCommandCallback(const std_msgs::String::ConstPtr &msg); void setModuleToDemo(const std::string &module_name); + void callServiceSettingModule(const std::string &module_name); FaceTracker face_tracker_; @@ -70,9 +72,9 @@ class VisionDemo : public OPDemo ros::Subscriber buttuon_sub_; ros::Subscriber faceCoord_sub_; + ros::ServiceClient set_joint_module_client_; geometry_msgs::Point face_position_; - bool is_tracking_; int tracking_status_; }; diff --git a/op3_demo/launch/demo.launch b/op3_demo/launch/demo.launch index 391a9f3..aa5098b 100644 --- a/op3_demo/launch/demo.launch +++ b/op3_demo/launch/demo.launch @@ -23,6 +23,8 @@ + + diff --git a/op3_demo/launch/self_test.launch b/op3_demo/launch/self_test.launch index 0f34bca..c5ca857 100644 --- a/op3_demo/launch/self_test.launch +++ b/op3_demo/launch/self_test.launch @@ -17,7 +17,14 @@ + + + - + + + + + diff --git a/op3_demo/src/action/action_demo.cpp b/op3_demo/src/action/action_demo.cpp index 76a238c..4f14679 100644 --- a/op3_demo/src/action/action_demo.cpp +++ b/op3_demo/src/action/action_demo.cpp @@ -53,8 +53,6 @@ void ActionDemo::setDemoEnable() { setModuleToDemo("action_module"); - usleep(100 * 1000); - enable_ = true; ROS_INFO_COND(DEBUG_PRINT, "Start ActionScript Demo"); @@ -69,7 +67,7 @@ void ActionDemo::setDemoDisable() stopProcess(); enable_ = false; - + ROS_WARN("Set Action demo disable"); play_list_.resize(0); } @@ -181,6 +179,7 @@ void ActionDemo::callbackThread() buttuon_sub_ = nh.subscribe("/robotis/open_cr/button", 1, &ActionDemo::buttonHandlerCallback, this); is_running_client_ = nh.serviceClient("/robotis/action/is_running"); + set_joint_module_client_ = nh.serviceClient("/robotis/set_present_ctrl_modules"); while (nh.ok()) { @@ -359,11 +358,22 @@ void ActionDemo::buttonHandlerCallback(const std_msgs::String::ConstPtr& msg) void ActionDemo::setModuleToDemo(const std::string &module_name) { - std_msgs::String control_msg; - control_msg.data = "action_module"; + callServiceSettingModule(module_name); + ROS_INFO_STREAM("enable module : " << module_name); +} - module_control_pub_.publish(control_msg); - std::cout << "enable module : " << module_name << std::endl; +void ActionDemo::callServiceSettingModule(const std::string &module_name) +{ + robotis_controller_msgs::SetModule set_module_srv; + set_module_srv.request.module_name = module_name; + + if (set_joint_module_client_.call(set_module_srv) == false) + { + ROS_ERROR("Failed to set module"); + return; + } + + return ; } void ActionDemo::demoCommandCallback(const std_msgs::String::ConstPtr &msg) diff --git a/op3_demo/src/soccer/ball_follower.cpp b/op3_demo/src/soccer/ball_follower.cpp index f59a23e..eec94e9 100644 --- a/op3_demo/src/soccer/ball_follower.cpp +++ b/op3_demo/src/soccer/ball_follower.cpp @@ -23,7 +23,7 @@ namespace robotis_op BallFollower::BallFollower() : nh_(ros::this_node::getName()), - FOV_WIDTH(26.4 * M_PI / 180), + FOV_WIDTH(35.2 * M_PI / 180), FOV_HEIGHT(21.6 * M_PI / 180), count_not_found_(0), count_to_kick_(0), @@ -216,7 +216,7 @@ bool BallFollower::processFollowing(double x_angle, double y_angle, double ball_ "head tilt : " << (current_tilt_ * 180 / M_PI) << " | ball tilt : " << (y_angle * 180 / M_PI)); ROS_INFO_STREAM_COND(DEBUG_PRINT, "foot to kick : " << accum_ball_position_); - ROS_INFO("In range [%d]", count_to_kick_); + ROS_INFO("In range [%d | %d]", count_to_kick_, accum_ball_position_); if (count_to_kick_ > 20) { diff --git a/op3_demo/src/soccer/ball_tracker.cpp b/op3_demo/src/soccer/ball_tracker.cpp index b7d9ad2..cbd4e87 100644 --- a/op3_demo/src/soccer/ball_tracker.cpp +++ b/op3_demo/src/soccer/ball_tracker.cpp @@ -22,22 +22,32 @@ namespace robotis_op { BallTracker::BallTracker() - : nh_(ros::this_node::getName()), - FOV_WIDTH(26.4 * M_PI / 180), - FOV_HEIGHT(21.6 * M_PI / 180), - NOT_FOUND_THRESHOLD(50), - WAITING_THRESHOLD(5), - use_head_scan_(true), - count_not_found_(0), - on_tracking_(false), - current_ball_pan_(0), - current_ball_tilt_(0), - current_ball_bottom_(0), - tracking_status_(NotFound), - DEBUG_PRINT(false) + : nh_(ros::this_node::getName()), + FOV_WIDTH(35.2 * M_PI / 180), + FOV_HEIGHT(21.6 * M_PI / 180), + NOT_FOUND_THRESHOLD(50), + WAITING_THRESHOLD(5), + use_head_scan_(true), + count_not_found_(0), + on_tracking_(false), + current_ball_pan_(0), + current_ball_tilt_(0), + x_error_sum_(0), + y_error_sum_(0), + current_ball_bottom_(0), + tracking_status_(NotFound), + DEBUG_PRINT(false) { + ros::NodeHandle param_nh("~"); + p_gain_ = param_nh.param("p_gain", 0.4); + i_gain_ = param_nh.param("i_gain", 0.0); + d_gain_ = param_nh.param("d_gain", 0.0); + + ROS_INFO_STREAM("Ball tracking Gain : " << p_gain_ << ", " << i_gain_ << ", " << d_gain_); + head_joint_pub_ = nh_.advertise("/robotis/head_control/set_joint_states_offset", 0); head_scan_pub_ = nh_.advertise("/robotis/head_control/scan_command", 0); + // error_pub_ = nh_.advertise("/ball_tracker/errors", 0); ball_position_sub_ = nh_.subscribe("/ball_detector_node/circle_set", 1, &BallTracker::ballPositionCallback, this); ball_tracking_command_sub_ = nh_.subscribe("/ball_tracker/command", 1, &BallTracker::ballTrackerCommandCallback, @@ -90,9 +100,10 @@ void BallTracker::stopTracking() on_tracking_ = false; ROS_INFO_COND(DEBUG_PRINT, "Stop Ball tracking"); - double x_error = -atan(ball_position_.x * tan(FOV_WIDTH)); - double y_error = -atan(ball_position_.y * tan(FOV_HEIGHT)); - publishHeadJoint(x_error, y_error); + current_ball_pan_ = 0; + current_ball_tilt_ = 0; + x_error_sum_ = 0; + y_error_sum_ = 0; } void BallTracker::setUsingHeadScan(bool use_scan) @@ -147,24 +158,26 @@ int BallTracker::processTracking() switch (tracking_status) { - case NotFound: - tracking_status_ = tracking_status; - return tracking_status; + case NotFound: + tracking_status_ = tracking_status; + current_ball_pan_ = 0; + current_ball_tilt_ = 0; + x_error_sum_ = 0; + y_error_sum_ = 0; + return tracking_status; - case Waiting: - x_error = current_ball_pan_ * 0.7; - y_error = current_ball_tilt_ * 0.7; - ball_size = current_ball_bottom_; - break; + case Waiting: + tracking_status_ = tracking_status; + return tracking_status; - case Found: - x_error = -atan(ball_position_.x * tan(FOV_WIDTH)); - y_error = -atan(ball_position_.y * tan(FOV_HEIGHT)); - ball_size = ball_position_.z; - break; + case Found: + x_error = -atan(ball_position_.x * tan(FOV_WIDTH)); + y_error = -atan(ball_position_.y * tan(FOV_HEIGHT)); + ball_size = ball_position_.z; + break; - default: - break; + default: + break; } ROS_INFO_STREAM_COND(DEBUG_PRINT, "--------------------------------------------------------------"); @@ -176,21 +189,34 @@ int BallTracker::processTracking() double delta_time = dur.nsec * 0.000000001 + dur.sec; prev_time_ = curr_time; - // double p_gain = 0.7, d_gain = 0.05; - double p_gain = 0.75, d_gain = 0.04; double x_error_diff = (x_error - current_ball_pan_) / delta_time; double y_error_diff = (y_error - current_ball_tilt_) / delta_time; - double x_error_target = x_error * p_gain + x_error_diff * d_gain; - double y_error_target = y_error * p_gain + y_error_diff * d_gain; + x_error_sum_ += x_error; + y_error_sum_ += y_error; + double x_error_target = x_error * p_gain_ + x_error_diff * d_gain_ + x_error_sum_ * i_gain_; + double y_error_target = y_error * p_gain_ + y_error_diff * d_gain_ + y_error_sum_ * i_gain_; - ROS_INFO_STREAM_COND(DEBUG_PRINT, "--------------------------------------------------------------"); + // std_msgs::Float64MultiArray x_error_msg; + // x_error_msg.data.push_back(x_error); + // x_error_msg.data.push_back(x_error_diff); + // x_error_msg.data.push_back(x_error_sum_); + // x_error_msg.data.push_back(x_error * p_gain_); + // x_error_msg.data.push_back(x_error_diff * d_gain_); + // x_error_msg.data.push_back(x_error_sum_ * i_gain_); + // x_error_msg.data.push_back(x_error_target); + // error_pub_.publish(x_error_msg); + + ROS_INFO_STREAM_COND(DEBUG_PRINT, "------------------------ " << tracking_status << " --------------------------------------"); ROS_INFO_STREAM_COND(DEBUG_PRINT, "error : " << (x_error * 180 / M_PI) << " | " << (y_error * 180 / M_PI)); ROS_INFO_STREAM_COND( - DEBUG_PRINT, - "error_diff : " << (x_error_diff * 180 / M_PI) << " | " << (y_error_diff * 180 / M_PI) << " | " << delta_time); + DEBUG_PRINT, + "error_diff : " << (x_error_diff * 180 / M_PI) << " | " << (y_error_diff * 180 / M_PI) << " | " << delta_time); ROS_INFO_STREAM_COND( - DEBUG_PRINT, - "error_target : " << (x_error_target * 180 / M_PI) << " | " << (y_error_target * 180 / M_PI) << " | P : " << p_gain << " | D : " << d_gain); + DEBUG_PRINT, + "error_sum : " << (x_error_sum_ * 180 / M_PI) << " | " << (y_error_sum_ * 180 / M_PI)); + ROS_INFO_STREAM_COND( + DEBUG_PRINT, + "error_target : " << (x_error_target * 180 / M_PI) << " | " << (y_error_target * 180 / M_PI) << " | P : " << p_gain_ << " | D : " << d_gain_ << " | time : " << delta_time); // move head joint publishHeadJoint(x_error_target, y_error_target); @@ -201,7 +227,6 @@ int BallTracker::processTracking() current_ball_bottom_ = ball_size; ball_position_.z = 0; - //count_not_found_ = 0; tracking_status_ = tracking_status; return tracking_status; diff --git a/op3_demo/src/soccer/soccer_demo.cpp b/op3_demo/src/soccer/soccer_demo.cpp index bd887b7..0565152 100644 --- a/op3_demo/src/soccer/soccer_demo.cpp +++ b/op3_demo/src/soccer/soccer_demo.cpp @@ -22,20 +22,20 @@ namespace robotis_op { SoccerDemo::SoccerDemo() - : FALL_FORWARD_LIMIT(60), - FALL_BACK_LIMIT(-60), - SPIN_RATE(30), - DEBUG_PRINT(false), - wait_count_(0), - on_following_ball_(false), - restart_soccer_(false), - start_following_(false), - stop_following_(false), - stop_fallen_check_(false), - robot_status_(Waited), - stand_state_(Stand), - tracking_status_(BallTracker::Waiting), - present_pitch_(0) + : FALL_FORWARD_LIMIT(60), + FALL_BACK_LIMIT(-60), + SPIN_RATE(30), + DEBUG_PRINT(false), + wait_count_(0), + on_following_ball_(false), + restart_soccer_(false), + start_following_(false), + stop_following_(false), + stop_fallen_check_(false), + robot_status_(Waited), + stand_state_(Stand), + tracking_status_(BallTracker::Waiting), + present_pitch_(0) { //init ros enable_ = false; @@ -66,8 +66,6 @@ void SoccerDemo::setDemoEnable() void SoccerDemo::setDemoDisable() { - setModuleToDemo("base_module"); - // handle disable procedure ball_tracker_.stopTracking(); ball_follower_.stopFollowing(); @@ -85,8 +83,10 @@ void SoccerDemo::setDemoDisable() void SoccerDemo::process() { + if(enable_ == false) + return; + // ball tracking - bool is_tracked; int tracking_status; tracking_status = ball_tracker_.processTracking(); @@ -101,9 +101,6 @@ void SoccerDemo::process() wait_count_ = 1 * SPIN_RATE; } - //for debug - //return; - // check to stop if (stop_following_ == true) { @@ -121,20 +118,20 @@ void SoccerDemo::process() { switch(tracking_status) { - case BallTracker::Found: - ball_follower_.processFollowing(ball_tracker_.getPanOfBall(), ball_tracker_.getTiltOfBall(), 0.0); - if(tracking_status_ != tracking_status) - setRGBLED(0x1F, 0x1F, 0x1F); - break; + case BallTracker::Found: + ball_follower_.processFollowing(ball_tracker_.getPanOfBall(), ball_tracker_.getTiltOfBall(), 0.0); + if(tracking_status_ != tracking_status) + setRGBLED(0x1F, 0x1F, 0x1F); + break; - case BallTracker::NotFound: - ball_follower_.waitFollowing(); - if(tracking_status_ != tracking_status) - setRGBLED(0, 0, 0); - break; + case BallTracker::NotFound: + ball_follower_.waitFollowing(); + if(tracking_status_ != tracking_status) + setRGBLED(0, 0, 0); + break; - default: - break; + default: + break; } if(tracking_status != tracking_status_) @@ -144,32 +141,32 @@ void SoccerDemo::process() // check fallen states switch (stand_state_) { - case Stand: + case Stand: + { + // check restart soccer + if (restart_soccer_ == true) { - // check restart soccer - if (restart_soccer_ == true) - { - restart_soccer_ = false; - startSoccerMode(); - break; - } - - // check states for kick - int ball_position = ball_follower_.getBallPosition(); - if (ball_position != robotis_op::BallFollower::NotFound) - { - ball_follower_.stopFollowing(); - handleKick(ball_position); - } + restart_soccer_ = false; + startSoccerMode(); break; } - // fallen state : Fallen_Forward, Fallen_Behind - default: + + // check states for kick + int ball_position = ball_follower_.getBallPosition(); + if (ball_position != robotis_op::BallFollower::NotFound) { ball_follower_.stopFollowing(); - handleFallen(stand_state_); - break; + handleKick(ball_position); } + break; + } + // fallen state : Fallen_Forward, Fallen_Behind + default: + { + ball_follower_.stopFollowing(); + handleFallen(stand_state_); + break; + } } } else @@ -212,6 +209,7 @@ void SoccerDemo::callbackThread() imu_data_sub_ = nh.subscribe("/robotis/open_cr/imu", 1, &SoccerDemo::imuDataCallback, this); is_running_client_ = nh.serviceClient("/robotis/action/is_running"); + set_joint_module_client_ = nh.serviceClient("/robotis/set_present_joint_ctrl_modules"); while (nh.ok()) { @@ -252,12 +250,15 @@ void SoccerDemo::setBodyModuleToDemo(const std::string &body_module, bool with_h if (control_msg.joint_name.size() == 0) return; - module_control_pub_.publish(control_msg); + callServiceSettingModule(control_msg); std::cout << "enable module of body : " << body_module << std::endl; } void SoccerDemo::setModuleToDemo(const std::string &module_name) { + if(enable_ == false) + return; + robotis_controller_msgs::JointCtrlModule control_msg; std::map::iterator joint_iter; @@ -271,10 +272,25 @@ void SoccerDemo::setModuleToDemo(const std::string &module_name) if (control_msg.joint_name.size() == 0) return; - module_control_pub_.publish(control_msg); + callServiceSettingModule(control_msg); std::cout << "enable module : " << module_name << std::endl; } +void SoccerDemo::callServiceSettingModule(const robotis_controller_msgs::JointCtrlModule &modules) +{ + robotis_controller_msgs::SetJointModule set_joint_srv; + set_joint_srv.request.joint_name = modules.joint_name; + set_joint_srv.request.module_name = modules.module_name; + + if (set_joint_module_client_.call(set_joint_srv) == false) + { + ROS_ERROR("Failed to set module"); + return; + } + + return ; +} + void SoccerDemo::parseJointNameFromYaml(const std::string &path) { YAML::Node doc; @@ -414,16 +430,10 @@ void SoccerDemo::startSoccerMode() { setModuleToDemo("action_module"); - usleep(100 * 1000); - playMotion(WalkingReady); - usleep(1500 * 1000); - setBodyModuleToDemo("walking_module"); - usleep(20 * 1000); - ROS_INFO("Start Soccer Demo"); on_following_ball_ = true; start_following_ = true; @@ -445,24 +455,24 @@ void SoccerDemo::handleKick(int ball_position) usleep(1500 * 1000); - if (handleFallen(stand_state_) == true) + if (handleFallen(stand_state_) == true || enable_ == false) return; // kick motion switch (ball_position) { - case robotis_op::BallFollower::OnRight: - std::cout << "Kick Motion [R]: " << ball_position << std::endl; - playMotion(is_grass_ ? RightKick + ForGrass : RightKick); - break; + case robotis_op::BallFollower::OnRight: + std::cout << "Kick Motion [R]: " << ball_position << std::endl; + playMotion(is_grass_ ? RightKick + ForGrass : RightKick); + break; - case robotis_op::BallFollower::OnLeft: - std::cout << "Kick Motion [L]: " << ball_position << std::endl; - playMotion(is_grass_ ? LeftKick + ForGrass : LeftKick); - break; + case robotis_op::BallFollower::OnLeft: + std::cout << "Kick Motion [L]: " << ball_position << std::endl; + playMotion(is_grass_ ? LeftKick + ForGrass : LeftKick); + break; - default: - break; + default: + break; } on_following_ball_ = false; @@ -487,23 +497,21 @@ bool SoccerDemo::handleFallen(int fallen_status) // change to motion module setModuleToDemo("action_module"); - usleep(600 * 1000); - // getup motion switch (fallen_status) { - case Fallen_Forward: - std::cout << "Getup Motion [F]: " << std::endl; - playMotion(is_grass_ ? GetUpFront + ForGrass : GetUpFront); - break; + case Fallen_Forward: + std::cout << "Getup Motion [F]: " << std::endl; + playMotion(is_grass_ ? GetUpFront + ForGrass : GetUpFront); + break; - case Fallen_Behind: - std::cout << "Getup Motion [B]: " << std::endl; - playMotion(is_grass_ ? GetUpBack + ForGrass : GetUpBack); - break; + case Fallen_Behind: + std::cout << "Getup Motion [B]: " << std::endl; + playMotion(is_grass_ ? GetUpBack + ForGrass : GetUpBack); + break; - default: - break; + default: + break; } while(isActionRunning() == true) diff --git a/op3_demo/src/test_node.cpp b/op3_demo/src/test_node.cpp index 6671097..259ea96 100644 --- a/op3_demo/src/test_node.cpp +++ b/op3_demo/src/test_node.cpp @@ -44,12 +44,17 @@ void goInitPose(); void playSound(const std::string &path); void setLED(int led); bool checkManagerRunning(std::string& manager_name); +void dxlTorqueChecker(); + +void demoModeCommandCallback(const std_msgs::String::ConstPtr &msg); const int SPIN_RATE = 30; +const bool DEBUG_PRINT = true; ros::Publisher init_pose_pub; ros::Publisher play_sound_pub; ros::Publisher led_pub; +ros::Publisher dxl_torque_pub; std::string default_mp3_path = ""; int current_status = Ready; @@ -75,7 +80,9 @@ int main(int argc, char **argv) init_pose_pub = nh.advertise("/robotis/base/ini_pose", 0); play_sound_pub = nh.advertise("/play_sound_file", 0); led_pub = nh.advertise("/robotis/sync_write_item", 0); + dxl_torque_pub = nh.advertise("/robotis/dxl_torque", 0); ros::Subscriber buttuon_sub = nh.subscribe("/robotis/open_cr/button", 1, buttonHandlerCallback); + ros::Subscriber mode_command_sub = nh.subscribe("/robotis/mode_command", 1, demoModeCommandCallback); default_mp3_path = ros::package::getPath("op3_demo") + "/Data/mp3/"; @@ -93,7 +100,7 @@ int main(int argc, char **argv) if (checkManagerRunning(manager_name) == true) { break; - ROS_INFO("Succeed to connect"); + ROS_INFO_COND(DEBUG_PRINT, "Succeed to connect"); } ROS_WARN("Waiting for op3 manager"); } @@ -120,7 +127,7 @@ int main(int argc, char **argv) goInitPose(); - ROS_INFO("[Go to Demo READY!]"); + ROS_INFO_COND(DEBUG_PRINT, "[Go to Demo READY!]"); break; } @@ -132,7 +139,7 @@ int main(int argc, char **argv) current_demo = soccer_demo; current_demo->setDemoEnable(); - ROS_INFO("[Start] Soccer Demo"); + ROS_INFO_COND(DEBUG_PRINT, "[Start] Soccer Demo"); break; } @@ -143,7 +150,7 @@ int main(int argc, char **argv) current_demo = vision_demo; current_demo->setDemoEnable(); - ROS_INFO("[Start] Vision Demo"); + ROS_INFO_COND(DEBUG_PRINT, "[Start] Vision Demo"); break; } case ActionDemo: @@ -153,7 +160,7 @@ int main(int argc, char **argv) current_demo = action_demo; current_demo->setDemoEnable(); - ROS_INFO("[Start] Action Demo"); + ROS_INFO_COND(DEBUG_PRINT, "[Start] Action Demo"); break; } case ButtonTest: @@ -163,7 +170,7 @@ int main(int argc, char **argv) current_demo = button_test; current_demo->setDemoEnable(); - ROS_INFO("[Start] Button Test"); + ROS_INFO_COND(DEBUG_PRINT, "[Start] Button Test"); break; } case MicTest: @@ -173,7 +180,7 @@ int main(int argc, char **argv) current_demo = mic_test; current_demo->setDemoEnable(); - ROS_INFO("[Start] Mic Test"); + ROS_INFO_COND(DEBUG_PRINT, "[Start] Mic Test"); break; } @@ -205,6 +212,9 @@ int main(int argc, char **argv) void buttonHandlerCallback(const std_msgs::String::ConstPtr& msg) { + if(apply_desired == true) + return; + // in the middle of playing demo if (current_status != Ready) { @@ -236,22 +246,27 @@ void buttonHandlerCallback(const std_msgs::String::ConstPtr& msg) switch (desired_status) { case SoccerDemo: + dxlTorqueChecker(); playSound(default_mp3_path + "Start soccer demonstration.mp3"); break; case VisionDemo: + dxlTorqueChecker(); playSound(default_mp3_path + "Start vision processing demonstration.mp3"); break; case ActionDemo: + dxlTorqueChecker(); playSound(default_mp3_path + "Start motion demonstration.mp3"); break; case ButtonTest: + dxlTorqueChecker(); playSound(default_mp3_path + "test/Start button test mode.mp3"); break; case MicTest: + dxlTorqueChecker(); playSound(default_mp3_path + "test/Start mic test mode.mp3"); break; @@ -259,7 +274,7 @@ void buttonHandlerCallback(const std_msgs::String::ConstPtr& msg) break; } - ROS_INFO("= Start Demo Mode : %d", desired_status); + ROS_INFO_COND(DEBUG_PRINT, "= Start Demo Mode : %d", desired_status); } else if (msg->data == "mode") { @@ -299,7 +314,7 @@ void buttonHandlerCallback(const std_msgs::String::ConstPtr& msg) break; } - ROS_INFO("= Demo Mode : %d", desired_status); + ROS_INFO_COND(DEBUG_PRINT, "= Demo Mode : %d", desired_status); } } } @@ -344,3 +359,63 @@ bool checkManagerRunning(std::string& manager_name) ROS_ERROR("Can't find op3_manager"); return false; } + +void dxlTorqueChecker() +{ + std_msgs::String check_msg; + check_msg.data = "check"; + + dxl_torque_pub.publish(check_msg); +} + +void demoModeCommandCallback(const std_msgs::String::ConstPtr &msg) +{ + // In demo mode + if (current_status != Ready) + { + if (msg->data == "ready") + { + // go to mode selection status + desired_status = Ready; + apply_desired = true; + + playSound(default_mp3_path + "Demonstration ready mode.mp3"); + setLED(0x01 | 0x02 | 0x04); + } + } + // In ready mode + else + { + if(msg->data == "soccer") + { + desired_status = SoccerDemo; + apply_desired = true; + + // play sound + dxlTorqueChecker(); + playSound(default_mp3_path + "Start soccer demonstration.mp3"); + ROS_INFO_COND(DEBUG_PRINT, "= Start Demo Mode : %d", desired_status); + } + else if(msg->data == "vision") + { + desired_status = VisionDemo; + apply_desired = true; + + // play sound + dxlTorqueChecker(); + playSound(default_mp3_path + "Start vision processing demonstration.mp3"); + ROS_INFO_COND(DEBUG_PRINT, "= Start Demo Mode : %d", desired_status); + } + else if(msg->data == "action") + { + desired_status = ActionDemo; + apply_desired = true; + + // play sound + dxlTorqueChecker(); + playSound(default_mp3_path + "Start motion demonstration.mp3"); + ROS_INFO_COND(DEBUG_PRINT, "= Start Demo Mode : %d", desired_status); + } + } +} + diff --git a/op3_demo/src/vision/face_tracker.cpp b/op3_demo/src/vision/face_tracker.cpp index 36a32a4..f9b3e24 100644 --- a/op3_demo/src/vision/face_tracker.cpp +++ b/op3_demo/src/vision/face_tracker.cpp @@ -23,7 +23,7 @@ namespace robotis_op FaceTracker::FaceTracker() : nh_(ros::this_node::getName()), - FOV_WIDTH(26.4 * M_PI / 180), + FOV_WIDTH(35.2 * M_PI / 180), FOV_HEIGHT(21.6 * M_PI / 180), NOT_FOUND_THRESHOLD(50), use_head_scan_(false), diff --git a/op3_demo/src/vision/vision_demo.cpp b/op3_demo/src/vision/vision_demo.cpp index ea91bd8..1062e5c 100644 --- a/op3_demo/src/vision/vision_demo.cpp +++ b/op3_demo/src/vision/vision_demo.cpp @@ -23,7 +23,6 @@ namespace robotis_op VisionDemo::VisionDemo() : SPIN_RATE(30), - is_tracking_(false), tracking_status_(FaceTracker::Waiting) { enable_ = false; @@ -44,18 +43,15 @@ void VisionDemo::setDemoEnable() // change to motion module setModuleToDemo("action_module"); - usleep(100 * 1000); - playMotion(InitPose); usleep(1500 * 1000); setModuleToDemo("head_control_module"); - usleep(20 * 1000); - enable_ = true; + // send command to start face_tracking std_msgs::Bool command; command.data = enable_; face_tracking_command_pub_.publish(command); @@ -70,7 +66,6 @@ void VisionDemo::setDemoDisable() { face_tracker_.stopTracking(); - is_tracking_ = false; tracking_status_ = FaceTracker::Waiting; enable_ = false; @@ -102,9 +97,6 @@ void VisionDemo::process() if(tracking_status != FaceTracker::Waiting) tracking_status_ = tracking_status; - - //is_tracking_ = is_tracked; - //std::cout << "Tracking : " << tracking_status << std::endl; } void VisionDemo::processThread() @@ -136,6 +128,8 @@ void VisionDemo::callbackThread() buttuon_sub_ = nh.subscribe("/robotis/open_cr/button", 1, &VisionDemo::buttonHandlerCallback, this); faceCoord_sub_ = nh.subscribe("/faceCoord", 1, &VisionDemo::facePositionCallback, this); + set_joint_module_client_ = nh.serviceClient("/robotis/set_present_ctrl_modules"); + while (nh.ok()) { ros::spinOnce(); @@ -176,11 +170,22 @@ void VisionDemo::demoCommandCallback(const std_msgs::String::ConstPtr &msg) void VisionDemo::setModuleToDemo(const std::string &module_name) { - std_msgs::String control_msg; - control_msg.data = module_name; + callServiceSettingModule(module_name); + ROS_INFO_STREAM("enable module : " << module_name); +} - module_control_pub_.publish(control_msg); - std::cout << "enable module : " << module_name << std::endl; +void VisionDemo::callServiceSettingModule(const std::string &module_name) +{ + robotis_controller_msgs::SetModule set_module_srv; + set_module_srv.request.module_name = module_name; + + if (set_joint_module_client_.call(set_module_srv) == false) + { + ROS_ERROR("Failed to set module"); + return; + } + + return ; } void VisionDemo::facePositionCallback(const std_msgs::Int32MultiArray::ConstPtr &msg) From 22d0b5b59c00b92df1878c90cf043c984714ebdc Mon Sep 17 00:00:00 2001 From: Kayman Date: Wed, 28 Mar 2018 15:09:23 +0900 Subject: [PATCH 28/66] changed default setting of ball_detector --- ball_detector/launch/ball_detector_params.yaml | 4 ++-- .../launch/ball_detector_params_default.yaml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ball_detector/launch/ball_detector_params.yaml b/ball_detector/launch/ball_detector_params.yaml index 2992b70..49cc203 100644 --- a/ball_detector/launch/ball_detector_params.yaml +++ b/ball_detector/launch/ball_detector_params.yaml @@ -10,7 +10,7 @@ filter_h_min: 350 filter_h_max: 15 filter_s_min: 200 filter_s_max: 255 -filter_v_min: 80 +filter_v_min: 60 filter_v_max: 255 use_second_filter: false filter2_h_min: 30 @@ -19,5 +19,5 @@ filter2_s_min: 0 filter2_s_max: 40 filter2_v_min: 200 filter2_v_max: 255 -ellipse_size: 1 +ellipse_size: 2 filter_debug: false \ No newline at end of file diff --git a/ball_detector/launch/ball_detector_params_default.yaml b/ball_detector/launch/ball_detector_params_default.yaml index 4569b97..49cc203 100644 --- a/ball_detector/launch/ball_detector_params_default.yaml +++ b/ball_detector/launch/ball_detector_params_default.yaml @@ -1,5 +1,5 @@ gaussian_blur_size: 7 -gaussian_blur_sigma: 2.0 +gaussian_blur_sigma: 2 canny_edge_th: 100 hough_accum_resolution: 1 min_circle_dist: 100 @@ -7,10 +7,10 @@ hough_accum_th: 28 min_radius: 20 max_radius: 300 filter_h_min: 350 -filter_h_max: 20 -filter_s_min: 220 +filter_h_max: 15 +filter_s_min: 200 filter_s_max: 255 -filter_v_min: 80 +filter_v_min: 60 filter_v_max: 255 use_second_filter: false filter2_h_min: 30 @@ -19,5 +19,5 @@ filter2_s_min: 0 filter2_s_max: 40 filter2_v_min: 200 filter2_v_max: 255 -ellipse_size: 1 -filter_debug: false +ellipse_size: 2 +filter_debug: false \ No newline at end of file From aec0c193c5d8c9d09b787b38c2008307619c1174 Mon Sep 17 00:00:00 2001 From: Kayman Date: Wed, 28 Mar 2018 16:16:42 +0900 Subject: [PATCH 29/66] changed CMakeLists.txt --- ball_detector/CMakeLists.txt | 20 +++++++++++++++++++- op3_demo/CMakeLists.txt | 26 +++++++++++++++++++++++--- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/ball_detector/CMakeLists.txt b/ball_detector/CMakeLists.txt index a79af76..09858b1 100644 --- a/ball_detector/CMakeLists.txt +++ b/ball_detector/CMakeLists.txt @@ -19,6 +19,23 @@ find_package(catkin REQUIRED COMPONENTS message_generation ) +## Resolve system dependency on yaml-cpp, which apparently does not +## provide a CMake find_package() module. +find_package(PkgConfig REQUIRED) +pkg_check_modules(YAML_CPP REQUIRED yaml-cpp) +find_path(YAML_CPP_INCLUDE_DIR + NAMES yaml_cpp.h + PATHS ${YAML_CPP_INCLUDE_DIRS} +) +find_library(YAML_CPP_LIBRARY + NAMES YAML_CPP + PATHS ${YAML_CPP_LIBRARY_DIRS} +) +link_directories(${YAML_CPP_LIBRARY_DIRS}) + +if(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") +add_definitions(-DHAVE_NEW_YAMLCPP) +endif(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") ################################################################################ # Declare ROS messages, services and actions ################################################################################ @@ -59,6 +76,7 @@ catkin_package( include_directories( include ${catkin_INCLUDE_DIRS} + ${YAML_CPP_INCLUDE_DIRS} ) add_executable(ball_detector_node @@ -69,7 +87,7 @@ add_dependencies(ball_detector_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin target_link_libraries(ball_detector_node ${catkin_LIBRARIES} - yaml-cpp + ${YAML_CPP_LIBRARIES} ) ################################################################################ diff --git a/op3_demo/CMakeLists.txt b/op3_demo/CMakeLists.txt index 4615615..b721d98 100644 --- a/op3_demo/CMakeLists.txt +++ b/op3_demo/CMakeLists.txt @@ -19,8 +19,25 @@ find_package(catkin REQUIRED COMPONENTS robotis_math ) -find_package(Eigen REQUIRED) +find_package(Eigen3 REQUIRED) +## Resolve system dependency on yaml-cpp, which apparently does not +## provide a CMake find_package() module. +find_package(PkgConfig REQUIRED) +pkg_check_modules(YAML_CPP REQUIRED yaml-cpp) +find_path(YAML_CPP_INCLUDE_DIR + NAMES yaml_cpp.h + PATHS ${YAML_CPP_INCLUDE_DIRS} +) +find_library(YAML_CPP_LIBRARY + NAMES YAML_CPP + PATHS ${YAML_CPP_LIBRARY_DIRS} +) +link_directories(${YAML_CPP_LIBRARY_DIRS}) + +if(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") +add_definitions(-DHAVE_NEW_YAMLCPP) +endif(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") ################################################################################ # Declare ROS messages, services and actions @@ -36,6 +53,7 @@ find_package(Eigen REQUIRED) catkin_package( INCLUDE_DIRS include CATKIN_DEPENDS roscpp sensor_msgs + DEPENDS EIGEN3 ) ################################################################################ @@ -44,7 +62,8 @@ catkin_package( include_directories( include ${catkin_INCLUDE_DIRS} - ${Eigen_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIRS} + ${YAML_CPP_INCLUDE_DIRS} ) add_executable(op_demo_node @@ -80,7 +99,8 @@ add_dependencies(self_test_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXP target_link_libraries(self_test_node ${catkin_LIBRARIES} - yaml-cpp + ${Eigen3_LIBRARIES} + ${YAML_CPP_LIBRARIES} ) ################################################################################ From 25c569c91121caa6eff356850cf66b099437cb6d Mon Sep 17 00:00:00 2001 From: Kayman Date: Wed, 28 Mar 2018 16:26:25 +0900 Subject: [PATCH 30/66] fixed CMakeLists.txt --- ball_detector/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/ball_detector/CMakeLists.txt b/ball_detector/CMakeLists.txt index 09858b1..1456418 100644 --- a/ball_detector/CMakeLists.txt +++ b/ball_detector/CMakeLists.txt @@ -12,6 +12,7 @@ find_package(catkin REQUIRED COMPONENTS cv_bridge geometry_msgs image_transport + cmake_modules roscpp rospy std_msgs From a6ca620b7be33258673f2bcf5fede90758c85d10 Mon Sep 17 00:00:00 2001 From: Kayman Date: Wed, 28 Mar 2018 16:46:38 +0900 Subject: [PATCH 31/66] added cmake_modules for test. --- ball_detector/CMakeLists.txt | 2 +- ball_detector/package.xml | 2 ++ op3_demo/CMakeLists.txt | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ball_detector/CMakeLists.txt b/ball_detector/CMakeLists.txt index 1456418..a81a3d7 100644 --- a/ball_detector/CMakeLists.txt +++ b/ball_detector/CMakeLists.txt @@ -68,7 +68,7 @@ generate_dynamic_reconfigure_options(cfg/detector_params.cfg) ################################################################################ catkin_package( INCLUDE_DIRS include - CATKIN_DEPENDS cv_bridge geometry_msgs image_transport roscpp rospy std_msgs dynamic_reconfigure + CATKIN_DEPENDS cv_bridge cmake_modules geometry_msgs image_transport roscpp rospy std_msgs dynamic_reconfigure ) ################################################################################ diff --git a/ball_detector/package.xml b/ball_detector/package.xml index 79f988f..25ce8ce 100644 --- a/ball_detector/package.xml +++ b/ball_detector/package.xml @@ -19,6 +19,7 @@ roscpp rospy std_msgs + cmake_modules dynamic_reconfigure message_generation roslib @@ -28,6 +29,7 @@ roscpp rospy std_msgs + cmake_modules dynamic_reconfigure message_runtime diff --git a/op3_demo/CMakeLists.txt b/op3_demo/CMakeLists.txt index b721d98..d002446 100644 --- a/op3_demo/CMakeLists.txt +++ b/op3_demo/CMakeLists.txt @@ -52,7 +52,7 @@ endif(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") ################################################################################ catkin_package( INCLUDE_DIRS include - CATKIN_DEPENDS roscpp sensor_msgs + CATKIN_DEPENDS roscpp sensor_msgs cmake_modules DEPENDS EIGEN3 ) From 15ad67a9a1ce473ac8fd096db7b19319fc66ab65 Mon Sep 17 00:00:00 2001 From: Kayman Date: Wed, 28 Mar 2018 16:59:31 +0900 Subject: [PATCH 32/66] fixed CMakeLists.txt and package.xml --- ball_detector/CMakeLists.txt | 3 +-- ball_detector/package.xml | 31 ++++++++++++------------------- op3_demo/package.xml | 29 +++++++++++------------------ 3 files changed, 24 insertions(+), 39 deletions(-) diff --git a/ball_detector/CMakeLists.txt b/ball_detector/CMakeLists.txt index a81a3d7..09858b1 100644 --- a/ball_detector/CMakeLists.txt +++ b/ball_detector/CMakeLists.txt @@ -12,7 +12,6 @@ find_package(catkin REQUIRED COMPONENTS cv_bridge geometry_msgs image_transport - cmake_modules roscpp rospy std_msgs @@ -68,7 +67,7 @@ generate_dynamic_reconfigure_options(cfg/detector_params.cfg) ################################################################################ catkin_package( INCLUDE_DIRS include - CATKIN_DEPENDS cv_bridge cmake_modules geometry_msgs image_transport roscpp rospy std_msgs dynamic_reconfigure + CATKIN_DEPENDS cv_bridge geometry_msgs image_transport roscpp rospy std_msgs dynamic_reconfigure ) ################################################################################ diff --git a/ball_detector/package.xml b/ball_detector/package.xml index 25ce8ce..e0d63a5 100644 --- a/ball_detector/package.xml +++ b/ball_detector/package.xml @@ -12,24 +12,17 @@ Pyo catkin - roslib - cv_bridge - geometry_msgs - image_transport - roscpp - rospy - std_msgs - cmake_modules - dynamic_reconfigure + roslib + cv_bridge + geometry_msgs + image_transport + roscpp + rospy + std_msgs + cmake_modules + dynamic_reconfigure + yaml-cpp message_generation - roslib - cv_bridge - geometry_msgs - image_transport - roscpp - rospy - std_msgs - cmake_modules - dynamic_reconfigure - message_runtime + message_runtime + message_runtime diff --git a/op3_demo/package.xml b/op3_demo/package.xml index 68baa53..ccc8d31 100644 --- a/op3_demo/package.xml +++ b/op3_demo/package.xml @@ -11,22 +11,15 @@ Pyo catkin - roscpp - roslib - sensor_msgs - ball_detector - robotis_controller_msgs - op3_walking_module_msgs - op3_action_module_msgs - cmake_modules - robotis_math - roscpp - roslib - sensor_msgs - ball_detector - robotis_controller_msgs - op3_walking_module_msgs - op3_action_module_msgs - cmake_modules - robotis_math + roscpp + roslib + sensor_msgs + ball_detector + robotis_controller_msgs + op3_walking_module_msgs + op3_action_module_msgs + cmake_modules + robotis_math + eigen + yaml-cpp From ad3be190eab099eb18dd05eab0e432982f9a3f97 Mon Sep 17 00:00:00 2001 From: Kayman Date: Wed, 28 Mar 2018 17:04:39 +0900 Subject: [PATCH 33/66] fixed wrong syntax --- ball_detector/package.xml | 2 +- op3_demo/package.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ball_detector/package.xml b/ball_detector/package.xml index e0d63a5..c612c4f 100644 --- a/ball_detector/package.xml +++ b/ball_detector/package.xml @@ -1,5 +1,5 @@ - + ball_detector 0.1.0 diff --git a/op3_demo/package.xml b/op3_demo/package.xml index ccc8d31..cff56e8 100644 --- a/op3_demo/package.xml +++ b/op3_demo/package.xml @@ -1,5 +1,5 @@ - + op3_demo 0.1.0 From 7106ae6bddabe8caf4aa362cd75be3fabd3da9ca Mon Sep 17 00:00:00 2001 From: Kayman Date: Wed, 28 Mar 2018 17:22:08 +0900 Subject: [PATCH 34/66] test for dynamic reconfigure settting --- ball_detector/package.xml | 6 ++++-- op3_demo/package.xml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ball_detector/package.xml b/ball_detector/package.xml index c612c4f..47af0d6 100644 --- a/ball_detector/package.xml +++ b/ball_detector/package.xml @@ -1,7 +1,7 @@ ball_detector - 0.1.0 + 0.1.1 This package implements a circle-like shape detector of the input image. It requires and input image and publish, at frame rate, a marked image @@ -20,9 +20,11 @@ rospy std_msgs cmake_modules - dynamic_reconfigure yaml-cpp message_generation message_runtime message_runtime + dynamic_reconfigure + dynamic_reconfigure + dynamic_reconfigure diff --git a/op3_demo/package.xml b/op3_demo/package.xml index cff56e8..70af22d 100644 --- a/op3_demo/package.xml +++ b/op3_demo/package.xml @@ -1,7 +1,7 @@ op3_demo - 0.1.0 + 0.1.1 op3 default demo It includes three demontrations(soccer demo, vision demo, action script demo) From 8742227fa076b43469d73f61c751832a139e2859 Mon Sep 17 00:00:00 2001 From: Pyo Date: Wed, 28 Mar 2018 19:36:08 +0900 Subject: [PATCH 35/66] added gencfg to generate dynamic reconfigure --- ball_detector/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ball_detector/CMakeLists.txt b/ball_detector/CMakeLists.txt index 09858b1..d97925a 100644 --- a/ball_detector/CMakeLists.txt +++ b/ball_detector/CMakeLists.txt @@ -83,8 +83,7 @@ add_executable(ball_detector_node src/ball_detector.cpp src/ball_detector_node.cpp) -add_dependencies(ball_detector_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) - +add_dependencies(ball_detector_node ${PROJECT_NAME}_gencfg ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) target_link_libraries(ball_detector_node ${catkin_LIBRARIES} ${YAML_CPP_LIBRARIES} From 3cb37bf37b1bd3fe2b0fdd1c6126ff0fca7ad15e Mon Sep 17 00:00:00 2001 From: Pyo Date: Wed, 28 Mar 2018 20:15:46 +0900 Subject: [PATCH 36/66] Update and rename detector_params.cfg to DetectorParams.cfg --- ball_detector/cfg/{detector_params.cfg => DetectorParams.cfg} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename ball_detector/cfg/{detector_params.cfg => DetectorParams.cfg} (97%) diff --git a/ball_detector/cfg/detector_params.cfg b/ball_detector/cfg/DetectorParams.cfg similarity index 97% rename from ball_detector/cfg/detector_params.cfg rename to ball_detector/cfg/DetectorParams.cfg index 2d61d6c..1d3e29c 100755 --- a/ball_detector/cfg/detector_params.cfg +++ b/ball_detector/cfg/DetectorParams.cfg @@ -30,4 +30,4 @@ gen.add("filter2_v_max",int_t , -1, "Threshold of V filter", 255, 0, 255) gen.add("ellipse_size",int_t , -1, "Ellipse size", 2, 1, 9) gen.add("debug_image", bool_t, 0, "Show filtered image to debug", False) -exit(gen.generate(PACKAGE, "ball_detector_node", "detectorParams")) +exit(gen.generate(PACKAGE, "ball_detector_node", "DetectorParams")) From f0051d7182270df293b4038ac9cea71cdf9872cb Mon Sep 17 00:00:00 2001 From: Pyo Date: Wed, 28 Mar 2018 20:16:30 +0900 Subject: [PATCH 37/66] Update and rename detector_params.cfg to DetectorParams.cfg --- ball_detector/cfg/{detector_params.cfg => DetectorParams.cfg} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename ball_detector/cfg/{detector_params.cfg => DetectorParams.cfg} (97%) diff --git a/ball_detector/cfg/detector_params.cfg b/ball_detector/cfg/DetectorParams.cfg similarity index 97% rename from ball_detector/cfg/detector_params.cfg rename to ball_detector/cfg/DetectorParams.cfg index 2d61d6c..1d3e29c 100755 --- a/ball_detector/cfg/detector_params.cfg +++ b/ball_detector/cfg/DetectorParams.cfg @@ -30,4 +30,4 @@ gen.add("filter2_v_max",int_t , -1, "Threshold of V filter", 255, 0, 255) gen.add("ellipse_size",int_t , -1, "Ellipse size", 2, 1, 9) gen.add("debug_image", bool_t, 0, "Show filtered image to debug", False) -exit(gen.generate(PACKAGE, "ball_detector_node", "detectorParams")) +exit(gen.generate(PACKAGE, "ball_detector_node", "DetectorParams")) From b14d9c5ad1d5c4ade055a6ba6685ad6f6d54a080 Mon Sep 17 00:00:00 2001 From: Pyo Date: Wed, 28 Mar 2018 20:18:19 +0900 Subject: [PATCH 38/66] Update ball_detector.h --- ball_detector/include/ball_detector/ball_detector.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ball_detector/include/ball_detector/ball_detector.h b/ball_detector/include/ball_detector/ball_detector.h index b246ff3..18cf79f 100644 --- a/ball_detector/include/ball_detector/ball_detector.h +++ b/ball_detector/include/ball_detector/ball_detector.h @@ -37,7 +37,7 @@ #include "ball_detector/circleSetStamped.h" #include "ball_detector/ball_detector_config.h" -#include "ball_detector/detectorParamsConfig.h" +#include "ball_detector/DetectorParamsConfig.h" #include "ball_detector/GetParameters.h" #include "ball_detector/SetParameters.h" @@ -71,7 +71,7 @@ class BallDetector //callbacks to camera info subscription void cameraInfoCallback(const sensor_msgs::CameraInfo & msg); - void dynParamCallback(ball_detector::detectorParamsConfig &config, uint32_t level); + void dynParamCallback(ball_detector::DetectorParamsConfig &config, uint32_t level); void enableCallback(const std_msgs::Bool::ConstPtr &msg); void paramCommandCallback(const std_msgs::String::ConstPtr &msg); @@ -154,8 +154,8 @@ class BallDetector cv::Mat in_image_; cv::Mat out_image_; - dynamic_reconfigure::Server param_server_; - dynamic_reconfigure::Server::CallbackType callback_fnc_; + dynamic_reconfigure::Server param_server_; + dynamic_reconfigure::Server::CallbackType callback_fnc_; }; } // namespace robotis_op From c7ad70b6a39ee98ba3156fa8e5f8c580edea3f17 Mon Sep 17 00:00:00 2001 From: Pyo Date: Wed, 28 Mar 2018 20:39:01 +0900 Subject: [PATCH 39/66] Update CMakeLists.txt --- ball_detector/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ball_detector/CMakeLists.txt b/ball_detector/CMakeLists.txt index d97925a..57f6e27 100644 --- a/ball_detector/CMakeLists.txt +++ b/ball_detector/CMakeLists.txt @@ -59,7 +59,7 @@ generate_messages( ################################################################################ # Declare ROS dynamic reconfigure parameters ################################################################################ -generate_dynamic_reconfigure_options(cfg/detector_params.cfg) +generate_dynamic_reconfigure_options(cfg/DetectorParams.cfg) ################################################################################ From 2122f8c493042fbaae8c36899bb686e083f6b5a8 Mon Sep 17 00:00:00 2001 From: Pyo Date: Wed, 28 Mar 2018 20:50:53 +0900 Subject: [PATCH 40/66] Update ball_detector.cpp --- ball_detector/src/ball_detector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ball_detector/src/ball_detector.cpp b/ball_detector/src/ball_detector.cpp index df4fe80..552c699 100644 --- a/ball_detector/src/ball_detector.cpp +++ b/ball_detector/src/ball_detector.cpp @@ -234,7 +234,7 @@ void BallDetector::imageCallback(const sensor_msgs::ImageConstPtr & msg) return; } -void BallDetector::dynParamCallback(ball_detector::detectorParamsConfig &config, uint32_t level) +void BallDetector::dynParamCallback(ball_detector::DetectorParamsConfig &config, uint32_t level) { params_config_.gaussian_blur_size = config.gaussian_blur_size; params_config_.gaussian_blur_sigma = config.gaussian_blur_sigma; From 04409995704db20e4cda5868bf4ffb842d8e063f Mon Sep 17 00:00:00 2001 From: Pyo Date: Fri, 30 Mar 2018 22:18:17 +0900 Subject: [PATCH 41/66] refacoring to release --- .travis.yml | 2 +- README.md | 34 ++++++ ball_detector/CMakeLists.txt | 64 +++++++--- ...params_blue.cfg => DetectorParamsBlue.cfg} | 2 +- ...r_params_red.cfg => DetectorParamsRed.cfg} | 2 +- .../ball_detector_params.yaml | 0 .../ball_detector_params_default.yaml | 0 .../ball_detector_params_op.yaml | 0 .../include/ball_detector/ball_detector.h | 27 +++-- ball_detector/launch/ball_detector.launch | 16 +-- .../launch/ball_detector_from_usb_cam.launch | 45 ++++---- .../launch/ball_detector_from_uvc.launch | 50 ++++---- ...cleSetStamped.msg => CircleSetStamped.msg} | 0 ball_detector/package.xml | 49 ++++---- .../{launch => rviz}/ball_detector.rviz | 0 ball_detector/src/ball_detector.cpp | 7 +- op3_demo/CMakeLists.txt | 109 +++++++++++------- .../mp3/Autonomous soccer mode.mp3 | Bin op3_demo/{Data => data}/mp3/Bye bye.mp3 | Bin op3_demo/{Data => data}/mp3/Clap please.mp3 | Bin .../mp3/Demonstration ready mode.mp3 | Bin op3_demo/{Data => data}/mp3/Headstand.mp3 | Bin .../mp3/Interactive motion mode.mp3 | Bin op3_demo/{Data => data}/mp3/Intro01.mp3 | Bin op3_demo/{Data => data}/mp3/Intro02.mp3 | Bin op3_demo/{Data => data}/mp3/Intro03.mp3 | Bin op3_demo/{Data => data}/mp3/Introduction.mp3 | Bin op3_demo/{Data => data}/mp3/Left kick.mp3 | Bin op3_demo/{Data => data}/mp3/No.mp3 | Bin op3_demo/{Data => data}/mp3/Oops.mp3 | Bin op3_demo/{Data => data}/mp3/Right kick.mp3 | Bin .../mp3/Sensor calibration complete.mp3 | Bin .../mp3/Sensor calibration fail.mp3 | Bin op3_demo/{Data => data}/mp3/Shoot.mp3 | Bin op3_demo/{Data => data}/mp3/Sit down.mp3 | Bin op3_demo/{Data => data}/mp3/Stand up.mp3 | Bin .../mp3/Start motion demonstration.mp3 | Bin .../mp3/Start soccer demonstration.mp3 | Bin .../Start vision processing demonstration.mp3 | Bin .../{Data => data}/mp3/System shutdown.mp3 | Bin op3_demo/{Data => data}/mp3/Thank you.mp3 | Bin .../mp3/Vision processing mode.mp3 | Bin op3_demo/{Data => data}/mp3/Wow.mp3 | Bin op3_demo/{Data => data}/mp3/Yes go.mp3 | Bin op3_demo/{Data => data}/mp3/Yes.mp3 | Bin op3_demo/{Data => data}/mp3/intro_test.mp3 | Bin .../mp3/test/Announce mic test.mp3 | Bin .../mp3/test/Button test mode.mp3 | Bin .../{Data => data}/mp3/test/Mic test mode.mp3 | Bin .../mp3/test/Mode button long pressed.mp3 | Bin .../mp3/test/Mode button pressed.mp3 | Bin .../mp3/test/Self test ready mode.mp3 | Bin .../mp3/test/Start button long pressed.mp3 | Bin .../mp3/test/Start button pressed.mp3 | Bin .../mp3/test/Start button test mode.mp3 | Bin .../mp3/test/Start mic test mode.mp3 | Bin .../{Data => data}/mp3/test/Start playing.mp3 | Bin .../mp3/test/Start recording.mp3 | Bin .../mp3/test/User button long pressed.mp3 | Bin .../mp3/test/User button pressed.mp3 | Bin op3_demo/include/op3_demo/action_demo.h | 6 +- op3_demo/include/op3_demo/ball_follower.h | 6 +- op3_demo/include/op3_demo/ball_tracker.h | 9 +- op3_demo/include/op3_demo/button_test.h | 4 +- op3_demo/include/op3_demo/face_tracker.h | 3 +- op3_demo/include/op3_demo/mic_test.h | 4 +- op3_demo/include/op3_demo/soccer_demo.h | 11 +- op3_demo/include/op3_demo/vision_demo.h | 9 +- op3_demo/launch/demo.launch | 2 - op3_demo/launch/face_detection_op3.launch | 20 ++-- op3_demo/launch/self_test.launch | 37 +++--- op3_demo/list/action_script.yaml | 23 ++++ .../{script => list}/action_script_bk.yaml | 20 ++-- op3_demo/package.xml | 50 ++++---- op3_demo/script/action_script.yaml | 23 ---- op3_demo/src/action/action_demo.cpp | 2 +- op3_demo/src/demo_node.cpp | 2 +- op3_demo/src/soccer/ball_tracker.cpp | 2 +- op3_demo/src/test/button_test.cpp | 2 +- op3_demo/src/test/mic_test.cpp | 4 +- op3_demo/src/test_node.cpp | 2 +- robotis_op3_demo/CMakeLists.txt | 2 +- robotis_op3_demo/package.xml | 23 ++-- 83 files changed, 382 insertions(+), 291 deletions(-) create mode 100644 README.md rename ball_detector/cfg/{detector_params_blue.cfg => DetectorParamsBlue.cfg} (96%) rename ball_detector/cfg/{detector_params_red.cfg => DetectorParamsRed.cfg} (96%) rename ball_detector/{launch => config}/ball_detector_params.yaml (100%) rename ball_detector/{launch => config}/ball_detector_params_default.yaml (100%) rename ball_detector/{launch => config}/ball_detector_params_op.yaml (100%) rename ball_detector/msg/{circleSetStamped.msg => CircleSetStamped.msg} (100%) rename ball_detector/{launch => rviz}/ball_detector.rviz (100%) rename op3_demo/{Data => data}/mp3/Autonomous soccer mode.mp3 (100%) rename op3_demo/{Data => data}/mp3/Bye bye.mp3 (100%) rename op3_demo/{Data => data}/mp3/Clap please.mp3 (100%) rename op3_demo/{Data => data}/mp3/Demonstration ready mode.mp3 (100%) rename op3_demo/{Data => data}/mp3/Headstand.mp3 (100%) rename op3_demo/{Data => data}/mp3/Interactive motion mode.mp3 (100%) rename op3_demo/{Data => data}/mp3/Intro01.mp3 (100%) rename op3_demo/{Data => data}/mp3/Intro02.mp3 (100%) rename op3_demo/{Data => data}/mp3/Intro03.mp3 (100%) rename op3_demo/{Data => data}/mp3/Introduction.mp3 (100%) rename op3_demo/{Data => data}/mp3/Left kick.mp3 (100%) rename op3_demo/{Data => data}/mp3/No.mp3 (100%) rename op3_demo/{Data => data}/mp3/Oops.mp3 (100%) rename op3_demo/{Data => data}/mp3/Right kick.mp3 (100%) rename op3_demo/{Data => data}/mp3/Sensor calibration complete.mp3 (100%) rename op3_demo/{Data => data}/mp3/Sensor calibration fail.mp3 (100%) rename op3_demo/{Data => data}/mp3/Shoot.mp3 (100%) rename op3_demo/{Data => data}/mp3/Sit down.mp3 (100%) rename op3_demo/{Data => data}/mp3/Stand up.mp3 (100%) rename op3_demo/{Data => data}/mp3/Start motion demonstration.mp3 (100%) rename op3_demo/{Data => data}/mp3/Start soccer demonstration.mp3 (100%) rename op3_demo/{Data => data}/mp3/Start vision processing demonstration.mp3 (100%) rename op3_demo/{Data => data}/mp3/System shutdown.mp3 (100%) rename op3_demo/{Data => data}/mp3/Thank you.mp3 (100%) rename op3_demo/{Data => data}/mp3/Vision processing mode.mp3 (100%) rename op3_demo/{Data => data}/mp3/Wow.mp3 (100%) rename op3_demo/{Data => data}/mp3/Yes go.mp3 (100%) rename op3_demo/{Data => data}/mp3/Yes.mp3 (100%) rename op3_demo/{Data => data}/mp3/intro_test.mp3 (100%) rename op3_demo/{Data => data}/mp3/test/Announce mic test.mp3 (100%) rename op3_demo/{Data => data}/mp3/test/Button test mode.mp3 (100%) rename op3_demo/{Data => data}/mp3/test/Mic test mode.mp3 (100%) rename op3_demo/{Data => data}/mp3/test/Mode button long pressed.mp3 (100%) rename op3_demo/{Data => data}/mp3/test/Mode button pressed.mp3 (100%) rename op3_demo/{Data => data}/mp3/test/Self test ready mode.mp3 (100%) rename op3_demo/{Data => data}/mp3/test/Start button long pressed.mp3 (100%) rename op3_demo/{Data => data}/mp3/test/Start button pressed.mp3 (100%) rename op3_demo/{Data => data}/mp3/test/Start button test mode.mp3 (100%) rename op3_demo/{Data => data}/mp3/test/Start mic test mode.mp3 (100%) rename op3_demo/{Data => data}/mp3/test/Start playing.mp3 (100%) rename op3_demo/{Data => data}/mp3/test/Start recording.mp3 (100%) rename op3_demo/{Data => data}/mp3/test/User button long pressed.mp3 (100%) rename op3_demo/{Data => data}/mp3/test/User button pressed.mp3 (100%) create mode 100644 op3_demo/list/action_script.yaml rename op3_demo/{script => list}/action_script_bk.yaml (72%) delete mode 100644 op3_demo/script/action_script.yaml diff --git a/.travis.yml b/.travis.yml index 07bc3c6..cbc9951 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ compiler: - gcc notifications: email: - on_success: always + on_success: change on_failure: always recipients: - pyo@robotis.com diff --git a/README.md b/README.md new file mode 100644 index 0000000..2387548 --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +## ROBOTIS OP3 + + +## ROS Packages for ROBOTIS OP3 Demo +|Version|Kinetic + Ubuntu Xenial|Melodic + Ubuntu Bionic| +|:---:|:---:|:---:| +|[![GitHub version](https://badge.fury.io/gh/ROBOTIS-GIT%2FROBOTIS-OP3-Demo.svg)](https://badge.fury.io/gh/ROBOTIS-GIT%2FROBOTIS-OP3-Demo)|[![Build Status](https://travis-ci.org/ROBOTIS-GIT/ROBOTIS-OP3-Demo.svg?branch=kinetic-devel)](https://travis-ci.org/ROBOTIS-GIT/ROBOTIS-OP3-Demo)|-| + +## ROBOTIS e-Manual for ROBOTIS OP3 +- [ROBOTIS e-Manual for ROBOTIS OP3](http://emanual.robotis.com/docs/en/platform/op3/introduction/) + +## Wiki for robotis_op3_demo Packages +- http://wiki.ros.org/robotis_op3_demo (metapackage) +- http://wiki.ros.org/ball_detector +- http://wiki.ros.org/op3_demo + +## Open Source related to ROBOTIS OP3 +- [robotis_op3](https://github.com/ROBOTIS-GIT/ROBOTIS-OP3) +- [robotis_op3_msgs](https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-msgs) +- [robotis_op3_common](https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Common) +- [robotis_op3_tools](https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Tools) +- [robotis_op3_demo](https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo) +- [robotis_framework](https://github.com/ROBOTIS-GIT/ROBOTIS-Framework) +- [robotis_controller_msgs](https://github.com/ROBOTIS-GIT/ROBOTIS-Framework-msgs) +- [robotis_utility](https://github.com/ROBOTIS-GIT/ROBOTIS-Utility) +- [robotis_math](https://github.com/ROBOTIS-GIT/ROBOTIS-Math) +- [dynamixel_sdk](https://github.com/ROBOTIS-GIT/DynamixelSDK) +- [OpenCR-Hardware](https://github.com/ROBOTIS-GIT/OpenCR-Hardware) +- [OpenCR](https://github.com/ROBOTIS-GIT/OpenCR) + +## Documents and Videos related to ROBOTIS OP3 +- [ROBOTIS e-Manual for ROBOTIS OP3](http://emanual.robotis.com/docs/en/platform/op3/introduction/) +- [ROBOTIS e-Manual for ROBOTIS Framework](http://emanual.robotis.com/docs/en/software/robotis_framework_packages/) +- [ROBOTIS e-Manual for Dynamixel SDK](http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/) diff --git a/ball_detector/CMakeLists.txt b/ball_detector/CMakeLists.txt index a79af76..647cfdd 100644 --- a/ball_detector/CMakeLists.txt +++ b/ball_detector/CMakeLists.txt @@ -1,30 +1,34 @@ ################################################################################ -# CMake +# Set minimum required version of cmake, project name and compile options ################################################################################ cmake_minimum_required(VERSION 2.8.3) project(ball_detector) ################################################################################ -# Packages +# Find catkin packages and libraries for catkin and system dependencies ################################################################################ find_package(catkin REQUIRED COMPONENTS - roslib - cv_bridge - geometry_msgs - image_transport roscpp - rospy + roslib std_msgs + sensor_msgs + geometry_msgs dynamic_reconfigure + cv_bridge + image_transport message_generation ) +################################################################################ +# Setup for python modules and scripts +################################################################################ + ################################################################################ # Declare ROS messages, services and actions ################################################################################ add_message_files( FILES - circleSetStamped.msg + CircleSetStamped.msg BallDetectorParams.msg ) @@ -36,21 +40,34 @@ add_service_files( generate_messages( DEPENDENCIES - geometry_msgs std_msgs + std_msgs + geometry_msgs ) ################################################################################ # Declare ROS dynamic reconfigure parameters ################################################################################ -generate_dynamic_reconfigure_options(cfg/detector_params.cfg) +generate_dynamic_reconfigure_options( + cfg/DetectorParams.cfg +) ################################################################################ -# Catkin specific configuration -################################################################################ +# Declare catkin specific configuration to be passed to dependent projects +################################################################################## catkin_package( INCLUDE_DIRS include - CATKIN_DEPENDS cv_bridge geometry_msgs image_transport roscpp rospy std_msgs dynamic_reconfigure + CATKIN_DEPENDS + roscpp + roslib + std_msgs + sensor_msgs + geometry_msgs + dynamic_reconfigure + cv_bridge + image_transport + message_runtime + DEPENDS Boost OpenCV ) ################################################################################ @@ -59,22 +76,39 @@ catkin_package( include_directories( include ${catkin_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${OpenCV_INCLUDE_DIRS} + ${YAML_CPP_INCLUDE_DIRS} ) add_executable(ball_detector_node src/ball_detector.cpp - src/ball_detector_node.cpp) + src/ball_detector_node.cpp +) add_dependencies(ball_detector_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) target_link_libraries(ball_detector_node ${catkin_LIBRARIES} - yaml-cpp + ${Boost_LIBRARIES} + ${OpenCV_LIBRARIES} + ${YAML_CPP_LIBRARIES} ) ################################################################################ # Install ################################################################################ +install(TARGETS ball_detector_node + RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +) + +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} +) + +install(DIRECTORY config launch rviz + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) ################################################################################ # Test diff --git a/ball_detector/cfg/detector_params_blue.cfg b/ball_detector/cfg/DetectorParamsBlue.cfg similarity index 96% rename from ball_detector/cfg/detector_params_blue.cfg rename to ball_detector/cfg/DetectorParamsBlue.cfg index 2d61d6c..b9bd967 100755 --- a/ball_detector/cfg/detector_params_blue.cfg +++ b/ball_detector/cfg/DetectorParamsBlue.cfg @@ -30,4 +30,4 @@ gen.add("filter2_v_max",int_t , -1, "Threshold of V filter", 255, 0, 255) gen.add("ellipse_size",int_t , -1, "Ellipse size", 2, 1, 9) gen.add("debug_image", bool_t, 0, "Show filtered image to debug", False) -exit(gen.generate(PACKAGE, "ball_detector_node", "detectorParams")) +exit(gen.generate(PACKAGE, "ball_detector_node", "DetectorParamsBlue")) diff --git a/ball_detector/cfg/detector_params_red.cfg b/ball_detector/cfg/DetectorParamsRed.cfg similarity index 96% rename from ball_detector/cfg/detector_params_red.cfg rename to ball_detector/cfg/DetectorParamsRed.cfg index 4fa6a18..79d08a2 100755 --- a/ball_detector/cfg/detector_params_red.cfg +++ b/ball_detector/cfg/DetectorParamsRed.cfg @@ -30,4 +30,4 @@ gen.add("filter2_v_max",int_t , -1, "Threshold of V filter", 255, 0, 255) gen.add("ellipse_size",int_t , -1, "Ellipse size", 5, 1, 9) gen.add("debug_image", bool_t, 0, "Show filtered image to debug", False) -exit(gen.generate(PACKAGE, "ball_detector_node", "detectorParams")) +exit(gen.generate(PACKAGE, "ball_detector_node", "DetectorParamsRed")) diff --git a/ball_detector/launch/ball_detector_params.yaml b/ball_detector/config/ball_detector_params.yaml similarity index 100% rename from ball_detector/launch/ball_detector_params.yaml rename to ball_detector/config/ball_detector_params.yaml diff --git a/ball_detector/launch/ball_detector_params_default.yaml b/ball_detector/config/ball_detector_params_default.yaml similarity index 100% rename from ball_detector/launch/ball_detector_params_default.yaml rename to ball_detector/config/ball_detector_params_default.yaml diff --git a/ball_detector/launch/ball_detector_params_op.yaml b/ball_detector/config/ball_detector_params_op.yaml similarity index 100% rename from ball_detector/launch/ball_detector_params_op.yaml rename to ball_detector/config/ball_detector_params_op.yaml diff --git a/ball_detector/include/ball_detector/ball_detector.h b/ball_detector/include/ball_detector/ball_detector.h index b246ff3..96a9981 100644 --- a/ball_detector/include/ball_detector/ball_detector.h +++ b/ball_detector/include/ball_detector/ball_detector.h @@ -21,23 +21,26 @@ #include -#include -#include - -//ros dependencies #include #include #include #include -#include -#include #include #include #include +#include +#include + +#include +#include +#include +#include + +#include "ball_detector/DetectorParamsConfig.h" -#include "ball_detector/circleSetStamped.h" #include "ball_detector/ball_detector_config.h" -#include "ball_detector/detectorParamsConfig.h" + +#include "ball_detector/CircleSetStamped.h" #include "ball_detector/GetParameters.h" #include "ball_detector/SetParameters.h" @@ -71,7 +74,7 @@ class BallDetector //callbacks to camera info subscription void cameraInfoCallback(const sensor_msgs::CameraInfo & msg); - void dynParamCallback(ball_detector::detectorParamsConfig &config, uint32_t level); + void dynParamCallback(ball_detector::DetectorParamsConfig &config, uint32_t level); void enableCallback(const std_msgs::Bool::ConstPtr &msg); void paramCommandCallback(const std_msgs::String::ConstPtr &msg); @@ -112,7 +115,7 @@ class BallDetector int not_found_count_; //circle set publisher - ball_detector::circleSetStamped circles_msg_; + ball_detector::CircleSetStamped circles_msg_; ros::Publisher circles_pub_; //camera info subscriber @@ -154,8 +157,8 @@ class BallDetector cv::Mat in_image_; cv::Mat out_image_; - dynamic_reconfigure::Server param_server_; - dynamic_reconfigure::Server::CallbackType callback_fnc_; + dynamic_reconfigure::Server param_server_; + dynamic_reconfigure::Server::CallbackType callback_fnc_; }; } // namespace robotis_op diff --git a/ball_detector/launch/ball_detector.launch b/ball_detector/launch/ball_detector.launch index 05cc278..34a12ba 100644 --- a/ball_detector/launch/ball_detector.launch +++ b/ball_detector/launch/ball_detector.launch @@ -1,13 +1,13 @@ - + - - - - - - - + + + + + + + diff --git a/ball_detector/launch/ball_detector_from_usb_cam.launch b/ball_detector/launch/ball_detector_from_usb_cam.launch index e84838b..44ecad5 100644 --- a/ball_detector/launch/ball_detector_from_usb_cam.launch +++ b/ball_detector/launch/ball_detector_from_usb_cam.launch @@ -1,28 +1,27 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/ball_detector/launch/ball_detector_from_uvc.launch b/ball_detector/launch/ball_detector_from_uvc.launch index 4ef7b43..5946129 100644 --- a/ball_detector/launch/ball_detector_from_uvc.launch +++ b/ball_detector/launch/ball_detector_from_uvc.launch @@ -1,30 +1,30 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/ball_detector/msg/circleSetStamped.msg b/ball_detector/msg/CircleSetStamped.msg similarity index 100% rename from ball_detector/msg/circleSetStamped.msg rename to ball_detector/msg/CircleSetStamped.msg diff --git a/ball_detector/package.xml b/ball_detector/package.xml index 79f988f..e383f47 100644 --- a/ball_detector/package.xml +++ b/ball_detector/package.xml @@ -1,33 +1,34 @@ - + ball_detector 0.1.0 - This package implements a circle-like shape detector of the input image. - It requires and input image and publish, at frame rate, a marked image - and a stamped array of circle centers and radius. + This package implements a circle-like shape detector of the input image. + It requires and input image and publish, at frame rate, a marked image + and a stamped array of circle centers and radius. - Apache License 2.0 - kayman + Apache 2.0 + Kayman Pyo - + http://wiki.ros.org/ball_detector + http://emanual.robotis.com/docs/en/platform/op3/introduction/ + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo/issues catkin - roslib - cv_bridge - geometry_msgs - image_transport - roscpp - rospy - std_msgs - dynamic_reconfigure + roscpp + roslib + std_msgs + sensor_msgs + geometry_msgs + dynamic_reconfigure + cv_bridge + image_transport + boost + opencv + yaml-cpp message_generation - roslib - cv_bridge - geometry_msgs - image_transport - roscpp - rospy - std_msgs - dynamic_reconfigure - message_runtime + message_runtime + message_runtime + usb_cam + uvc_camera diff --git a/ball_detector/launch/ball_detector.rviz b/ball_detector/rviz/ball_detector.rviz similarity index 100% rename from ball_detector/launch/ball_detector.rviz rename to ball_detector/rviz/ball_detector.rviz diff --git a/ball_detector/src/ball_detector.cpp b/ball_detector/src/ball_detector.cpp index df4fe80..7dbba3c 100644 --- a/ball_detector/src/ball_detector.cpp +++ b/ball_detector/src/ball_detector.cpp @@ -16,7 +16,6 @@ /* Author: Kayman Jung */ -#include #include #include "ball_detector/ball_detector.h" @@ -72,7 +71,7 @@ BallDetector::BallDetector() //sets publishers image_pub_ = it_.advertise("image_out", 100); - circles_pub_ = nh_.advertise("circle_set", 100); + circles_pub_ = nh_.advertise("circle_set", 100); camera_info_pub_ = nh_.advertise("camera_info", 100); //sets subscribers @@ -92,7 +91,7 @@ BallDetector::BallDetector() param_command_sub_ = nh_.subscribe("param_command", 1, &BallDetector::paramCommandCallback, this); set_param_client_ = nh_.advertiseService("set_param", &BallDetector::setParamCallback, this); get_param_client_ = nh_.advertiseService("get_param", &BallDetector::getParamCallback, this); - default_setting_path_ = ros::package::getPath(ROS_PACKAGE_NAME) + "/launch/ball_detector_params_default.yaml"; + default_setting_path_ = ros::package::getPath(ROS_PACKAGE_NAME) + "/config/ball_detector_params_default.yaml"; //sets config and prints it params_config_ = detect_config; @@ -234,7 +233,7 @@ void BallDetector::imageCallback(const sensor_msgs::ImageConstPtr & msg) return; } -void BallDetector::dynParamCallback(ball_detector::detectorParamsConfig &config, uint32_t level) +void BallDetector::dynParamCallback(ball_detector::DetectorParamsConfig &config, uint32_t level) { params_config_.gaussian_blur_size = config.gaussian_blur_size; params_config_.gaussian_blur_sigma = config.gaussian_blur_sigma; diff --git a/op3_demo/CMakeLists.txt b/op3_demo/CMakeLists.txt index 4615615..1554f48 100644 --- a/op3_demo/CMakeLists.txt +++ b/op3_demo/CMakeLists.txt @@ -1,26 +1,51 @@ ################################################################################ -# CMake +# Set minimum required version of cmake, project name and compile options ################################################################################ cmake_minimum_required(VERSION 2.8.3) project(op3_demo) ################################################################################ -# Packages +# Find catkin packages and libraries for catkin and system dependencies ################################################################################ find_package(catkin REQUIRED COMPONENTS roscpp roslib + std_msgs sensor_msgs - ball_detector + geometry_msgs + robotis_controller_msgs op3_walking_module_msgs op3_action_module_msgs - robotis_controller_msgs cmake_modules robotis_math + ball_detector ) +find_package(Boost REQUIRED COMPONENTS thread) find_package(Eigen REQUIRED) +## Resolve system dependency on yaml-cpp, which apparently does not +## provide a CMake find_package() module. +## Insert your header file compatible specified path like '#include ' +find_package(PkgConfig REQUIRED) +pkg_check_modules(YAML_CPP REQUIRED yaml-cpp) +find_path(YAML_CPP_INCLUDE_DIR + NAMES yaml_cpp.h + PATHS ${YAML_CPP_INCLUDE_DIRS} +) +find_library(YAML_CPP_LIBRARY + NAMES YAML_CPP + PATHS ${YAML_CPP_LIBRARY_DIRS} +) +link_directories(${YAML_CPP_LIBRARY_DIRS}) + +if(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") +add_definitions(-DHAVE_NEW_YAMLCPP) +endif(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") + +################################################################################ +# Setup for python modules and scripts +################################################################################ ################################################################################ # Declare ROS messages, services and actions @@ -31,11 +56,23 @@ find_package(Eigen REQUIRED) ################################################################################ ################################################################################ -# Catkin specific configuration +# Declare catkin specific configuration to be passed to dependent projects ################################################################################ catkin_package( INCLUDE_DIRS include - CATKIN_DEPENDS roscpp sensor_msgs + CATKIN_DEPENDS + roscpp + roslib + std_msgs + sensor_msgs + geometry_msgs + robotis_controller_msgs + op3_walking_module_msgs + op3_action_module_msgs + cmake_modules + robotis_math + ball_detector + DEPENDS Boost EIGEN3 ) ################################################################################ @@ -44,7 +81,9 @@ catkin_package( include_directories( include ${catkin_INCLUDE_DIRS} - ${Eigen_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIRS} + ${YAML_CPP_INCLUDE_DIRS} ) add_executable(op_demo_node @@ -57,11 +96,16 @@ add_executable(op_demo_node src/vision/face_tracker.cpp ) -add_dependencies(op_demo_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) +add_dependencies(op_demo_node + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} +) target_link_libraries(op_demo_node ${catkin_LIBRARIES} - yaml-cpp + ${Boost_LIBRARIES} + ${Eigen3_LIBRARIES} + ${YAML_CPP_LIBRARIES} ) add_executable(self_test_node @@ -76,47 +120,32 @@ add_executable(self_test_node src/test/mic_test.cpp ) -add_dependencies(self_test_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) +add_dependencies(self_test_node + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} +) target_link_libraries(self_test_node ${catkin_LIBRARIES} - yaml-cpp + ${Boost_LIBRARIES} + ${Eigen3_LIBRARIES} + ${YAML_CPP_LIBRARIES} ) ################################################################################ # Install ################################################################################ +install(TARGETS op_demo_node self_test_node + RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +) -# all install targets should use catkin DESTINATION variables -# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} +) -## Mark executable scripts (Python etc.) for installation -## in contrast to setup.py, you can choose the destination -# install(PROGRAMS -# scripts/my_python_script -# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) - -## Mark executables and/or libraries for installation -# install(TARGETS ball_tracking ball_tracking_node -# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) - -## Mark cpp header files for installation -# install(DIRECTORY include/${PROJECT_NAME}/ -# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} -# FILES_MATCHING PATTERN "*.h" -# PATTERN ".svn" EXCLUDE -# ) - -## Mark other files for installation (e.g. launch and bag files, etc.) -# install(FILES -# # myfile1 -# # myfile2 -# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} -# ) +install(DIRECTORY data launch list + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) ################################################################################ # Test diff --git a/op3_demo/Data/mp3/Autonomous soccer mode.mp3 b/op3_demo/data/mp3/Autonomous soccer mode.mp3 similarity index 100% rename from op3_demo/Data/mp3/Autonomous soccer mode.mp3 rename to op3_demo/data/mp3/Autonomous soccer mode.mp3 diff --git a/op3_demo/Data/mp3/Bye bye.mp3 b/op3_demo/data/mp3/Bye bye.mp3 similarity index 100% rename from op3_demo/Data/mp3/Bye bye.mp3 rename to op3_demo/data/mp3/Bye bye.mp3 diff --git a/op3_demo/Data/mp3/Clap please.mp3 b/op3_demo/data/mp3/Clap please.mp3 similarity index 100% rename from op3_demo/Data/mp3/Clap please.mp3 rename to op3_demo/data/mp3/Clap please.mp3 diff --git a/op3_demo/Data/mp3/Demonstration ready mode.mp3 b/op3_demo/data/mp3/Demonstration ready mode.mp3 similarity index 100% rename from op3_demo/Data/mp3/Demonstration ready mode.mp3 rename to op3_demo/data/mp3/Demonstration ready mode.mp3 diff --git a/op3_demo/Data/mp3/Headstand.mp3 b/op3_demo/data/mp3/Headstand.mp3 similarity index 100% rename from op3_demo/Data/mp3/Headstand.mp3 rename to op3_demo/data/mp3/Headstand.mp3 diff --git a/op3_demo/Data/mp3/Interactive motion mode.mp3 b/op3_demo/data/mp3/Interactive motion mode.mp3 similarity index 100% rename from op3_demo/Data/mp3/Interactive motion mode.mp3 rename to op3_demo/data/mp3/Interactive motion mode.mp3 diff --git a/op3_demo/Data/mp3/Intro01.mp3 b/op3_demo/data/mp3/Intro01.mp3 similarity index 100% rename from op3_demo/Data/mp3/Intro01.mp3 rename to op3_demo/data/mp3/Intro01.mp3 diff --git a/op3_demo/Data/mp3/Intro02.mp3 b/op3_demo/data/mp3/Intro02.mp3 similarity index 100% rename from op3_demo/Data/mp3/Intro02.mp3 rename to op3_demo/data/mp3/Intro02.mp3 diff --git a/op3_demo/Data/mp3/Intro03.mp3 b/op3_demo/data/mp3/Intro03.mp3 similarity index 100% rename from op3_demo/Data/mp3/Intro03.mp3 rename to op3_demo/data/mp3/Intro03.mp3 diff --git a/op3_demo/Data/mp3/Introduction.mp3 b/op3_demo/data/mp3/Introduction.mp3 similarity index 100% rename from op3_demo/Data/mp3/Introduction.mp3 rename to op3_demo/data/mp3/Introduction.mp3 diff --git a/op3_demo/Data/mp3/Left kick.mp3 b/op3_demo/data/mp3/Left kick.mp3 similarity index 100% rename from op3_demo/Data/mp3/Left kick.mp3 rename to op3_demo/data/mp3/Left kick.mp3 diff --git a/op3_demo/Data/mp3/No.mp3 b/op3_demo/data/mp3/No.mp3 similarity index 100% rename from op3_demo/Data/mp3/No.mp3 rename to op3_demo/data/mp3/No.mp3 diff --git a/op3_demo/Data/mp3/Oops.mp3 b/op3_demo/data/mp3/Oops.mp3 similarity index 100% rename from op3_demo/Data/mp3/Oops.mp3 rename to op3_demo/data/mp3/Oops.mp3 diff --git a/op3_demo/Data/mp3/Right kick.mp3 b/op3_demo/data/mp3/Right kick.mp3 similarity index 100% rename from op3_demo/Data/mp3/Right kick.mp3 rename to op3_demo/data/mp3/Right kick.mp3 diff --git a/op3_demo/Data/mp3/Sensor calibration complete.mp3 b/op3_demo/data/mp3/Sensor calibration complete.mp3 similarity index 100% rename from op3_demo/Data/mp3/Sensor calibration complete.mp3 rename to op3_demo/data/mp3/Sensor calibration complete.mp3 diff --git a/op3_demo/Data/mp3/Sensor calibration fail.mp3 b/op3_demo/data/mp3/Sensor calibration fail.mp3 similarity index 100% rename from op3_demo/Data/mp3/Sensor calibration fail.mp3 rename to op3_demo/data/mp3/Sensor calibration fail.mp3 diff --git a/op3_demo/Data/mp3/Shoot.mp3 b/op3_demo/data/mp3/Shoot.mp3 similarity index 100% rename from op3_demo/Data/mp3/Shoot.mp3 rename to op3_demo/data/mp3/Shoot.mp3 diff --git a/op3_demo/Data/mp3/Sit down.mp3 b/op3_demo/data/mp3/Sit down.mp3 similarity index 100% rename from op3_demo/Data/mp3/Sit down.mp3 rename to op3_demo/data/mp3/Sit down.mp3 diff --git a/op3_demo/Data/mp3/Stand up.mp3 b/op3_demo/data/mp3/Stand up.mp3 similarity index 100% rename from op3_demo/Data/mp3/Stand up.mp3 rename to op3_demo/data/mp3/Stand up.mp3 diff --git a/op3_demo/Data/mp3/Start motion demonstration.mp3 b/op3_demo/data/mp3/Start motion demonstration.mp3 similarity index 100% rename from op3_demo/Data/mp3/Start motion demonstration.mp3 rename to op3_demo/data/mp3/Start motion demonstration.mp3 diff --git a/op3_demo/Data/mp3/Start soccer demonstration.mp3 b/op3_demo/data/mp3/Start soccer demonstration.mp3 similarity index 100% rename from op3_demo/Data/mp3/Start soccer demonstration.mp3 rename to op3_demo/data/mp3/Start soccer demonstration.mp3 diff --git a/op3_demo/Data/mp3/Start vision processing demonstration.mp3 b/op3_demo/data/mp3/Start vision processing demonstration.mp3 similarity index 100% rename from op3_demo/Data/mp3/Start vision processing demonstration.mp3 rename to op3_demo/data/mp3/Start vision processing demonstration.mp3 diff --git a/op3_demo/Data/mp3/System shutdown.mp3 b/op3_demo/data/mp3/System shutdown.mp3 similarity index 100% rename from op3_demo/Data/mp3/System shutdown.mp3 rename to op3_demo/data/mp3/System shutdown.mp3 diff --git a/op3_demo/Data/mp3/Thank you.mp3 b/op3_demo/data/mp3/Thank you.mp3 similarity index 100% rename from op3_demo/Data/mp3/Thank you.mp3 rename to op3_demo/data/mp3/Thank you.mp3 diff --git a/op3_demo/Data/mp3/Vision processing mode.mp3 b/op3_demo/data/mp3/Vision processing mode.mp3 similarity index 100% rename from op3_demo/Data/mp3/Vision processing mode.mp3 rename to op3_demo/data/mp3/Vision processing mode.mp3 diff --git a/op3_demo/Data/mp3/Wow.mp3 b/op3_demo/data/mp3/Wow.mp3 similarity index 100% rename from op3_demo/Data/mp3/Wow.mp3 rename to op3_demo/data/mp3/Wow.mp3 diff --git a/op3_demo/Data/mp3/Yes go.mp3 b/op3_demo/data/mp3/Yes go.mp3 similarity index 100% rename from op3_demo/Data/mp3/Yes go.mp3 rename to op3_demo/data/mp3/Yes go.mp3 diff --git a/op3_demo/Data/mp3/Yes.mp3 b/op3_demo/data/mp3/Yes.mp3 similarity index 100% rename from op3_demo/Data/mp3/Yes.mp3 rename to op3_demo/data/mp3/Yes.mp3 diff --git a/op3_demo/Data/mp3/intro_test.mp3 b/op3_demo/data/mp3/intro_test.mp3 similarity index 100% rename from op3_demo/Data/mp3/intro_test.mp3 rename to op3_demo/data/mp3/intro_test.mp3 diff --git a/op3_demo/Data/mp3/test/Announce mic test.mp3 b/op3_demo/data/mp3/test/Announce mic test.mp3 similarity index 100% rename from op3_demo/Data/mp3/test/Announce mic test.mp3 rename to op3_demo/data/mp3/test/Announce mic test.mp3 diff --git a/op3_demo/Data/mp3/test/Button test mode.mp3 b/op3_demo/data/mp3/test/Button test mode.mp3 similarity index 100% rename from op3_demo/Data/mp3/test/Button test mode.mp3 rename to op3_demo/data/mp3/test/Button test mode.mp3 diff --git a/op3_demo/Data/mp3/test/Mic test mode.mp3 b/op3_demo/data/mp3/test/Mic test mode.mp3 similarity index 100% rename from op3_demo/Data/mp3/test/Mic test mode.mp3 rename to op3_demo/data/mp3/test/Mic test mode.mp3 diff --git a/op3_demo/Data/mp3/test/Mode button long pressed.mp3 b/op3_demo/data/mp3/test/Mode button long pressed.mp3 similarity index 100% rename from op3_demo/Data/mp3/test/Mode button long pressed.mp3 rename to op3_demo/data/mp3/test/Mode button long pressed.mp3 diff --git a/op3_demo/Data/mp3/test/Mode button pressed.mp3 b/op3_demo/data/mp3/test/Mode button pressed.mp3 similarity index 100% rename from op3_demo/Data/mp3/test/Mode button pressed.mp3 rename to op3_demo/data/mp3/test/Mode button pressed.mp3 diff --git a/op3_demo/Data/mp3/test/Self test ready mode.mp3 b/op3_demo/data/mp3/test/Self test ready mode.mp3 similarity index 100% rename from op3_demo/Data/mp3/test/Self test ready mode.mp3 rename to op3_demo/data/mp3/test/Self test ready mode.mp3 diff --git a/op3_demo/Data/mp3/test/Start button long pressed.mp3 b/op3_demo/data/mp3/test/Start button long pressed.mp3 similarity index 100% rename from op3_demo/Data/mp3/test/Start button long pressed.mp3 rename to op3_demo/data/mp3/test/Start button long pressed.mp3 diff --git a/op3_demo/Data/mp3/test/Start button pressed.mp3 b/op3_demo/data/mp3/test/Start button pressed.mp3 similarity index 100% rename from op3_demo/Data/mp3/test/Start button pressed.mp3 rename to op3_demo/data/mp3/test/Start button pressed.mp3 diff --git a/op3_demo/Data/mp3/test/Start button test mode.mp3 b/op3_demo/data/mp3/test/Start button test mode.mp3 similarity index 100% rename from op3_demo/Data/mp3/test/Start button test mode.mp3 rename to op3_demo/data/mp3/test/Start button test mode.mp3 diff --git a/op3_demo/Data/mp3/test/Start mic test mode.mp3 b/op3_demo/data/mp3/test/Start mic test mode.mp3 similarity index 100% rename from op3_demo/Data/mp3/test/Start mic test mode.mp3 rename to op3_demo/data/mp3/test/Start mic test mode.mp3 diff --git a/op3_demo/Data/mp3/test/Start playing.mp3 b/op3_demo/data/mp3/test/Start playing.mp3 similarity index 100% rename from op3_demo/Data/mp3/test/Start playing.mp3 rename to op3_demo/data/mp3/test/Start playing.mp3 diff --git a/op3_demo/Data/mp3/test/Start recording.mp3 b/op3_demo/data/mp3/test/Start recording.mp3 similarity index 100% rename from op3_demo/Data/mp3/test/Start recording.mp3 rename to op3_demo/data/mp3/test/Start recording.mp3 diff --git a/op3_demo/Data/mp3/test/User button long pressed.mp3 b/op3_demo/data/mp3/test/User button long pressed.mp3 similarity index 100% rename from op3_demo/Data/mp3/test/User button long pressed.mp3 rename to op3_demo/data/mp3/test/User button long pressed.mp3 diff --git a/op3_demo/Data/mp3/test/User button pressed.mp3 b/op3_demo/data/mp3/test/User button pressed.mp3 similarity index 100% rename from op3_demo/Data/mp3/test/User button pressed.mp3 rename to op3_demo/data/mp3/test/User button pressed.mp3 diff --git a/op3_demo/include/op3_demo/action_demo.h b/op3_demo/include/op3_demo/action_demo.h index 32a9435..4231406 100644 --- a/op3_demo/include/op3_demo/action_demo.h +++ b/op3_demo/include/op3_demo/action_demo.h @@ -19,14 +19,14 @@ #ifndef ACTION_DEMO_H_ #define ACTION_DEMO_H_ -#include -#include - #include #include #include #include +#include +#include + #include "op3_demo/op_demo.h" #include "robotis_controller_msgs/JointCtrlModule.h" #include "robotis_controller_msgs/SetModule.h" diff --git a/op3_demo/include/op3_demo/ball_follower.h b/op3_demo/include/op3_demo/ball_follower.h index 9e12ffc..7ec1d46 100644 --- a/op3_demo/include/op3_demo/ball_follower.h +++ b/op3_demo/include/op3_demo/ball_follower.h @@ -20,16 +20,16 @@ #define BALL_FOLLOWER_H_ #include -#include - #include #include #include #include #include +#include +#include #include "robotis_controller_msgs/JointCtrlModule.h" -#include "ball_detector/circleSetStamped.h" +#include "ball_detector/CircleSetStamped.h" #include "op3_walking_module_msgs/WalkingParam.h" #include "op3_walking_module_msgs/GetWalkingParam.h" diff --git a/op3_demo/include/op3_demo/ball_tracker.h b/op3_demo/include/op3_demo/ball_tracker.h index 0d3cfac..5461494 100644 --- a/op3_demo/include/op3_demo/ball_tracker.h +++ b/op3_demo/include/op3_demo/ball_tracker.h @@ -20,17 +20,16 @@ #define BALL_TRACKING_H_ #include -#include - #include #include #include #include -//#include #include +#include +#include #include "robotis_controller_msgs/JointCtrlModule.h" -#include "ball_detector/circleSetStamped.h" +#include "ball_detector/CircleSetStamped.h" #include "op3_walking_module_msgs/WalkingParam.h" #include "op3_walking_module_msgs/GetWalkingParam.h" @@ -80,7 +79,7 @@ protected: const int WAITING_THRESHOLD; const bool DEBUG_PRINT; - void ballPositionCallback(const ball_detector::circleSetStamped::ConstPtr &msg); + void ballPositionCallback(const ball_detector::CircleSetStamped::ConstPtr &msg); void ballTrackerCommandCallback(const std_msgs::String::ConstPtr &msg); void publishHeadJoint(double pan, double tilt); void scanBall(); diff --git a/op3_demo/include/op3_demo/button_test.h b/op3_demo/include/op3_demo/button_test.h index 127c978..84e8bee 100644 --- a/op3_demo/include/op3_demo/button_test.h +++ b/op3_demo/include/op3_demo/button_test.h @@ -19,14 +19,12 @@ #ifndef BUTTON_TEST_H_ #define BUTTON_TEST_H_ -#include - #include #include #include +#include #include "op3_demo/op_demo.h" - #include "robotis_controller_msgs/SyncWriteItem.h" namespace robotis_op diff --git a/op3_demo/include/op3_demo/face_tracker.h b/op3_demo/include/op3_demo/face_tracker.h index 0671b24..3289375 100644 --- a/op3_demo/include/op3_demo/face_tracker.h +++ b/op3_demo/include/op3_demo/face_tracker.h @@ -20,8 +20,6 @@ #define FACE_TRACKING_H_ #include -#include - #include #include #include @@ -29,6 +27,7 @@ #include #include #include +#include namespace robotis_op { diff --git a/op3_demo/include/op3_demo/mic_test.h b/op3_demo/include/op3_demo/mic_test.h index 7cd025a..144fe96 100644 --- a/op3_demo/include/op3_demo/mic_test.h +++ b/op3_demo/include/op3_demo/mic_test.h @@ -20,14 +20,12 @@ #define MIC_TEST_H_ #include -#include - #include #include #include +#include #include "op3_demo/op_demo.h" - #include "robotis_controller_msgs/SyncWriteItem.h" namespace robotis_op diff --git a/op3_demo/include/op3_demo/soccer_demo.h b/op3_demo/include/op3_demo/soccer_demo.h index f65d81b..a771eda 100644 --- a/op3_demo/include/op3_demo/soccer_demo.h +++ b/op3_demo/include/op3_demo/soccer_demo.h @@ -23,15 +23,18 @@ #include #include #include +#include +#include + +#include "op3_action_module_msgs/IsRunning.h" +#include "robotis_controller_msgs/SyncWriteItem.h" +#include "robotis_controller_msgs/JointCtrlModule.h" +#include "robotis_controller_msgs/SetJointModule.h" #include "op3_demo/op_demo.h" #include "op3_demo/ball_tracker.h" #include "op3_demo/ball_follower.h" #include "robotis_math/robotis_linear_algebra.h" -#include "op3_action_module_msgs/IsRunning.h" -#include "robotis_controller_msgs/SyncWriteItem.h" -#include "robotis_controller_msgs/JointCtrlModule.h" -#include "robotis_controller_msgs/SetJointModule.h" namespace robotis_op { diff --git a/op3_demo/include/op3_demo/vision_demo.h b/op3_demo/include/op3_demo/vision_demo.h index 3ebdc46..20cd1ad 100644 --- a/op3_demo/include/op3_demo/vision_demo.h +++ b/op3_demo/include/op3_demo/vision_demo.h @@ -19,19 +19,18 @@ #ifndef VISION_DEMO_H_ #define VISION_DEMO_H_ -#include - #include #include #include #include - -#include "op3_demo/op_demo.h" -#include "op3_demo/face_tracker.h" +#include #include "robotis_controller_msgs/SyncWriteItem.h" #include "robotis_controller_msgs/SetModule.h" +#include "op3_demo/op_demo.h" +#include "op3_demo/face_tracker.h" + namespace robotis_op { diff --git a/op3_demo/launch/demo.launch b/op3_demo/launch/demo.launch index aa5098b..2b5281c 100644 --- a/op3_demo/launch/demo.launch +++ b/op3_demo/launch/demo.launch @@ -1,7 +1,5 @@ - - diff --git a/op3_demo/launch/face_detection_op3.launch b/op3_demo/launch/face_detection_op3.launch index afc5f12..d42ab41 100644 --- a/op3_demo/launch/face_detection_op3.launch +++ b/op3_demo/launch/face_detection_op3.launch @@ -7,16 +7,16 @@ - - - - + args="$(arg face_cascade_name_0) + $(arg face_cascade_name_1) + $(arg face_cascade_name_2) + $(arg face_cascade_name_3) + $(arg face_cascade_name_4)" + output="screen"> + + + + diff --git a/op3_demo/launch/self_test.launch b/op3_demo/launch/self_test.launch index c5ca857..623004e 100644 --- a/op3_demo/launch/self_test.launch +++ b/op3_demo/launch/self_test.launch @@ -1,30 +1,29 @@ + + - - - - - + + - - + + - - + + - - + + - - + + - - - - - - + + + + + + diff --git a/op3_demo/list/action_script.yaml b/op3_demo/list/action_script.yaml new file mode 100644 index 0000000..21ce72b --- /dev/null +++ b/op3_demo/list/action_script.yaml @@ -0,0 +1,23 @@ +# combination action page number and mp3 file path +action_and_sound: + 4 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Thank you.mp3" + 41: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Introduction.mp3" + 24: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Wow.mp3" + 23: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Yes go.mp3" + 15: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Sit down.mp3" + 1: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Stand up.mp3" + 54: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Clap please.mp3" + 27: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Oops.mp3" + 38: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Bye bye.mp3" +# 101 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Oops.mp3" + 110 : "" + 111 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Intro01.mp3" + 115 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Intro02.mp3" + 118 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Intro03.mp3" + +# play list +prev_default: [4, 41, 24, 23, 15, 1, 54, 27, 38] +default: [4, 110, 111, 115, 118, 24, 54, 27, 38] + +# example of play list +#certification: [101] \ No newline at end of file diff --git a/op3_demo/script/action_script_bk.yaml b/op3_demo/list/action_script_bk.yaml similarity index 72% rename from op3_demo/script/action_script_bk.yaml rename to op3_demo/list/action_script_bk.yaml index a18155d..bc401fb 100644 --- a/op3_demo/script/action_script_bk.yaml +++ b/op3_demo/list/action_script_bk.yaml @@ -1,15 +1,15 @@ # combination action page number and mp3 file path action_and_sound: - 4 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Thank you.mp3" - 41: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Introduction.mp3" - 24: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Wow.mp3" - 23: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Yes go.mp3" - 15: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Sit down.mp3" - 1: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Stand up.mp3" - 54: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Clap please.mp3" - 27: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Oops.mp3" - 38: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Bye bye.mp3" - 101 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Oops.mp3" + 4 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Thank you.mp3" + 41: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Introduction.mp3" + 24: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Wow.mp3" + 23: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Yes go.mp3" + 15: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Sit down.mp3" + 1: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Stand up.mp3" + 54: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Clap please.mp3" + 27: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Oops.mp3" + 38: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Bye bye.mp3" + 101 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Oops.mp3" # play list default: [4, 41, 24, 23, 15, 1, 54, 27, 38] diff --git a/op3_demo/package.xml b/op3_demo/package.xml index 68baa53..85bd36e 100644 --- a/op3_demo/package.xml +++ b/op3_demo/package.xml @@ -1,32 +1,36 @@ - + op3_demo 0.1.0 - op3 default demo + OP3 default demo It includes three demontrations(soccer demo, vision demo, action script demo) - Apache License 2.0 - kayman + Apache 2.0 + Kayman Pyo - + http://wiki.ros.org/op3_demo + http://emanual.robotis.com/docs/en/platform/op3/introduction/ + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo/issues catkin - roscpp - roslib - sensor_msgs - ball_detector - robotis_controller_msgs - op3_walking_module_msgs - op3_action_module_msgs - cmake_modules - robotis_math - roscpp - roslib - sensor_msgs - ball_detector - robotis_controller_msgs - op3_walking_module_msgs - op3_action_module_msgs - cmake_modules - robotis_math + roscpp + roslib + std_msgs + sensor_msgs + geometry_msgs + robotis_controller_msgs + op3_walking_module_msgs + op3_action_module_msgs + cmake_modules + robotis_math + ball_detector + boost + eigen + yaml-cpp + op3_manager + op3_camera_setting_tool + op3_web_setting_tool + ros_madplay_player + diff --git a/op3_demo/script/action_script.yaml b/op3_demo/script/action_script.yaml deleted file mode 100644 index 077e820..0000000 --- a/op3_demo/script/action_script.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# combination action page number and mp3 file path -action_and_sound: - 4 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Thank you.mp3" - 41: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Introduction.mp3" - 24: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Wow.mp3" - 23: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Yes go.mp3" - 15: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Sit down.mp3" - 1: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Stand up.mp3" - 54: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Clap please.mp3" - 27: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Oops.mp3" - 38: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Bye bye.mp3" -# 101 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Oops.mp3" - 110 : "" - 111 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Intro01.mp3" - 115 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Intro02.mp3" - 118 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Intro03.mp3" - -# play list -prev_default: [4, 41, 24, 23, 15, 1, 54, 27, 38] -default: [4, 110, 111, 115, 118, 24, 54, 27, 38] - -# example of play list -#certification: [101] \ No newline at end of file diff --git a/op3_demo/src/action/action_demo.cpp b/op3_demo/src/action/action_demo.cpp index 4f14679..660390c 100644 --- a/op3_demo/src/action/action_demo.cpp +++ b/op3_demo/src/action/action_demo.cpp @@ -31,7 +31,7 @@ ActionDemo::ActionDemo() ros::NodeHandle nh(ros::this_node::getName()); - std::string default_path = ros::package::getPath("op3_demo") + "/script/action_script.yaml"; + std::string default_path = ros::package::getPath("op3_demo") + "/list/action_script.yaml"; script_path_ = nh.param("action_script", default_path); std::string default_play_list = "default"; diff --git a/op3_demo/src/demo_node.cpp b/op3_demo/src/demo_node.cpp index 8039aff..300a90b 100644 --- a/op3_demo/src/demo_node.cpp +++ b/op3_demo/src/demo_node.cpp @@ -77,7 +77,7 @@ int main(int argc, char **argv) ros::Subscriber buttuon_sub = nh.subscribe("/robotis/open_cr/button", 1, buttonHandlerCallback); ros::Subscriber mode_command_sub = nh.subscribe("/robotis/mode_command", 1, demoModeCommandCallback); - default_mp3_path = ros::package::getPath("op3_demo") + "/Data/mp3/"; + default_mp3_path = ros::package::getPath("op3_demo") + "/data/mp3/"; ros::start(); diff --git a/op3_demo/src/soccer/ball_tracker.cpp b/op3_demo/src/soccer/ball_tracker.cpp index cbd4e87..355a21c 100644 --- a/op3_demo/src/soccer/ball_tracker.cpp +++ b/op3_demo/src/soccer/ball_tracker.cpp @@ -59,7 +59,7 @@ BallTracker::~BallTracker() } -void BallTracker::ballPositionCallback(const ball_detector::circleSetStamped::ConstPtr &msg) +void BallTracker::ballPositionCallback(const ball_detector::CircleSetStamped::ConstPtr &msg) { for (int idx = 0; idx < msg->circles.size(); idx++) { diff --git a/op3_demo/src/test/button_test.cpp b/op3_demo/src/test/button_test.cpp index 415d182..7a78c6a 100644 --- a/op3_demo/src/test/button_test.cpp +++ b/op3_demo/src/test/button_test.cpp @@ -33,7 +33,7 @@ ButtonTest::ButtonTest() boost::thread queue_thread = boost::thread(boost::bind(&ButtonTest::callbackThread, this)); boost::thread process_thread = boost::thread(boost::bind(&ButtonTest::processThread, this)); - default_mp3_path_ = ros::package::getPath("op3_demo") + "/Data/mp3/test/"; + default_mp3_path_ = ros::package::getPath("op3_demo") + "/data/mp3/test/"; } ButtonTest::~ButtonTest() diff --git a/op3_demo/src/test/mic_test.cpp b/op3_demo/src/test/mic_test.cpp index e1f6757..4e56954 100644 --- a/op3_demo/src/test/mic_test.cpp +++ b/op3_demo/src/test/mic_test.cpp @@ -36,8 +36,8 @@ MicTest::MicTest() boost::thread queue_thread = boost::thread(boost::bind(&MicTest::callbackThread, this)); boost::thread process_thread = boost::thread(boost::bind(&MicTest::processThread, this)); - recording_file_name_ = ros::package::getPath("op3_demo") + "/Data/mp3/test/mic-test.wav"; - default_mp3_path_ = ros::package::getPath("op3_demo") + "/Data/mp3/test/"; + recording_file_name_ = ros::package::getPath("op3_demo") + "/data/mp3/test/mic-test.wav"; + default_mp3_path_ = ros::package::getPath("op3_demo") + "/data/mp3/test/"; start_time_ = ros::Time::now(); } diff --git a/op3_demo/src/test_node.cpp b/op3_demo/src/test_node.cpp index 259ea96..8d4768d 100644 --- a/op3_demo/src/test_node.cpp +++ b/op3_demo/src/test_node.cpp @@ -84,7 +84,7 @@ int main(int argc, char **argv) ros::Subscriber buttuon_sub = nh.subscribe("/robotis/open_cr/button", 1, buttonHandlerCallback); ros::Subscriber mode_command_sub = nh.subscribe("/robotis/mode_command", 1, demoModeCommandCallback); - default_mp3_path = ros::package::getPath("op3_demo") + "/Data/mp3/"; + default_mp3_path = ros::package::getPath("op3_demo") + "/data/mp3/"; ros::start(); diff --git a/robotis_op3_demo/CMakeLists.txt b/robotis_op3_demo/CMakeLists.txt index d88f653..b7e8eeb 100644 --- a/robotis_op3_demo/CMakeLists.txt +++ b/robotis_op3_demo/CMakeLists.txt @@ -1,4 +1,4 @@ cmake_minimum_required(VERSION 2.8.3) project(robotis_op3_demo) find_package(catkin REQUIRED) -catkin_metapackage() \ No newline at end of file +catkin_metapackage() diff --git a/robotis_op3_demo/package.xml b/robotis_op3_demo/package.xml index bba5f7c..7cf0810 100644 --- a/robotis_op3_demo/package.xml +++ b/robotis_op3_demo/package.xml @@ -1,24 +1,19 @@ - + robotis_op3_demo 0.1.0 ROS packages for the robotis_op3_demo (meta package) - - Apache License 2.0 + Apache 2.0 Kayman Pyo - - - - - + http://wiki.ros.org/robotis_op3_demo + http://emanual.robotis.com/docs/en/platform/op3/introduction/ + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo/issues catkin - ball_detector - op3_demo - - - - + ball_detector + op3_demo + From afddde32825168337222375dadffcec2a04cf410 Mon Sep 17 00:00:00 2001 From: Pyo Date: Fri, 30 Mar 2018 22:22:47 +0900 Subject: [PATCH 42/66] refacoring to release --- ball_detector/CMakeLists.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ball_detector/CMakeLists.txt b/ball_detector/CMakeLists.txt index 647cfdd..052a5ca 100644 --- a/ball_detector/CMakeLists.txt +++ b/ball_detector/CMakeLists.txt @@ -19,6 +19,28 @@ find_package(catkin REQUIRED COMPONENTS message_generation ) +find_package(Boost REQUIRED COMPONENTS thread) +find_package(OpenCV REQUIRED) + +## Resolve system dependency on yaml-cpp, which apparently does not +## provide a CMake find_package() module. +## Insert your header file compatible specified path like '#include ' +find_package(PkgConfig REQUIRED) +pkg_check_modules(YAML_CPP REQUIRED yaml-cpp) +find_path(YAML_CPP_INCLUDE_DIR + NAMES yaml_cpp.h + PATHS ${YAML_CPP_INCLUDE_DIRS} +) +find_library(YAML_CPP_LIBRARY + NAMES YAML_CPP + PATHS ${YAML_CPP_LIBRARY_DIRS} +) +link_directories(${YAML_CPP_LIBRARY_DIRS}) + +if(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") +add_definitions(-DHAVE_NEW_YAMLCPP) +endif(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") + ################################################################################ # Setup for python modules and scripts ################################################################################ From e4da8aa4a47fda6c1e569518fe9d214c7967440e Mon Sep 17 00:00:00 2001 From: Pyo Date: Fri, 30 Mar 2018 22:51:01 +0900 Subject: [PATCH 43/66] refacoring to release --- .robotis_op3_demo.rosinstall | 1 + .travis.yml | 3 ++- ball_detector/CMakeLists.txt | 2 +- ball_detector/package.xml | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 .robotis_op3_demo.rosinstall diff --git a/.robotis_op3_demo.rosinstall b/.robotis_op3_demo.rosinstall new file mode 100644 index 0000000..96ed216 --- /dev/null +++ b/.robotis_op3_demo.rosinstall @@ -0,0 +1 @@ +- git: {local-name: robotis_op3_tools, uri: 'https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Tools.git', version: master} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index cbc9951..9316a80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,8 +18,9 @@ notifications: - pyo@robotis.com env: matrix: - - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian +# - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian # - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=debian OS_CODE_NAME=jessie + - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=file $ROSINSTALL_FILENAME=".robotis_op3_demo.rosinstall" branches: only: - master diff --git a/ball_detector/CMakeLists.txt b/ball_detector/CMakeLists.txt index 052a5ca..d2acc5e 100644 --- a/ball_detector/CMakeLists.txt +++ b/ball_detector/CMakeLists.txt @@ -20,7 +20,7 @@ find_package(catkin REQUIRED COMPONENTS ) find_package(Boost REQUIRED COMPONENTS thread) -find_package(OpenCV REQUIRED) +find_package(OpenCV 3 REQUIRED) ## Resolve system dependency on yaml-cpp, which apparently does not ## provide a CMake find_package() module. diff --git a/ball_detector/package.xml b/ball_detector/package.xml index e383f47..52570a8 100644 --- a/ball_detector/package.xml +++ b/ball_detector/package.xml @@ -24,7 +24,7 @@ cv_bridge image_transport boost - opencv + opencv3 yaml-cpp message_generation message_runtime From 0b0581d29784de2fb16a3b1a4afa31a1c60ccbe9 Mon Sep 17 00:00:00 2001 From: Pyo Date: Fri, 30 Mar 2018 23:01:08 +0900 Subject: [PATCH 44/66] -added rosinstall for footstep_planner package --- .robotis_op3_demo.rosinstall | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.robotis_op3_demo.rosinstall b/.robotis_op3_demo.rosinstall index 96ed216..146fa30 100644 --- a/.robotis_op3_demo.rosinstall +++ b/.robotis_op3_demo.rosinstall @@ -1 +1,2 @@ -- git: {local-name: robotis_op3_tools, uri: 'https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Tools.git', version: master} \ No newline at end of file +- git: {local-name: robotis_op3_tools, uri: 'https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Tools.git', version: master} +- git: {local-name: humanoid_navigation, uri: 'https://github.com/ROBOTIS-GIT/humanoid_navigation.git', version: master} \ No newline at end of file From 21980c5f396fe0410dc61171f4d8b40951cd8246 Mon Sep 17 00:00:00 2001 From: Pyo Date: Fri, 30 Mar 2018 23:31:48 +0900 Subject: [PATCH 45/66] updated the CHANGELOG and version to release binary packages --- ball_detector/CHANGELOG.rst | 12 ++++++++++++ ball_detector/package.xml | 1 + op3_demo/CHANGELOG.rst | 12 ++++++++++++ op3_demo/CMakeLists.txt | 2 +- robotis_op3_demo/CHANGELOG.rst | 12 ++++++++++++ 5 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 ball_detector/CHANGELOG.rst create mode 100644 op3_demo/CHANGELOG.rst create mode 100644 robotis_op3_demo/CHANGELOG.rst diff --git a/ball_detector/CHANGELOG.rst b/ball_detector/CHANGELOG.rst new file mode 100644 index 0000000..5d3764c --- /dev/null +++ b/ball_detector/CHANGELOG.rst @@ -0,0 +1,12 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package ball_detector +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +0.1.0 (2018-03-30) +------------------ +* first release +* added launch files in order to move the camera setting to op3_camera_setting package +* added missing package in find_package() +* refacoring to release +* splited repositoryfrom ROBOTIS-OP3 +* Contributors: Kayman, Zerom, Pyo diff --git a/ball_detector/package.xml b/ball_detector/package.xml index 52570a8..2f2acf3 100644 --- a/ball_detector/package.xml +++ b/ball_detector/package.xml @@ -9,6 +9,7 @@ Apache 2.0 Kayman + Zerom Pyo http://wiki.ros.org/ball_detector http://emanual.robotis.com/docs/en/platform/op3/introduction/ diff --git a/op3_demo/CHANGELOG.rst b/op3_demo/CHANGELOG.rst new file mode 100644 index 0000000..62ead4d --- /dev/null +++ b/op3_demo/CHANGELOG.rst @@ -0,0 +1,12 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package op3_demo +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +0.1.0 (2018-03-30) +------------------ +* first release +* added launch files in order to move the camera setting to op3_camera_setting package +* added missing package in find_package() +* refacoring to release +* splited repositoryfrom ROBOTIS-OP3 +* Contributors: Kayman, Yoshimaru Tanaka, Pyo diff --git a/op3_demo/CMakeLists.txt b/op3_demo/CMakeLists.txt index 1554f48..42445a0 100644 --- a/op3_demo/CMakeLists.txt +++ b/op3_demo/CMakeLists.txt @@ -22,7 +22,7 @@ find_package(catkin REQUIRED COMPONENTS ) find_package(Boost REQUIRED COMPONENTS thread) -find_package(Eigen REQUIRED) +find_package(Eigen3 REQUIRED) ## Resolve system dependency on yaml-cpp, which apparently does not ## provide a CMake find_package() module. diff --git a/robotis_op3_demo/CHANGELOG.rst b/robotis_op3_demo/CHANGELOG.rst new file mode 100644 index 0000000..b65724b --- /dev/null +++ b/robotis_op3_demo/CHANGELOG.rst @@ -0,0 +1,12 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package robotis_op3_demo +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +0.1.0 (2018-03-30) +------------------ +* first release +* added launch files in order to move the camera setting to op3_camera_setting package +* added missing package in find_package() +* refacoring to release +* splited repositoryfrom ROBOTIS-OP3 +* Contributors: Kayman, Zerom, Yoshimaru Tanaka, Pyo From 014a28cd8f1118d94c153343a93c0878fe39cc84 Mon Sep 17 00:00:00 2001 From: Pyo Date: Mon, 2 Apr 2018 08:25:00 +0900 Subject: [PATCH 46/66] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2387548..51875b9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## ROBOTIS OP3 +# ROBOTIS OP3 ## ROS Packages for ROBOTIS OP3 Demo From 66f3b91ce95ea77910bd0b41b8d8158e87e51377 Mon Sep 17 00:00:00 2001 From: Kayman Date: Mon, 16 Apr 2018 17:47:15 +0900 Subject: [PATCH 47/66] merged with master added op3_bringup package --- .robotis_op3_demo.rosinstall | 2 + .travis.yml | 5 +- README.md | 34 ++ ball_detector/CHANGELOG.rst | 12 + ball_detector/CMakeLists.txt | 69 +++- ...params_blue.cfg => DetectorParamsBlue.cfg} | 2 +- ...r_params_red.cfg => DetectorParamsRed.cfg} | 2 +- .../ball_detector_params.yaml | 0 .../ball_detector_params_default.yaml | 0 .../ball_detector_params_op.yaml | 0 .../include/ball_detector/ball_detector.h | 21 +- ball_detector/launch/ball_detector.launch | 16 +- .../launch/ball_detector_from_usb_cam.launch | 45 ++- .../launch/ball_detector_from_uvc.launch | 50 +-- ball_detector/package.xml | 37 +- .../{launch => rviz}/ball_detector.rviz | 0 ball_detector/src/ball_detector.cpp | 5 +- op3_bringup/CMakeLists.txt | 195 ++++++++++ op3_bringup/launch/op3_bringup.launch | 15 + .../launch/op3_bringup_visualization.launch | 18 + op3_bringup/package.xml | 59 +++ op3_bringup/rviz/op3_bringup.rviz | 348 ++++++++++++++++++ op3_demo/CHANGELOG.rst | 12 + op3_demo/CMakeLists.txt | 89 +++-- op3_demo/include/op3_demo/action_demo.h | 6 +- op3_demo/include/op3_demo/ball_follower.h | 6 +- op3_demo/include/op3_demo/ball_tracker.h | 9 +- op3_demo/include/op3_demo/button_test.h | 4 +- op3_demo/include/op3_demo/face_tracker.h | 3 +- op3_demo/include/op3_demo/mic_test.h | 4 +- op3_demo/include/op3_demo/soccer_demo.h | 11 +- op3_demo/include/op3_demo/vision_demo.h | 9 +- op3_demo/launch/demo.launch | 2 - op3_demo/launch/face_detection_op3.launch | 20 +- op3_demo/launch/self_test.launch | 37 +- op3_demo/list/action_script.yaml | 23 ++ .../{script => list}/action_script_bk.yaml | 20 +- op3_demo/package.xml | 23 +- op3_demo/script/action_script.yaml | 23 -- op3_demo/src/action/action_demo.cpp | 2 +- op3_demo/src/demo_node.cpp | 2 +- op3_demo/src/soccer/ball_tracker.cpp | 2 +- op3_demo/src/test/button_test.cpp | 2 +- op3_demo/src/test/mic_test.cpp | 4 +- op3_demo/src/test_node.cpp | 2 +- robotis_op3_demo/CHANGELOG.rst | 12 + robotis_op3_demo/CMakeLists.txt | 2 +- robotis_op3_demo/package.xml | 23 +- 48 files changed, 1024 insertions(+), 263 deletions(-) create mode 100644 .robotis_op3_demo.rosinstall create mode 100644 README.md create mode 100644 ball_detector/CHANGELOG.rst rename ball_detector/cfg/{detector_params_blue.cfg => DetectorParamsBlue.cfg} (96%) mode change 100755 => 100644 rename ball_detector/cfg/{detector_params_red.cfg => DetectorParamsRed.cfg} (96%) mode change 100755 => 100644 rename ball_detector/{launch => config}/ball_detector_params.yaml (100%) rename ball_detector/{launch => config}/ball_detector_params_default.yaml (100%) rename ball_detector/{launch => config}/ball_detector_params_op.yaml (100%) rename ball_detector/{launch => rviz}/ball_detector.rviz (100%) create mode 100644 op3_bringup/CMakeLists.txt create mode 100644 op3_bringup/launch/op3_bringup.launch create mode 100644 op3_bringup/launch/op3_bringup_visualization.launch create mode 100644 op3_bringup/package.xml create mode 100644 op3_bringup/rviz/op3_bringup.rviz create mode 100644 op3_demo/CHANGELOG.rst create mode 100644 op3_demo/list/action_script.yaml rename op3_demo/{script => list}/action_script_bk.yaml (72%) delete mode 100644 op3_demo/script/action_script.yaml create mode 100644 robotis_op3_demo/CHANGELOG.rst diff --git a/.robotis_op3_demo.rosinstall b/.robotis_op3_demo.rosinstall new file mode 100644 index 0000000..146fa30 --- /dev/null +++ b/.robotis_op3_demo.rosinstall @@ -0,0 +1,2 @@ +- git: {local-name: robotis_op3_tools, uri: 'https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Tools.git', version: master} +- git: {local-name: humanoid_navigation, uri: 'https://github.com/ROBOTIS-GIT/humanoid_navigation.git', version: master} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 07bc3c6..9316a80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,14 +12,15 @@ compiler: - gcc notifications: email: - on_success: always + on_success: change on_failure: always recipients: - pyo@robotis.com env: matrix: - - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian +# - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian # - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=debian OS_CODE_NAME=jessie + - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=file $ROSINSTALL_FILENAME=".robotis_op3_demo.rosinstall" branches: only: - master diff --git a/README.md b/README.md new file mode 100644 index 0000000..51875b9 --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# ROBOTIS OP3 + + +## ROS Packages for ROBOTIS OP3 Demo +|Version|Kinetic + Ubuntu Xenial|Melodic + Ubuntu Bionic| +|:---:|:---:|:---:| +|[![GitHub version](https://badge.fury.io/gh/ROBOTIS-GIT%2FROBOTIS-OP3-Demo.svg)](https://badge.fury.io/gh/ROBOTIS-GIT%2FROBOTIS-OP3-Demo)|[![Build Status](https://travis-ci.org/ROBOTIS-GIT/ROBOTIS-OP3-Demo.svg?branch=kinetic-devel)](https://travis-ci.org/ROBOTIS-GIT/ROBOTIS-OP3-Demo)|-| + +## ROBOTIS e-Manual for ROBOTIS OP3 +- [ROBOTIS e-Manual for ROBOTIS OP3](http://emanual.robotis.com/docs/en/platform/op3/introduction/) + +## Wiki for robotis_op3_demo Packages +- http://wiki.ros.org/robotis_op3_demo (metapackage) +- http://wiki.ros.org/ball_detector +- http://wiki.ros.org/op3_demo + +## Open Source related to ROBOTIS OP3 +- [robotis_op3](https://github.com/ROBOTIS-GIT/ROBOTIS-OP3) +- [robotis_op3_msgs](https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-msgs) +- [robotis_op3_common](https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Common) +- [robotis_op3_tools](https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Tools) +- [robotis_op3_demo](https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo) +- [robotis_framework](https://github.com/ROBOTIS-GIT/ROBOTIS-Framework) +- [robotis_controller_msgs](https://github.com/ROBOTIS-GIT/ROBOTIS-Framework-msgs) +- [robotis_utility](https://github.com/ROBOTIS-GIT/ROBOTIS-Utility) +- [robotis_math](https://github.com/ROBOTIS-GIT/ROBOTIS-Math) +- [dynamixel_sdk](https://github.com/ROBOTIS-GIT/DynamixelSDK) +- [OpenCR-Hardware](https://github.com/ROBOTIS-GIT/OpenCR-Hardware) +- [OpenCR](https://github.com/ROBOTIS-GIT/OpenCR) + +## Documents and Videos related to ROBOTIS OP3 +- [ROBOTIS e-Manual for ROBOTIS OP3](http://emanual.robotis.com/docs/en/platform/op3/introduction/) +- [ROBOTIS e-Manual for ROBOTIS Framework](http://emanual.robotis.com/docs/en/software/robotis_framework_packages/) +- [ROBOTIS e-Manual for Dynamixel SDK](http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/) diff --git a/ball_detector/CHANGELOG.rst b/ball_detector/CHANGELOG.rst new file mode 100644 index 0000000..5d3764c --- /dev/null +++ b/ball_detector/CHANGELOG.rst @@ -0,0 +1,12 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package ball_detector +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +0.1.0 (2018-03-30) +------------------ +* first release +* added launch files in order to move the camera setting to op3_camera_setting package +* added missing package in find_package() +* refacoring to release +* splited repositoryfrom ROBOTIS-OP3 +* Contributors: Kayman, Zerom, Pyo diff --git a/ball_detector/CMakeLists.txt b/ball_detector/CMakeLists.txt index 57f6e27..d2acc5e 100644 --- a/ball_detector/CMakeLists.txt +++ b/ball_detector/CMakeLists.txt @@ -1,26 +1,30 @@ ################################################################################ -# CMake +# Set minimum required version of cmake, project name and compile options ################################################################################ cmake_minimum_required(VERSION 2.8.3) project(ball_detector) ################################################################################ -# Packages +# Find catkin packages and libraries for catkin and system dependencies ################################################################################ find_package(catkin REQUIRED COMPONENTS - roslib - cv_bridge - geometry_msgs - image_transport roscpp - rospy + roslib std_msgs + sensor_msgs + geometry_msgs dynamic_reconfigure + cv_bridge + image_transport message_generation ) +find_package(Boost REQUIRED COMPONENTS thread) +find_package(OpenCV 3 REQUIRED) + ## Resolve system dependency on yaml-cpp, which apparently does not ## provide a CMake find_package() module. +## Insert your header file compatible specified path like '#include ' find_package(PkgConfig REQUIRED) pkg_check_modules(YAML_CPP REQUIRED yaml-cpp) find_path(YAML_CPP_INCLUDE_DIR @@ -36,12 +40,17 @@ link_directories(${YAML_CPP_LIBRARY_DIRS}) if(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") add_definitions(-DHAVE_NEW_YAMLCPP) endif(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") + +################################################################################ +# Setup for python modules and scripts +################################################################################ + ################################################################################ # Declare ROS messages, services and actions ################################################################################ add_message_files( FILES - circleSetStamped.msg + CircleSetStamped.msg BallDetectorParams.msg ) @@ -53,21 +62,34 @@ add_service_files( generate_messages( DEPENDENCIES - geometry_msgs std_msgs + std_msgs + geometry_msgs ) ################################################################################ # Declare ROS dynamic reconfigure parameters ################################################################################ -generate_dynamic_reconfigure_options(cfg/DetectorParams.cfg) +generate_dynamic_reconfigure_options( + cfg/DetectorParams.cfg +) ################################################################################ -# Catkin specific configuration -################################################################################ +# Declare catkin specific configuration to be passed to dependent projects +################################################################################## catkin_package( INCLUDE_DIRS include - CATKIN_DEPENDS cv_bridge geometry_msgs image_transport roscpp rospy std_msgs dynamic_reconfigure + CATKIN_DEPENDS + roscpp + roslib + std_msgs + sensor_msgs + geometry_msgs + dynamic_reconfigure + cv_bridge + image_transport + message_runtime + DEPENDS Boost OpenCV ) ################################################################################ @@ -76,22 +98,39 @@ catkin_package( include_directories( include ${catkin_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${OpenCV_INCLUDE_DIRS} ${YAML_CPP_INCLUDE_DIRS} ) add_executable(ball_detector_node src/ball_detector.cpp - src/ball_detector_node.cpp) + src/ball_detector_node.cpp +) + +add_dependencies(ball_detector_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) -add_dependencies(ball_detector_node ${PROJECT_NAME}_gencfg ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) target_link_libraries(ball_detector_node ${catkin_LIBRARIES} + ${Boost_LIBRARIES} + ${OpenCV_LIBRARIES} ${YAML_CPP_LIBRARIES} ) ################################################################################ # Install ################################################################################ +install(TARGETS ball_detector_node + RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +) + +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} +) + +install(DIRECTORY config launch rviz + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) ################################################################################ # Test diff --git a/ball_detector/cfg/detector_params_blue.cfg b/ball_detector/cfg/DetectorParamsBlue.cfg old mode 100755 new mode 100644 similarity index 96% rename from ball_detector/cfg/detector_params_blue.cfg rename to ball_detector/cfg/DetectorParamsBlue.cfg index 2d61d6c..b9bd967 --- a/ball_detector/cfg/detector_params_blue.cfg +++ b/ball_detector/cfg/DetectorParamsBlue.cfg @@ -30,4 +30,4 @@ gen.add("filter2_v_max",int_t , -1, "Threshold of V filter", 255, 0, 255) gen.add("ellipse_size",int_t , -1, "Ellipse size", 2, 1, 9) gen.add("debug_image", bool_t, 0, "Show filtered image to debug", False) -exit(gen.generate(PACKAGE, "ball_detector_node", "detectorParams")) +exit(gen.generate(PACKAGE, "ball_detector_node", "DetectorParamsBlue")) diff --git a/ball_detector/cfg/detector_params_red.cfg b/ball_detector/cfg/DetectorParamsRed.cfg old mode 100755 new mode 100644 similarity index 96% rename from ball_detector/cfg/detector_params_red.cfg rename to ball_detector/cfg/DetectorParamsRed.cfg index 4fa6a18..79d08a2 --- a/ball_detector/cfg/detector_params_red.cfg +++ b/ball_detector/cfg/DetectorParamsRed.cfg @@ -30,4 +30,4 @@ gen.add("filter2_v_max",int_t , -1, "Threshold of V filter", 255, 0, 255) gen.add("ellipse_size",int_t , -1, "Ellipse size", 5, 1, 9) gen.add("debug_image", bool_t, 0, "Show filtered image to debug", False) -exit(gen.generate(PACKAGE, "ball_detector_node", "detectorParams")) +exit(gen.generate(PACKAGE, "ball_detector_node", "DetectorParamsRed")) diff --git a/ball_detector/launch/ball_detector_params.yaml b/ball_detector/config/ball_detector_params.yaml similarity index 100% rename from ball_detector/launch/ball_detector_params.yaml rename to ball_detector/config/ball_detector_params.yaml diff --git a/ball_detector/launch/ball_detector_params_default.yaml b/ball_detector/config/ball_detector_params_default.yaml similarity index 100% rename from ball_detector/launch/ball_detector_params_default.yaml rename to ball_detector/config/ball_detector_params_default.yaml diff --git a/ball_detector/launch/ball_detector_params_op.yaml b/ball_detector/config/ball_detector_params_op.yaml similarity index 100% rename from ball_detector/launch/ball_detector_params_op.yaml rename to ball_detector/config/ball_detector_params_op.yaml diff --git a/ball_detector/include/ball_detector/ball_detector.h b/ball_detector/include/ball_detector/ball_detector.h index 18cf79f..96a9981 100644 --- a/ball_detector/include/ball_detector/ball_detector.h +++ b/ball_detector/include/ball_detector/ball_detector.h @@ -21,23 +21,26 @@ #include -#include -#include - -//ros dependencies #include #include #include #include -#include -#include #include #include #include +#include +#include + +#include +#include +#include +#include -#include "ball_detector/circleSetStamped.h" -#include "ball_detector/ball_detector_config.h" #include "ball_detector/DetectorParamsConfig.h" + +#include "ball_detector/ball_detector_config.h" + +#include "ball_detector/CircleSetStamped.h" #include "ball_detector/GetParameters.h" #include "ball_detector/SetParameters.h" @@ -112,7 +115,7 @@ class BallDetector int not_found_count_; //circle set publisher - ball_detector::circleSetStamped circles_msg_; + ball_detector::CircleSetStamped circles_msg_; ros::Publisher circles_pub_; //camera info subscriber diff --git a/ball_detector/launch/ball_detector.launch b/ball_detector/launch/ball_detector.launch index 05cc278..34a12ba 100644 --- a/ball_detector/launch/ball_detector.launch +++ b/ball_detector/launch/ball_detector.launch @@ -1,13 +1,13 @@ - + - - - - - - - + + + + + + + diff --git a/ball_detector/launch/ball_detector_from_usb_cam.launch b/ball_detector/launch/ball_detector_from_usb_cam.launch index e84838b..44ecad5 100644 --- a/ball_detector/launch/ball_detector_from_usb_cam.launch +++ b/ball_detector/launch/ball_detector_from_usb_cam.launch @@ -1,28 +1,27 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/ball_detector/launch/ball_detector_from_uvc.launch b/ball_detector/launch/ball_detector_from_uvc.launch index 4ef7b43..5946129 100644 --- a/ball_detector/launch/ball_detector_from_uvc.launch +++ b/ball_detector/launch/ball_detector_from_uvc.launch @@ -1,30 +1,30 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/ball_detector/package.xml b/ball_detector/package.xml index 47af0d6..2f2acf3 100644 --- a/ball_detector/package.xml +++ b/ball_detector/package.xml @@ -1,30 +1,35 @@ ball_detector - 0.1.1 + 0.1.0 - This package implements a circle-like shape detector of the input image. - It requires and input image and publish, at frame rate, a marked image - and a stamped array of circle centers and radius. + This package implements a circle-like shape detector of the input image. + It requires and input image and publish, at frame rate, a marked image + and a stamped array of circle centers and radius. - Apache License 2.0 - kayman + Apache 2.0 + Kayman + Zerom Pyo - + http://wiki.ros.org/ball_detector + http://emanual.robotis.com/docs/en/platform/op3/introduction/ + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo/issues catkin - roslib - cv_bridge - geometry_msgs - image_transport roscpp - rospy + roslib std_msgs - cmake_modules + sensor_msgs + geometry_msgs + dynamic_reconfigure + cv_bridge + image_transport + boost + opencv3 yaml-cpp message_generation message_runtime message_runtime - dynamic_reconfigure - dynamic_reconfigure - dynamic_reconfigure + usb_cam + uvc_camera diff --git a/ball_detector/launch/ball_detector.rviz b/ball_detector/rviz/ball_detector.rviz similarity index 100% rename from ball_detector/launch/ball_detector.rviz rename to ball_detector/rviz/ball_detector.rviz diff --git a/ball_detector/src/ball_detector.cpp b/ball_detector/src/ball_detector.cpp index 552c699..7dbba3c 100644 --- a/ball_detector/src/ball_detector.cpp +++ b/ball_detector/src/ball_detector.cpp @@ -16,7 +16,6 @@ /* Author: Kayman Jung */ -#include #include #include "ball_detector/ball_detector.h" @@ -72,7 +71,7 @@ BallDetector::BallDetector() //sets publishers image_pub_ = it_.advertise("image_out", 100); - circles_pub_ = nh_.advertise("circle_set", 100); + circles_pub_ = nh_.advertise("circle_set", 100); camera_info_pub_ = nh_.advertise("camera_info", 100); //sets subscribers @@ -92,7 +91,7 @@ BallDetector::BallDetector() param_command_sub_ = nh_.subscribe("param_command", 1, &BallDetector::paramCommandCallback, this); set_param_client_ = nh_.advertiseService("set_param", &BallDetector::setParamCallback, this); get_param_client_ = nh_.advertiseService("get_param", &BallDetector::getParamCallback, this); - default_setting_path_ = ros::package::getPath(ROS_PACKAGE_NAME) + "/launch/ball_detector_params_default.yaml"; + default_setting_path_ = ros::package::getPath(ROS_PACKAGE_NAME) + "/config/ball_detector_params_default.yaml"; //sets config and prints it params_config_ = detect_config; diff --git a/op3_bringup/CMakeLists.txt b/op3_bringup/CMakeLists.txt new file mode 100644 index 0000000..403e6d6 --- /dev/null +++ b/op3_bringup/CMakeLists.txt @@ -0,0 +1,195 @@ +cmake_minimum_required(VERSION 2.8.3) +project(op3_bringup) + +## Compile as C++11, supported in ROS Kinetic and newer +# add_compile_options(-std=c++11) + +## Find catkin macros and libraries +## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) +## is used, also find other catkin packages +find_package(catkin REQUIRED) + +## System dependencies are found with CMake's conventions +# find_package(Boost REQUIRED COMPONENTS system) + + +## 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() + +################################################ +## Declare ROS messages, services and actions ## +################################################ + +## To declare and build messages, services or actions from within this +## package, follow these steps: +## * Let MSG_DEP_SET be the set of packages whose message types you use in +## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). +## * In the file package.xml: +## * add a build_depend tag for "message_generation" +## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET +## * If MSG_DEP_SET isn't empty the following dependency has been pulled in +## but can be declared for certainty nonetheless: +## * add a run_depend tag for "message_runtime" +## * In this file (CMakeLists.txt): +## * add "message_generation" and every package in MSG_DEP_SET to +## find_package(catkin REQUIRED COMPONENTS ...) +## * add "message_runtime" and every package in MSG_DEP_SET to +## catkin_package(CATKIN_DEPENDS ...) +## * uncomment the add_*_files sections below as needed +## and list every .msg/.srv/.action file to be processed +## * uncomment the generate_messages entry below +## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) + +## Generate messages in the 'msg' folder +# add_message_files( +# FILES +# Message1.msg +# Message2.msg +# ) + +## Generate services in the 'srv' folder +# add_service_files( +# FILES +# Service1.srv +# Service2.srv +# ) + +## Generate actions in the 'action' folder +# add_action_files( +# FILES +# Action1.action +# Action2.action +# ) + +## Generate added messages and services with any dependencies listed here +# generate_messages( +# DEPENDENCIES +# std_msgs # Or other packages containing msgs +# ) + +################################################ +## Declare ROS dynamic reconfigure parameters ## +################################################ + +## To declare and build dynamic reconfigure parameters within this +## package, follow these steps: +## * In the file package.xml: +## * add a build_depend and a run_depend tag for "dynamic_reconfigure" +## * In this file (CMakeLists.txt): +## * add "dynamic_reconfigure" to +## find_package(catkin REQUIRED COMPONENTS ...) +## * uncomment the "generate_dynamic_reconfigure_options" section below +## and list every .cfg file to be processed + +## Generate dynamic reconfigure parameters in the 'cfg' folder +# generate_dynamic_reconfigure_options( +# cfg/DynReconf1.cfg +# cfg/DynReconf2.cfg +# ) + +################################### +## catkin specific configuration ## +################################### +## The catkin_package macro generates cmake config files for your package +## Declare things to be passed to dependent projects +## INCLUDE_DIRS: uncomment this if your package contains header files +## LIBRARIES: libraries you create in this project that dependent projects also need +## CATKIN_DEPENDS: catkin_packages dependent projects also need +## DEPENDS: system dependencies of this project that dependent projects also need +catkin_package( +# INCLUDE_DIRS include +# LIBRARIES op3_bringup +# CATKIN_DEPENDS other_catkin_pkg +# DEPENDS system_lib +) + +########### +## Build ## +########### + +## Specify additional locations of header files +## Your package locations should be listed before other locations +include_directories( +# include +# ${catkin_INCLUDE_DIRS} +) + +## Declare a C++ library +# add_library(${PROJECT_NAME} +# src/${PROJECT_NAME}/op3_bringup.cpp +# ) + +## Add cmake target dependencies of the library +## as an example, code may need to be generated before libraries +## either from message generation or dynamic reconfigure +# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) + +## Declare a C++ executable +## With catkin_make all packages are built within a single CMake context +## The recommended prefix ensures that target names across packages don't collide +# add_executable(${PROJECT_NAME}_node src/op3_bringup_node.cpp) + +## Rename C++ executable without prefix +## The above recommended prefix causes long target names, the following renames the +## target back to the shorter version for ease of user use +## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" +# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") + +## Add cmake target dependencies of the executable +## same as for the library above +# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) + +## Specify libraries to link a library or executable target against +# target_link_libraries(${PROJECT_NAME}_node +# ${catkin_LIBRARIES} +# ) + +############# +## Install ## +############# + +# all install targets should use catkin DESTINATION variables +# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html + +## Mark executable scripts (Python etc.) for installation +## in contrast to setup.py, you can choose the destination +# install(PROGRAMS +# scripts/my_python_script +# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +# ) + +## Mark executables and/or libraries for installation +# install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node +# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} +# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} +# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +# ) + +## Mark cpp header files for installation +# install(DIRECTORY include/${PROJECT_NAME}/ +# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} +# FILES_MATCHING PATTERN "*.h" +# PATTERN ".svn" EXCLUDE +# ) + +## Mark other files for installation (e.g. launch and bag files, etc.) +# install(FILES +# # myfile1 +# # myfile2 +# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +# ) + +############# +## Testing ## +############# + +## Add gtest based cpp test target and link libraries +# catkin_add_gtest(${PROJECT_NAME}-test test/test_op3_bringup.cpp) +# if(TARGET ${PROJECT_NAME}-test) +# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) +# endif() + +## Add folders to be run by python nosetests +# catkin_add_nosetests(test) diff --git a/op3_bringup/launch/op3_bringup.launch b/op3_bringup/launch/op3_bringup.launch new file mode 100644 index 0000000..a3eacfb --- /dev/null +++ b/op3_bringup/launch/op3_bringup.launch @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/op3_bringup/launch/op3_bringup_visualization.launch b/op3_bringup/launch/op3_bringup_visualization.launch new file mode 100644 index 0000000..5ad06e0 --- /dev/null +++ b/op3_bringup/launch/op3_bringup_visualization.launch @@ -0,0 +1,18 @@ + + + + + + + + [/robotis/present_joint_states] + + + + + + + + + + diff --git a/op3_bringup/package.xml b/op3_bringup/package.xml new file mode 100644 index 0000000..21f0087 --- /dev/null +++ b/op3_bringup/package.xml @@ -0,0 +1,59 @@ + + + op3_bringup + 0.0.0 + The op3_bringup package + + + + + robotis + + + + + + TODO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + catkin + + + + + + + + diff --git a/op3_bringup/rviz/op3_bringup.rviz b/op3_bringup/rviz/op3_bringup.rviz new file mode 100644 index 0000000..7a00cca --- /dev/null +++ b/op3_bringup/rviz/op3_bringup.rviz @@ -0,0 +1,348 @@ +Panels: + - Class: rviz/Displays + Help Height: 78 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Status1 + - /TF1 + Splitter Ratio: 0.5 + Tree Height: 352 + - Class: rviz/Selection + Name: Selection + - Class: rviz/Tool Properties + Expanded: + - /2D Pose Estimate1 + - /2D Nav Goal1 + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.588679016 + - Class: rviz/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 + - Class: rviz/Time + Experimental: false + Name: Time + SyncMode: 0 + SyncSource: Image +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.0299999993 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Alpha: 1 + Class: rviz/RobotModel + Collision Enabled: false + Enabled: true + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + body_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + cam_gazebo_link: + Alpha: 1 + Show Axes: false + Show Trail: false + cam_link: + Alpha: 1 + Show Axes: false + Show Trail: false + head_pan_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + head_tilt_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + l_ank_pitch_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + l_ank_roll_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + l_el_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + l_hip_pitch_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + l_hip_roll_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + l_hip_yaw_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + l_knee_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + l_sho_pitch_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + l_sho_roll_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + r_ank_pitch_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + r_ank_roll_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + r_el_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + r_hip_pitch_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + r_hip_roll_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + r_hip_yaw_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + r_knee_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + r_sho_pitch_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + r_sho_roll_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + Name: RobotModel + Robot Description: robot_description + TF Prefix: "" + Update Interval: 0 + Value: true + Visual Enabled: true + - Class: rviz/Image + Enabled: true + Image Topic: /usb_cam_node/image_raw + Max Value: 1 + Median window: 5 + Min Value: 0 + Name: Image + Normalize Range: true + Queue Size: 2 + Transport Hint: raw + Unreliable: false + Value: true + - Class: rviz/TF + Enabled: true + Frame Timeout: 15 + Frames: + All Enabled: true + body_link: + Value: true + cam_gazebo_link: + Value: true + cam_link: + Value: true + head_pan_link: + Value: true + head_tilt_link: + Value: true + l_ank_pitch_link: + Value: true + l_ank_roll_link: + Value: true + l_el_link: + Value: true + l_hip_pitch_link: + Value: true + l_hip_roll_link: + Value: true + l_hip_yaw_link: + Value: true + l_knee_link: + Value: true + l_sho_pitch_link: + Value: true + l_sho_roll_link: + Value: true + r_ank_pitch_link: + Value: true + r_ank_roll_link: + Value: true + r_el_link: + Value: true + r_hip_pitch_link: + Value: true + r_hip_roll_link: + Value: true + r_hip_yaw_link: + Value: true + r_knee_link: + Value: true + r_sho_pitch_link: + Value: true + r_sho_roll_link: + Value: true + world: + Value: true + Marker Scale: 0.200000003 + Name: TF + Show Arrows: false + Show Axes: true + Show Names: false + Tree: + world: + body_link: + head_pan_link: + head_tilt_link: + cam_gazebo_link: + {} + cam_link: + {} + l_hip_yaw_link: + l_hip_roll_link: + l_hip_pitch_link: + l_knee_link: + l_ank_pitch_link: + l_ank_roll_link: + {} + l_sho_pitch_link: + l_sho_roll_link: + l_el_link: + {} + r_hip_yaw_link: + r_hip_roll_link: + r_hip_pitch_link: + r_knee_link: + r_ank_pitch_link: + r_ank_roll_link: + {} + r_sho_pitch_link: + r_sho_roll_link: + r_el_link: + {} + Update Interval: 0 + Value: true + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Default Light: true + Fixed Frame: body_link + Frame Rate: 30 + Name: root + Tools: + - Class: rviz/Interact + Hide Inactive Objects: true + - Class: rviz/MoveCamera + - Class: rviz/Select + - Class: rviz/FocusCamera + - Class: rviz/Measure + - Class: rviz/SetInitialPose + Topic: /initialpose + - Class: rviz/SetGoal + Topic: /move_base_simple/goal + - Class: rviz/PublishPoint + Single click: true + Topic: /clicked_point + Value: true + Views: + Current: + Class: rviz/Orbit + Distance: 1.0015856 + Enable Stereo Rendering: + Stereo Eye Separation: 0.0599999987 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Focal Point: + X: 0 + Y: 0 + Z: 0 + Focal Shape Fixed Size: true + Focal Shape Size: 0.0500000007 + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.00999999978 + Pitch: 0.425398082 + Target Frame: + Value: Orbit (rviz) + Yaw: 5.78858471 + Saved: ~ +Window Geometry: + Displays: + collapsed: false + Height: 1023 + Hide Left Dock: false + Hide Right Dock: true + Image: + collapsed: false + QMainWindow State: 000000ff00000000fd00000004000000000000023300000358fc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006600fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c0061007900730100000043000001f1000000df00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d006100670065010000023a000001610000001800ffffff000000010000010f00000358fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000004300000358000000b800fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007800000003efc0100000002fb0000000800540069006d00650100000000000007800000022400fffffffb0000000800540069006d00650100000000000004500000000000000000000005470000035800000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Time: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: true + Width: 1920 + X: 0 + Y: 0 diff --git a/op3_demo/CHANGELOG.rst b/op3_demo/CHANGELOG.rst new file mode 100644 index 0000000..62ead4d --- /dev/null +++ b/op3_demo/CHANGELOG.rst @@ -0,0 +1,12 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package op3_demo +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +0.1.0 (2018-03-30) +------------------ +* first release +* added launch files in order to move the camera setting to op3_camera_setting package +* added missing package in find_package() +* refacoring to release +* splited repositoryfrom ROBOTIS-OP3 +* Contributors: Kayman, Yoshimaru Tanaka, Pyo diff --git a/op3_demo/CMakeLists.txt b/op3_demo/CMakeLists.txt index d002446..42445a0 100644 --- a/op3_demo/CMakeLists.txt +++ b/op3_demo/CMakeLists.txt @@ -1,28 +1,32 @@ ################################################################################ -# CMake +# Set minimum required version of cmake, project name and compile options ################################################################################ cmake_minimum_required(VERSION 2.8.3) project(op3_demo) ################################################################################ -# Packages +# Find catkin packages and libraries for catkin and system dependencies ################################################################################ find_package(catkin REQUIRED COMPONENTS roscpp roslib + std_msgs sensor_msgs - ball_detector + geometry_msgs + robotis_controller_msgs op3_walking_module_msgs op3_action_module_msgs - robotis_controller_msgs cmake_modules robotis_math + ball_detector ) +find_package(Boost REQUIRED COMPONENTS thread) find_package(Eigen3 REQUIRED) ## Resolve system dependency on yaml-cpp, which apparently does not ## provide a CMake find_package() module. +## Insert your header file compatible specified path like '#include ' find_package(PkgConfig REQUIRED) pkg_check_modules(YAML_CPP REQUIRED yaml-cpp) find_path(YAML_CPP_INCLUDE_DIR @@ -39,6 +43,10 @@ if(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") add_definitions(-DHAVE_NEW_YAMLCPP) endif(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") +################################################################################ +# Setup for python modules and scripts +################################################################################ + ################################################################################ # Declare ROS messages, services and actions ################################################################################ @@ -48,12 +56,23 @@ endif(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") ################################################################################ ################################################################################ -# Catkin specific configuration +# Declare catkin specific configuration to be passed to dependent projects ################################################################################ catkin_package( INCLUDE_DIRS include - CATKIN_DEPENDS roscpp sensor_msgs cmake_modules - DEPENDS EIGEN3 + CATKIN_DEPENDS + roscpp + roslib + std_msgs + sensor_msgs + geometry_msgs + robotis_controller_msgs + op3_walking_module_msgs + op3_action_module_msgs + cmake_modules + robotis_math + ball_detector + DEPENDS Boost EIGEN3 ) ################################################################################ @@ -62,6 +81,7 @@ catkin_package( include_directories( include ${catkin_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} ${YAML_CPP_INCLUDE_DIRS} ) @@ -76,11 +96,16 @@ add_executable(op_demo_node src/vision/face_tracker.cpp ) -add_dependencies(op_demo_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) +add_dependencies(op_demo_node + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} +) target_link_libraries(op_demo_node ${catkin_LIBRARIES} - yaml-cpp + ${Boost_LIBRARIES} + ${Eigen3_LIBRARIES} + ${YAML_CPP_LIBRARIES} ) add_executable(self_test_node @@ -95,48 +120,32 @@ add_executable(self_test_node src/test/mic_test.cpp ) -add_dependencies(self_test_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) +add_dependencies(self_test_node + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} +) target_link_libraries(self_test_node ${catkin_LIBRARIES} - ${Eigen3_LIBRARIES} + ${Boost_LIBRARIES} + ${Eigen3_LIBRARIES} ${YAML_CPP_LIBRARIES} ) ################################################################################ # Install ################################################################################ +install(TARGETS op_demo_node self_test_node + RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +) -# all install targets should use catkin DESTINATION variables -# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} +) -## Mark executable scripts (Python etc.) for installation -## in contrast to setup.py, you can choose the destination -# install(PROGRAMS -# scripts/my_python_script -# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) - -## Mark executables and/or libraries for installation -# install(TARGETS ball_tracking ball_tracking_node -# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) - -## Mark cpp header files for installation -# install(DIRECTORY include/${PROJECT_NAME}/ -# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} -# FILES_MATCHING PATTERN "*.h" -# PATTERN ".svn" EXCLUDE -# ) - -## Mark other files for installation (e.g. launch and bag files, etc.) -# install(FILES -# # myfile1 -# # myfile2 -# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} -# ) +install(DIRECTORY data launch list + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) ################################################################################ # Test diff --git a/op3_demo/include/op3_demo/action_demo.h b/op3_demo/include/op3_demo/action_demo.h index 32a9435..4231406 100644 --- a/op3_demo/include/op3_demo/action_demo.h +++ b/op3_demo/include/op3_demo/action_demo.h @@ -19,14 +19,14 @@ #ifndef ACTION_DEMO_H_ #define ACTION_DEMO_H_ -#include -#include - #include #include #include #include +#include +#include + #include "op3_demo/op_demo.h" #include "robotis_controller_msgs/JointCtrlModule.h" #include "robotis_controller_msgs/SetModule.h" diff --git a/op3_demo/include/op3_demo/ball_follower.h b/op3_demo/include/op3_demo/ball_follower.h index 9e12ffc..7ec1d46 100644 --- a/op3_demo/include/op3_demo/ball_follower.h +++ b/op3_demo/include/op3_demo/ball_follower.h @@ -20,16 +20,16 @@ #define BALL_FOLLOWER_H_ #include -#include - #include #include #include #include #include +#include +#include #include "robotis_controller_msgs/JointCtrlModule.h" -#include "ball_detector/circleSetStamped.h" +#include "ball_detector/CircleSetStamped.h" #include "op3_walking_module_msgs/WalkingParam.h" #include "op3_walking_module_msgs/GetWalkingParam.h" diff --git a/op3_demo/include/op3_demo/ball_tracker.h b/op3_demo/include/op3_demo/ball_tracker.h index 0d3cfac..5461494 100644 --- a/op3_demo/include/op3_demo/ball_tracker.h +++ b/op3_demo/include/op3_demo/ball_tracker.h @@ -20,17 +20,16 @@ #define BALL_TRACKING_H_ #include -#include - #include #include #include #include -//#include #include +#include +#include #include "robotis_controller_msgs/JointCtrlModule.h" -#include "ball_detector/circleSetStamped.h" +#include "ball_detector/CircleSetStamped.h" #include "op3_walking_module_msgs/WalkingParam.h" #include "op3_walking_module_msgs/GetWalkingParam.h" @@ -80,7 +79,7 @@ protected: const int WAITING_THRESHOLD; const bool DEBUG_PRINT; - void ballPositionCallback(const ball_detector::circleSetStamped::ConstPtr &msg); + void ballPositionCallback(const ball_detector::CircleSetStamped::ConstPtr &msg); void ballTrackerCommandCallback(const std_msgs::String::ConstPtr &msg); void publishHeadJoint(double pan, double tilt); void scanBall(); diff --git a/op3_demo/include/op3_demo/button_test.h b/op3_demo/include/op3_demo/button_test.h index 127c978..84e8bee 100644 --- a/op3_demo/include/op3_demo/button_test.h +++ b/op3_demo/include/op3_demo/button_test.h @@ -19,14 +19,12 @@ #ifndef BUTTON_TEST_H_ #define BUTTON_TEST_H_ -#include - #include #include #include +#include #include "op3_demo/op_demo.h" - #include "robotis_controller_msgs/SyncWriteItem.h" namespace robotis_op diff --git a/op3_demo/include/op3_demo/face_tracker.h b/op3_demo/include/op3_demo/face_tracker.h index 0671b24..3289375 100644 --- a/op3_demo/include/op3_demo/face_tracker.h +++ b/op3_demo/include/op3_demo/face_tracker.h @@ -20,8 +20,6 @@ #define FACE_TRACKING_H_ #include -#include - #include #include #include @@ -29,6 +27,7 @@ #include #include #include +#include namespace robotis_op { diff --git a/op3_demo/include/op3_demo/mic_test.h b/op3_demo/include/op3_demo/mic_test.h index 7cd025a..144fe96 100644 --- a/op3_demo/include/op3_demo/mic_test.h +++ b/op3_demo/include/op3_demo/mic_test.h @@ -20,14 +20,12 @@ #define MIC_TEST_H_ #include -#include - #include #include #include +#include #include "op3_demo/op_demo.h" - #include "robotis_controller_msgs/SyncWriteItem.h" namespace robotis_op diff --git a/op3_demo/include/op3_demo/soccer_demo.h b/op3_demo/include/op3_demo/soccer_demo.h index f65d81b..a771eda 100644 --- a/op3_demo/include/op3_demo/soccer_demo.h +++ b/op3_demo/include/op3_demo/soccer_demo.h @@ -23,15 +23,18 @@ #include #include #include +#include +#include + +#include "op3_action_module_msgs/IsRunning.h" +#include "robotis_controller_msgs/SyncWriteItem.h" +#include "robotis_controller_msgs/JointCtrlModule.h" +#include "robotis_controller_msgs/SetJointModule.h" #include "op3_demo/op_demo.h" #include "op3_demo/ball_tracker.h" #include "op3_demo/ball_follower.h" #include "robotis_math/robotis_linear_algebra.h" -#include "op3_action_module_msgs/IsRunning.h" -#include "robotis_controller_msgs/SyncWriteItem.h" -#include "robotis_controller_msgs/JointCtrlModule.h" -#include "robotis_controller_msgs/SetJointModule.h" namespace robotis_op { diff --git a/op3_demo/include/op3_demo/vision_demo.h b/op3_demo/include/op3_demo/vision_demo.h index 3ebdc46..20cd1ad 100644 --- a/op3_demo/include/op3_demo/vision_demo.h +++ b/op3_demo/include/op3_demo/vision_demo.h @@ -19,19 +19,18 @@ #ifndef VISION_DEMO_H_ #define VISION_DEMO_H_ -#include - #include #include #include #include - -#include "op3_demo/op_demo.h" -#include "op3_demo/face_tracker.h" +#include #include "robotis_controller_msgs/SyncWriteItem.h" #include "robotis_controller_msgs/SetModule.h" +#include "op3_demo/op_demo.h" +#include "op3_demo/face_tracker.h" + namespace robotis_op { diff --git a/op3_demo/launch/demo.launch b/op3_demo/launch/demo.launch index aa5098b..2b5281c 100644 --- a/op3_demo/launch/demo.launch +++ b/op3_demo/launch/demo.launch @@ -1,7 +1,5 @@ - - diff --git a/op3_demo/launch/face_detection_op3.launch b/op3_demo/launch/face_detection_op3.launch index afc5f12..d42ab41 100644 --- a/op3_demo/launch/face_detection_op3.launch +++ b/op3_demo/launch/face_detection_op3.launch @@ -7,16 +7,16 @@ - - - - + args="$(arg face_cascade_name_0) + $(arg face_cascade_name_1) + $(arg face_cascade_name_2) + $(arg face_cascade_name_3) + $(arg face_cascade_name_4)" + output="screen"> + + + + diff --git a/op3_demo/launch/self_test.launch b/op3_demo/launch/self_test.launch index c5ca857..623004e 100644 --- a/op3_demo/launch/self_test.launch +++ b/op3_demo/launch/self_test.launch @@ -1,30 +1,29 @@ + + - - - - - + + - - + + - - + + - - + + - - + + - - - - - - + + + + + + diff --git a/op3_demo/list/action_script.yaml b/op3_demo/list/action_script.yaml new file mode 100644 index 0000000..21ce72b --- /dev/null +++ b/op3_demo/list/action_script.yaml @@ -0,0 +1,23 @@ +# combination action page number and mp3 file path +action_and_sound: + 4 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Thank you.mp3" + 41: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Introduction.mp3" + 24: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Wow.mp3" + 23: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Yes go.mp3" + 15: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Sit down.mp3" + 1: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Stand up.mp3" + 54: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Clap please.mp3" + 27: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Oops.mp3" + 38: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Bye bye.mp3" +# 101 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Oops.mp3" + 110 : "" + 111 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Intro01.mp3" + 115 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Intro02.mp3" + 118 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Intro03.mp3" + +# play list +prev_default: [4, 41, 24, 23, 15, 1, 54, 27, 38] +default: [4, 110, 111, 115, 118, 24, 54, 27, 38] + +# example of play list +#certification: [101] \ No newline at end of file diff --git a/op3_demo/script/action_script_bk.yaml b/op3_demo/list/action_script_bk.yaml similarity index 72% rename from op3_demo/script/action_script_bk.yaml rename to op3_demo/list/action_script_bk.yaml index a18155d..bc401fb 100644 --- a/op3_demo/script/action_script_bk.yaml +++ b/op3_demo/list/action_script_bk.yaml @@ -1,15 +1,15 @@ # combination action page number and mp3 file path action_and_sound: - 4 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Thank you.mp3" - 41: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Introduction.mp3" - 24: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Wow.mp3" - 23: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Yes go.mp3" - 15: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Sit down.mp3" - 1: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Stand up.mp3" - 54: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Clap please.mp3" - 27: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Oops.mp3" - 38: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Bye bye.mp3" - 101 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Oops.mp3" + 4 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Thank you.mp3" + 41: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Introduction.mp3" + 24: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Wow.mp3" + 23: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Yes go.mp3" + 15: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Sit down.mp3" + 1: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Stand up.mp3" + 54: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Clap please.mp3" + 27: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Oops.mp3" + 38: "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Bye bye.mp3" + 101 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3/ROBOTIS-OP3-Demo/op3_demo/data/mp3/Oops.mp3" # play list default: [4, 41, 24, 23, 15, 1, 54, 27, 38] diff --git a/op3_demo/package.xml b/op3_demo/package.xml index 70af22d..85bd36e 100644 --- a/op3_demo/package.xml +++ b/op3_demo/package.xml @@ -1,25 +1,36 @@ op3_demo - 0.1.1 + 0.1.0 - op3 default demo + OP3 default demo It includes three demontrations(soccer demo, vision demo, action script demo) - Apache License 2.0 - kayman + Apache 2.0 + Kayman Pyo - + http://wiki.ros.org/op3_demo + http://emanual.robotis.com/docs/en/platform/op3/introduction/ + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo/issues catkin roscpp roslib + std_msgs sensor_msgs - ball_detector + geometry_msgs robotis_controller_msgs op3_walking_module_msgs op3_action_module_msgs cmake_modules robotis_math + ball_detector + boost eigen yaml-cpp + op3_manager + op3_camera_setting_tool + op3_web_setting_tool + ros_madplay_player + diff --git a/op3_demo/script/action_script.yaml b/op3_demo/script/action_script.yaml deleted file mode 100644 index 077e820..0000000 --- a/op3_demo/script/action_script.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# combination action page number and mp3 file path -action_and_sound: - 4 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Thank you.mp3" - 41: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Introduction.mp3" - 24: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Wow.mp3" - 23: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Yes go.mp3" - 15: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Sit down.mp3" - 1: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Stand up.mp3" - 54: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Clap please.mp3" - 27: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Oops.mp3" - 38: "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Bye bye.mp3" -# 101 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Oops.mp3" - 110 : "" - 111 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Intro01.mp3" - 115 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Intro02.mp3" - 118 : "/home/robotis/catkin_ws/src/ROBOTIS-OP3-Demo/op3_demo/Data/mp3/Intro03.mp3" - -# play list -prev_default: [4, 41, 24, 23, 15, 1, 54, 27, 38] -default: [4, 110, 111, 115, 118, 24, 54, 27, 38] - -# example of play list -#certification: [101] \ No newline at end of file diff --git a/op3_demo/src/action/action_demo.cpp b/op3_demo/src/action/action_demo.cpp index 4f14679..660390c 100644 --- a/op3_demo/src/action/action_demo.cpp +++ b/op3_demo/src/action/action_demo.cpp @@ -31,7 +31,7 @@ ActionDemo::ActionDemo() ros::NodeHandle nh(ros::this_node::getName()); - std::string default_path = ros::package::getPath("op3_demo") + "/script/action_script.yaml"; + std::string default_path = ros::package::getPath("op3_demo") + "/list/action_script.yaml"; script_path_ = nh.param("action_script", default_path); std::string default_play_list = "default"; diff --git a/op3_demo/src/demo_node.cpp b/op3_demo/src/demo_node.cpp index 8039aff..300a90b 100644 --- a/op3_demo/src/demo_node.cpp +++ b/op3_demo/src/demo_node.cpp @@ -77,7 +77,7 @@ int main(int argc, char **argv) ros::Subscriber buttuon_sub = nh.subscribe("/robotis/open_cr/button", 1, buttonHandlerCallback); ros::Subscriber mode_command_sub = nh.subscribe("/robotis/mode_command", 1, demoModeCommandCallback); - default_mp3_path = ros::package::getPath("op3_demo") + "/Data/mp3/"; + default_mp3_path = ros::package::getPath("op3_demo") + "/data/mp3/"; ros::start(); diff --git a/op3_demo/src/soccer/ball_tracker.cpp b/op3_demo/src/soccer/ball_tracker.cpp index cbd4e87..355a21c 100644 --- a/op3_demo/src/soccer/ball_tracker.cpp +++ b/op3_demo/src/soccer/ball_tracker.cpp @@ -59,7 +59,7 @@ BallTracker::~BallTracker() } -void BallTracker::ballPositionCallback(const ball_detector::circleSetStamped::ConstPtr &msg) +void BallTracker::ballPositionCallback(const ball_detector::CircleSetStamped::ConstPtr &msg) { for (int idx = 0; idx < msg->circles.size(); idx++) { diff --git a/op3_demo/src/test/button_test.cpp b/op3_demo/src/test/button_test.cpp index 415d182..7a78c6a 100644 --- a/op3_demo/src/test/button_test.cpp +++ b/op3_demo/src/test/button_test.cpp @@ -33,7 +33,7 @@ ButtonTest::ButtonTest() boost::thread queue_thread = boost::thread(boost::bind(&ButtonTest::callbackThread, this)); boost::thread process_thread = boost::thread(boost::bind(&ButtonTest::processThread, this)); - default_mp3_path_ = ros::package::getPath("op3_demo") + "/Data/mp3/test/"; + default_mp3_path_ = ros::package::getPath("op3_demo") + "/data/mp3/test/"; } ButtonTest::~ButtonTest() diff --git a/op3_demo/src/test/mic_test.cpp b/op3_demo/src/test/mic_test.cpp index e1f6757..4e56954 100644 --- a/op3_demo/src/test/mic_test.cpp +++ b/op3_demo/src/test/mic_test.cpp @@ -36,8 +36,8 @@ MicTest::MicTest() boost::thread queue_thread = boost::thread(boost::bind(&MicTest::callbackThread, this)); boost::thread process_thread = boost::thread(boost::bind(&MicTest::processThread, this)); - recording_file_name_ = ros::package::getPath("op3_demo") + "/Data/mp3/test/mic-test.wav"; - default_mp3_path_ = ros::package::getPath("op3_demo") + "/Data/mp3/test/"; + recording_file_name_ = ros::package::getPath("op3_demo") + "/data/mp3/test/mic-test.wav"; + default_mp3_path_ = ros::package::getPath("op3_demo") + "/data/mp3/test/"; start_time_ = ros::Time::now(); } diff --git a/op3_demo/src/test_node.cpp b/op3_demo/src/test_node.cpp index 259ea96..8d4768d 100644 --- a/op3_demo/src/test_node.cpp +++ b/op3_demo/src/test_node.cpp @@ -84,7 +84,7 @@ int main(int argc, char **argv) ros::Subscriber buttuon_sub = nh.subscribe("/robotis/open_cr/button", 1, buttonHandlerCallback); ros::Subscriber mode_command_sub = nh.subscribe("/robotis/mode_command", 1, demoModeCommandCallback); - default_mp3_path = ros::package::getPath("op3_demo") + "/Data/mp3/"; + default_mp3_path = ros::package::getPath("op3_demo") + "/data/mp3/"; ros::start(); diff --git a/robotis_op3_demo/CHANGELOG.rst b/robotis_op3_demo/CHANGELOG.rst new file mode 100644 index 0000000..b65724b --- /dev/null +++ b/robotis_op3_demo/CHANGELOG.rst @@ -0,0 +1,12 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package robotis_op3_demo +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +0.1.0 (2018-03-30) +------------------ +* first release +* added launch files in order to move the camera setting to op3_camera_setting package +* added missing package in find_package() +* refacoring to release +* splited repositoryfrom ROBOTIS-OP3 +* Contributors: Kayman, Zerom, Yoshimaru Tanaka, Pyo diff --git a/robotis_op3_demo/CMakeLists.txt b/robotis_op3_demo/CMakeLists.txt index d88f653..b7e8eeb 100644 --- a/robotis_op3_demo/CMakeLists.txt +++ b/robotis_op3_demo/CMakeLists.txt @@ -1,4 +1,4 @@ cmake_minimum_required(VERSION 2.8.3) project(robotis_op3_demo) find_package(catkin REQUIRED) -catkin_metapackage() \ No newline at end of file +catkin_metapackage() diff --git a/robotis_op3_demo/package.xml b/robotis_op3_demo/package.xml index bba5f7c..7cf0810 100644 --- a/robotis_op3_demo/package.xml +++ b/robotis_op3_demo/package.xml @@ -1,24 +1,19 @@ - + robotis_op3_demo 0.1.0 ROS packages for the robotis_op3_demo (meta package) - - Apache License 2.0 + Apache 2.0 Kayman Pyo - - - - - + http://wiki.ros.org/robotis_op3_demo + http://emanual.robotis.com/docs/en/platform/op3/introduction/ + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo/issues catkin - ball_detector - op3_demo - - - - + ball_detector + op3_demo + From b627f131b9db84d97e16cb3b61749a9d41d84673 Mon Sep 17 00:00:00 2001 From: Kayman Date: Tue, 17 Apr 2018 17:03:28 +0900 Subject: [PATCH 48/66] updated CMakeLists.txt and package.xml of op3_bringup --- op3_bringup/CMakeLists.txt | 213 ++++++------------------------------- op3_bringup/package.xml | 71 +++---------- 2 files changed, 47 insertions(+), 237 deletions(-) diff --git a/op3_bringup/CMakeLists.txt b/op3_bringup/CMakeLists.txt index 403e6d6..b171b00 100644 --- a/op3_bringup/CMakeLists.txt +++ b/op3_bringup/CMakeLists.txt @@ -1,195 +1,42 @@ +################################################################################ +# Set minimum required version of cmake, project name and compile options +################################################################################ cmake_minimum_required(VERSION 2.8.3) project(op3_bringup) -## Compile as C++11, supported in ROS Kinetic and newer -# add_compile_options(-std=c++11) - -## Find catkin macros and libraries -## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) -## is used, also find other catkin packages +################################################################################ +# Find catkin packages and libraries for catkin and system dependencies +################################################################################ find_package(catkin REQUIRED) -## System dependencies are found with CMake's conventions -# find_package(Boost REQUIRED COMPONENTS system) +################################################################################ +# Setup for python modules and scripts +################################################################################ +################################################################################ +# Declare ROS messages, services and actions +################################################################################ -## 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() +################################################################################ +# Declare ROS dynamic reconfigure parameters +################################################################################ -################################################ -## Declare ROS messages, services and actions ## -################################################ +################################################################################ +# Declare catkin specific configuration to be passed to dependent projects +################################################################################ +catkin_package() -## To declare and build messages, services or actions from within this -## package, follow these steps: -## * Let MSG_DEP_SET be the set of packages whose message types you use in -## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). -## * In the file package.xml: -## * add a build_depend tag for "message_generation" -## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET -## * If MSG_DEP_SET isn't empty the following dependency has been pulled in -## but can be declared for certainty nonetheless: -## * add a run_depend tag for "message_runtime" -## * In this file (CMakeLists.txt): -## * add "message_generation" and every package in MSG_DEP_SET to -## find_package(catkin REQUIRED COMPONENTS ...) -## * add "message_runtime" and every package in MSG_DEP_SET to -## catkin_package(CATKIN_DEPENDS ...) -## * uncomment the add_*_files sections below as needed -## and list every .msg/.srv/.action file to be processed -## * uncomment the generate_messages entry below -## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) +################################################################################ +# Build +################################################################################ -## Generate messages in the 'msg' folder -# add_message_files( -# FILES -# Message1.msg -# Message2.msg -# ) - -## Generate services in the 'srv' folder -# add_service_files( -# FILES -# Service1.srv -# Service2.srv -# ) - -## Generate actions in the 'action' folder -# add_action_files( -# FILES -# Action1.action -# Action2.action -# ) - -## Generate added messages and services with any dependencies listed here -# generate_messages( -# DEPENDENCIES -# std_msgs # Or other packages containing msgs -# ) - -################################################ -## Declare ROS dynamic reconfigure parameters ## -################################################ - -## To declare and build dynamic reconfigure parameters within this -## package, follow these steps: -## * In the file package.xml: -## * add a build_depend and a run_depend tag for "dynamic_reconfigure" -## * In this file (CMakeLists.txt): -## * add "dynamic_reconfigure" to -## find_package(catkin REQUIRED COMPONENTS ...) -## * uncomment the "generate_dynamic_reconfigure_options" section below -## and list every .cfg file to be processed - -## Generate dynamic reconfigure parameters in the 'cfg' folder -# generate_dynamic_reconfigure_options( -# cfg/DynReconf1.cfg -# cfg/DynReconf2.cfg -# ) - -################################### -## catkin specific configuration ## -################################### -## The catkin_package macro generates cmake config files for your package -## Declare things to be passed to dependent projects -## INCLUDE_DIRS: uncomment this if your package contains header files -## LIBRARIES: libraries you create in this project that dependent projects also need -## CATKIN_DEPENDS: catkin_packages dependent projects also need -## DEPENDS: system dependencies of this project that dependent projects also need -catkin_package( -# INCLUDE_DIRS include -# LIBRARIES op3_bringup -# CATKIN_DEPENDS other_catkin_pkg -# DEPENDS system_lib +################################################################################ +# Install +################################################################################ +install(DIRECTORY launch rviz + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) -########### -## Build ## -########### - -## Specify additional locations of header files -## Your package locations should be listed before other locations -include_directories( -# include -# ${catkin_INCLUDE_DIRS} -) - -## Declare a C++ library -# add_library(${PROJECT_NAME} -# src/${PROJECT_NAME}/op3_bringup.cpp -# ) - -## Add cmake target dependencies of the library -## as an example, code may need to be generated before libraries -## either from message generation or dynamic reconfigure -# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) - -## Declare a C++ executable -## With catkin_make all packages are built within a single CMake context -## The recommended prefix ensures that target names across packages don't collide -# add_executable(${PROJECT_NAME}_node src/op3_bringup_node.cpp) - -## Rename C++ executable without prefix -## The above recommended prefix causes long target names, the following renames the -## target back to the shorter version for ease of user use -## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" -# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") - -## Add cmake target dependencies of the executable -## same as for the library above -# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) - -## Specify libraries to link a library or executable target against -# target_link_libraries(${PROJECT_NAME}_node -# ${catkin_LIBRARIES} -# ) - -############# -## Install ## -############# - -# all install targets should use catkin DESTINATION variables -# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html - -## Mark executable scripts (Python etc.) for installation -## in contrast to setup.py, you can choose the destination -# install(PROGRAMS -# scripts/my_python_script -# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) - -## Mark executables and/or libraries for installation -# install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node -# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) - -## Mark cpp header files for installation -# install(DIRECTORY include/${PROJECT_NAME}/ -# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} -# FILES_MATCHING PATTERN "*.h" -# PATTERN ".svn" EXCLUDE -# ) - -## Mark other files for installation (e.g. launch and bag files, etc.) -# install(FILES -# # myfile1 -# # myfile2 -# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} -# ) - -############# -## Testing ## -############# - -## Add gtest based cpp test target and link libraries -# catkin_add_gtest(${PROJECT_NAME}-test test/test_op3_bringup.cpp) -# if(TARGET ${PROJECT_NAME}-test) -# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) -# endif() - -## Add folders to be run by python nosetests -# catkin_add_nosetests(test) +################################################################################ +# Test +################################################################################ \ No newline at end of file diff --git a/op3_bringup/package.xml b/op3_bringup/package.xml index 21f0087..a185bc1 100644 --- a/op3_bringup/package.xml +++ b/op3_bringup/package.xml @@ -1,59 +1,22 @@ op3_bringup - 0.0.0 - The op3_bringup package - - - - - robotis - - - - - - TODO - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 0.0.1 + + This package is a demo for first time users. + There is an example in the demo where you can run and visualize the robot. + + Apache 2.0 + Kayman + Pyo + http://wiki.ros.org/op3_bringup + http://emanual.robotis.com/docs/en/platform/op3/introduction/ + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo/issues catkin - - - - - - - + op3_manager + usb_cam + joint_state_publisher + robot_state_publisher + rviz From 454128b19917dd950ab0299078e43000baeaac75 Mon Sep 17 00:00:00 2001 From: Kayman Date: Wed, 18 Apr 2018 11:32:12 +0900 Subject: [PATCH 49/66] changed the package name from ball_detector to op3_ball_detector --- .../CHANGELOG.rst | 0 .../CMakeLists.txt | 2 +- .../cfg/DetectorParams.cfg | 2 +- .../cfg/DetectorParamsBlue.cfg | 2 +- .../cfg/DetectorParamsRed.cfg | 2 +- .../config/ball_detector_params.yaml | 0 .../config/ball_detector_params_default.yaml | 0 .../config/ball_detector_params_op.yaml | 0 .../op3_ball_detector}/ball_detector.h | 23 +++++++++---------- .../op3_ball_detector}/ball_detector_config.h | 0 .../launch/ball_detector.launch | 4 ++-- .../launch/ball_detector_from_usb_cam.launch | 2 +- .../launch/ball_detector_from_uvc.launch | 2 +- .../msg/BallDetectorParams.msg | 0 .../msg/CircleSetStamped.msg | 0 .../package.xml | 2 +- .../rviz/ball_detector.rviz | 0 .../src/ball_detector.cpp | 14 +++++------ .../src/ball_detector_node.cpp | 2 +- .../srv/GetParameters.srv | 0 .../srv/SetParameters.srv | 0 op3_demo/CMakeLists.txt | 4 ++-- op3_demo/include/op3_demo/ball_follower.h | 2 +- op3_demo/include/op3_demo/ball_tracker.h | 4 ++-- op3_demo/launch/demo.launch | 2 +- op3_demo/launch/self_test.launch | 2 +- op3_demo/package.xml | 2 +- op3_demo/src/soccer/ball_tracker.cpp | 2 +- 28 files changed, 37 insertions(+), 38 deletions(-) rename {ball_detector => op3_ball_detector}/CHANGELOG.rst (100%) rename {ball_detector => op3_ball_detector}/CMakeLists.txt (99%) rename {ball_detector => op3_ball_detector}/cfg/DetectorParams.cfg (98%) mode change 100755 => 100644 rename {ball_detector => op3_ball_detector}/cfg/DetectorParamsBlue.cfg (98%) rename {ball_detector => op3_ball_detector}/cfg/DetectorParamsRed.cfg (98%) rename {ball_detector => op3_ball_detector}/config/ball_detector_params.yaml (100%) rename {ball_detector => op3_ball_detector}/config/ball_detector_params_default.yaml (100%) rename {ball_detector => op3_ball_detector}/config/ball_detector_params_op.yaml (100%) rename {ball_detector/include/ball_detector => op3_ball_detector/include/op3_ball_detector}/ball_detector.h (83%) rename {ball_detector/include/ball_detector => op3_ball_detector/include/op3_ball_detector}/ball_detector_config.h (100%) rename {ball_detector => op3_ball_detector}/launch/ball_detector.launch (64%) rename {ball_detector => op3_ball_detector}/launch/ball_detector_from_usb_cam.launch (94%) rename {ball_detector => op3_ball_detector}/launch/ball_detector_from_uvc.launch (92%) rename {ball_detector => op3_ball_detector}/msg/BallDetectorParams.msg (100%) rename {ball_detector => op3_ball_detector}/msg/CircleSetStamped.msg (100%) rename {ball_detector => op3_ball_detector}/package.xml (97%) rename {ball_detector => op3_ball_detector}/rviz/ball_detector.rviz (100%) rename {ball_detector => op3_ball_detector}/src/ball_detector.cpp (97%) rename {ball_detector => op3_ball_detector}/src/ball_detector_node.cpp (96%) rename {ball_detector => op3_ball_detector}/srv/GetParameters.srv (100%) rename {ball_detector => op3_ball_detector}/srv/SetParameters.srv (100%) diff --git a/ball_detector/CHANGELOG.rst b/op3_ball_detector/CHANGELOG.rst similarity index 100% rename from ball_detector/CHANGELOG.rst rename to op3_ball_detector/CHANGELOG.rst diff --git a/ball_detector/CMakeLists.txt b/op3_ball_detector/CMakeLists.txt similarity index 99% rename from ball_detector/CMakeLists.txt rename to op3_ball_detector/CMakeLists.txt index d2acc5e..d57df9d 100644 --- a/ball_detector/CMakeLists.txt +++ b/op3_ball_detector/CMakeLists.txt @@ -2,7 +2,7 @@ # Set minimum required version of cmake, project name and compile options ################################################################################ cmake_minimum_required(VERSION 2.8.3) -project(ball_detector) +project(op3_ball_detector) ################################################################################ # Find catkin packages and libraries for catkin and system dependencies diff --git a/ball_detector/cfg/DetectorParams.cfg b/op3_ball_detector/cfg/DetectorParams.cfg old mode 100755 new mode 100644 similarity index 98% rename from ball_detector/cfg/DetectorParams.cfg rename to op3_ball_detector/cfg/DetectorParams.cfg index 1d3e29c..e627907 --- a/ball_detector/cfg/DetectorParams.cfg +++ b/op3_ball_detector/cfg/DetectorParams.cfg @@ -1,5 +1,5 @@ #!/usr/bin/env python -PACKAGE='ball_detector' +PACKAGE='op3_ball_detector' from dynamic_reconfigure.parameter_generator_catkin import * diff --git a/ball_detector/cfg/DetectorParamsBlue.cfg b/op3_ball_detector/cfg/DetectorParamsBlue.cfg similarity index 98% rename from ball_detector/cfg/DetectorParamsBlue.cfg rename to op3_ball_detector/cfg/DetectorParamsBlue.cfg index b9bd967..391e99f 100644 --- a/ball_detector/cfg/DetectorParamsBlue.cfg +++ b/op3_ball_detector/cfg/DetectorParamsBlue.cfg @@ -1,5 +1,5 @@ #!/usr/bin/env python -PACKAGE='ball_detector' +PACKAGE='op3_ball_detector' from dynamic_reconfigure.parameter_generator_catkin import * diff --git a/ball_detector/cfg/DetectorParamsRed.cfg b/op3_ball_detector/cfg/DetectorParamsRed.cfg similarity index 98% rename from ball_detector/cfg/DetectorParamsRed.cfg rename to op3_ball_detector/cfg/DetectorParamsRed.cfg index 79d08a2..6d8dbad 100644 --- a/ball_detector/cfg/DetectorParamsRed.cfg +++ b/op3_ball_detector/cfg/DetectorParamsRed.cfg @@ -1,5 +1,5 @@ #!/usr/bin/env python -PACKAGE='ball_detector' +PACKAGE='op3_ball_detector' from dynamic_reconfigure.parameter_generator_catkin import * diff --git a/ball_detector/config/ball_detector_params.yaml b/op3_ball_detector/config/ball_detector_params.yaml similarity index 100% rename from ball_detector/config/ball_detector_params.yaml rename to op3_ball_detector/config/ball_detector_params.yaml diff --git a/ball_detector/config/ball_detector_params_default.yaml b/op3_ball_detector/config/ball_detector_params_default.yaml similarity index 100% rename from ball_detector/config/ball_detector_params_default.yaml rename to op3_ball_detector/config/ball_detector_params_default.yaml diff --git a/ball_detector/config/ball_detector_params_op.yaml b/op3_ball_detector/config/ball_detector_params_op.yaml similarity index 100% rename from ball_detector/config/ball_detector_params_op.yaml rename to op3_ball_detector/config/ball_detector_params_op.yaml diff --git a/ball_detector/include/ball_detector/ball_detector.h b/op3_ball_detector/include/op3_ball_detector/ball_detector.h similarity index 83% rename from ball_detector/include/ball_detector/ball_detector.h rename to op3_ball_detector/include/op3_ball_detector/ball_detector.h index 96a9981..c429222 100644 --- a/ball_detector/include/ball_detector/ball_detector.h +++ b/op3_ball_detector/include/op3_ball_detector/ball_detector.h @@ -36,13 +36,12 @@ #include #include -#include "ball_detector/DetectorParamsConfig.h" +#include "op3_ball_detector/ball_detector_config.h" -#include "ball_detector/ball_detector_config.h" - -#include "ball_detector/CircleSetStamped.h" -#include "ball_detector/GetParameters.h" -#include "ball_detector/SetParameters.h" +#include "op3_ball_detector/DetectorParamsConfig.h" +#include "op3_ball_detector/CircleSetStamped.h" +#include "op3_ball_detector/GetParameters.h" +#include "op3_ball_detector/SetParameters.h" namespace robotis_op { @@ -74,12 +73,12 @@ class BallDetector //callbacks to camera info subscription void cameraInfoCallback(const sensor_msgs::CameraInfo & msg); - void dynParamCallback(ball_detector::DetectorParamsConfig &config, uint32_t level); + void dynParamCallback(op3_ball_detector::DetectorParamsConfig &config, uint32_t level); void enableCallback(const std_msgs::Bool::ConstPtr &msg); void paramCommandCallback(const std_msgs::String::ConstPtr &msg); - bool setParamCallback(ball_detector::SetParameters::Request &req, ball_detector::SetParameters::Response &res); - bool getParamCallback(ball_detector::GetParameters::Request &req, ball_detector::GetParameters::Response &res); + bool setParamCallback(op3_ball_detector::SetParameters::Request &req, op3_ball_detector::SetParameters::Response &res); + bool getParamCallback(op3_ball_detector::GetParameters::Request &req, op3_ball_detector::GetParameters::Response &res); void resetParameter(); void publishParam(); @@ -115,7 +114,7 @@ class BallDetector int not_found_count_; //circle set publisher - ball_detector::CircleSetStamped circles_msg_; + op3_ball_detector::CircleSetStamped circles_msg_; ros::Publisher circles_pub_; //camera info subscriber @@ -157,8 +156,8 @@ class BallDetector cv::Mat in_image_; cv::Mat out_image_; - dynamic_reconfigure::Server param_server_; - dynamic_reconfigure::Server::CallbackType callback_fnc_; + dynamic_reconfigure::Server param_server_; + dynamic_reconfigure::Server::CallbackType callback_fnc_; }; } // namespace robotis_op diff --git a/ball_detector/include/ball_detector/ball_detector_config.h b/op3_ball_detector/include/op3_ball_detector/ball_detector_config.h similarity index 100% rename from ball_detector/include/ball_detector/ball_detector_config.h rename to op3_ball_detector/include/op3_ball_detector/ball_detector_config.h diff --git a/ball_detector/launch/ball_detector.launch b/op3_ball_detector/launch/ball_detector.launch similarity index 64% rename from ball_detector/launch/ball_detector.launch rename to op3_ball_detector/launch/ball_detector.launch index 34a12ba..35f57d9 100644 --- a/ball_detector/launch/ball_detector.launch +++ b/op3_ball_detector/launch/ball_detector.launch @@ -1,9 +1,9 @@ - + - + diff --git a/ball_detector/launch/ball_detector_from_usb_cam.launch b/op3_ball_detector/launch/ball_detector_from_usb_cam.launch similarity index 94% rename from ball_detector/launch/ball_detector_from_usb_cam.launch rename to op3_ball_detector/launch/ball_detector_from_usb_cam.launch index 44ecad5..7f3ae14 100644 --- a/ball_detector/launch/ball_detector_from_usb_cam.launch +++ b/op3_ball_detector/launch/ball_detector_from_usb_cam.launch @@ -23,5 +23,5 @@ - + diff --git a/ball_detector/launch/ball_detector_from_uvc.launch b/op3_ball_detector/launch/ball_detector_from_uvc.launch similarity index 92% rename from ball_detector/launch/ball_detector_from_uvc.launch rename to op3_ball_detector/launch/ball_detector_from_uvc.launch index 5946129..636caaa 100644 --- a/ball_detector/launch/ball_detector_from_uvc.launch +++ b/op3_ball_detector/launch/ball_detector_from_uvc.launch @@ -25,6 +25,6 @@ - + diff --git a/ball_detector/msg/BallDetectorParams.msg b/op3_ball_detector/msg/BallDetectorParams.msg similarity index 100% rename from ball_detector/msg/BallDetectorParams.msg rename to op3_ball_detector/msg/BallDetectorParams.msg diff --git a/ball_detector/msg/CircleSetStamped.msg b/op3_ball_detector/msg/CircleSetStamped.msg similarity index 100% rename from ball_detector/msg/CircleSetStamped.msg rename to op3_ball_detector/msg/CircleSetStamped.msg diff --git a/ball_detector/package.xml b/op3_ball_detector/package.xml similarity index 97% rename from ball_detector/package.xml rename to op3_ball_detector/package.xml index 2f2acf3..a65ef7f 100644 --- a/ball_detector/package.xml +++ b/op3_ball_detector/package.xml @@ -1,6 +1,6 @@ - ball_detector + op3_ball_detector 0.1.0 This package implements a circle-like shape detector of the input image. diff --git a/ball_detector/rviz/ball_detector.rviz b/op3_ball_detector/rviz/ball_detector.rviz similarity index 100% rename from ball_detector/rviz/ball_detector.rviz rename to op3_ball_detector/rviz/ball_detector.rviz diff --git a/ball_detector/src/ball_detector.cpp b/op3_ball_detector/src/ball_detector.cpp similarity index 97% rename from ball_detector/src/ball_detector.cpp rename to op3_ball_detector/src/ball_detector.cpp index 7dbba3c..871a1e8 100644 --- a/ball_detector/src/ball_detector.cpp +++ b/op3_ball_detector/src/ball_detector.cpp @@ -18,7 +18,7 @@ #include -#include "ball_detector/ball_detector.h" +#include "op3_ball_detector/ball_detector.h" namespace robotis_op { @@ -71,7 +71,7 @@ BallDetector::BallDetector() //sets publishers image_pub_ = it_.advertise("image_out", 100); - circles_pub_ = nh_.advertise("circle_set", 100); + circles_pub_ = nh_.advertise("circle_set", 100); camera_info_pub_ = nh_.advertise("camera_info", 100); //sets subscribers @@ -87,7 +87,7 @@ BallDetector::BallDetector() param_server_.setCallback(callback_fnc_); // web setting - param_pub_ = nh_.advertise("current_params", 1); + param_pub_ = nh_.advertise("current_params", 1); param_command_sub_ = nh_.subscribe("param_command", 1, &BallDetector::paramCommandCallback, this); set_param_client_ = nh_.advertiseService("set_param", &BallDetector::setParamCallback, this); get_param_client_ = nh_.advertiseService("get_param", &BallDetector::getParamCallback, this); @@ -233,7 +233,7 @@ void BallDetector::imageCallback(const sensor_msgs::ImageConstPtr & msg) return; } -void BallDetector::dynParamCallback(ball_detector::DetectorParamsConfig &config, uint32_t level) +void BallDetector::dynParamCallback(op3_ball_detector::DetectorParamsConfig &config, uint32_t level) { params_config_.gaussian_blur_size = config.gaussian_blur_size; params_config_.gaussian_blur_sigma = config.gaussian_blur_sigma; @@ -296,7 +296,7 @@ void BallDetector::paramCommandCallback(const std_msgs::String::ConstPtr &msg) } } -bool BallDetector::setParamCallback(ball_detector::SetParameters::Request &req, ball_detector::SetParameters::Response &res) +bool BallDetector::setParamCallback(op3_ball_detector::SetParameters::Request &req, op3_ball_detector::SetParameters::Response &res) { params_config_.gaussian_blur_size = req.params.gaussian_blur_size; params_config_.gaussian_blur_sigma = req.params.gaussian_blur_sigma; @@ -321,7 +321,7 @@ bool BallDetector::setParamCallback(ball_detector::SetParameters::Request &req, return true; } -bool BallDetector:: getParamCallback(ball_detector::GetParameters::Request &req, ball_detector::GetParameters::Response &res) +bool BallDetector:: getParamCallback(op3_ball_detector::GetParameters::Request &req, op3_ball_detector::GetParameters::Response &res) { res.returns.gaussian_blur_size = params_config_.gaussian_blur_size; res.returns.gaussian_blur_sigma = params_config_.gaussian_blur_sigma; @@ -396,7 +396,7 @@ void BallDetector::resetParameter() void BallDetector::publishParam() { - ball_detector::BallDetectorParams params; + op3_ball_detector::BallDetectorParams params; params.gaussian_blur_size = params_config_.gaussian_blur_size; params.gaussian_blur_sigma = params_config_.gaussian_blur_sigma; diff --git a/ball_detector/src/ball_detector_node.cpp b/op3_ball_detector/src/ball_detector_node.cpp similarity index 96% rename from ball_detector/src/ball_detector_node.cpp rename to op3_ball_detector/src/ball_detector_node.cpp index 5560d56..117127d 100644 --- a/ball_detector/src/ball_detector_node.cpp +++ b/op3_ball_detector/src/ball_detector_node.cpp @@ -16,7 +16,7 @@ /* Author: Kayman Jung */ -#include "ball_detector/ball_detector.h" +#include "op3_ball_detector/ball_detector.h" //node main int main(int argc, char **argv) diff --git a/ball_detector/srv/GetParameters.srv b/op3_ball_detector/srv/GetParameters.srv similarity index 100% rename from ball_detector/srv/GetParameters.srv rename to op3_ball_detector/srv/GetParameters.srv diff --git a/ball_detector/srv/SetParameters.srv b/op3_ball_detector/srv/SetParameters.srv similarity index 100% rename from ball_detector/srv/SetParameters.srv rename to op3_ball_detector/srv/SetParameters.srv diff --git a/op3_demo/CMakeLists.txt b/op3_demo/CMakeLists.txt index 42445a0..381f872 100644 --- a/op3_demo/CMakeLists.txt +++ b/op3_demo/CMakeLists.txt @@ -18,7 +18,7 @@ find_package(catkin REQUIRED COMPONENTS op3_action_module_msgs cmake_modules robotis_math - ball_detector + op3_ball_detector ) find_package(Boost REQUIRED COMPONENTS thread) @@ -71,7 +71,7 @@ catkin_package( op3_action_module_msgs cmake_modules robotis_math - ball_detector + op3_ball_detector DEPENDS Boost EIGEN3 ) diff --git a/op3_demo/include/op3_demo/ball_follower.h b/op3_demo/include/op3_demo/ball_follower.h index 7ec1d46..283d842 100644 --- a/op3_demo/include/op3_demo/ball_follower.h +++ b/op3_demo/include/op3_demo/ball_follower.h @@ -29,7 +29,7 @@ #include #include "robotis_controller_msgs/JointCtrlModule.h" -#include "ball_detector/CircleSetStamped.h" +#include "op3_ball_detector/CircleSetStamped.h" #include "op3_walking_module_msgs/WalkingParam.h" #include "op3_walking_module_msgs/GetWalkingParam.h" diff --git a/op3_demo/include/op3_demo/ball_tracker.h b/op3_demo/include/op3_demo/ball_tracker.h index 5461494..e5fe9ff 100644 --- a/op3_demo/include/op3_demo/ball_tracker.h +++ b/op3_demo/include/op3_demo/ball_tracker.h @@ -29,7 +29,7 @@ #include #include "robotis_controller_msgs/JointCtrlModule.h" -#include "ball_detector/CircleSetStamped.h" +#include "op3_ball_detector/CircleSetStamped.h" #include "op3_walking_module_msgs/WalkingParam.h" #include "op3_walking_module_msgs/GetWalkingParam.h" @@ -79,7 +79,7 @@ protected: const int WAITING_THRESHOLD; const bool DEBUG_PRINT; - void ballPositionCallback(const ball_detector::CircleSetStamped::ConstPtr &msg); + void ballPositionCallback(const op3_ball_detector::CircleSetStamped::ConstPtr &msg); void ballTrackerCommandCallback(const std_msgs::String::ConstPtr &msg); void publishHeadJoint(double pan, double tilt); void scanBall(); diff --git a/op3_demo/launch/demo.launch b/op3_demo/launch/demo.launch index 2b5281c..d6d26b4 100644 --- a/op3_demo/launch/demo.launch +++ b/op3_demo/launch/demo.launch @@ -4,7 +4,7 @@ - + diff --git a/op3_demo/launch/self_test.launch b/op3_demo/launch/self_test.launch index 623004e..00c9acb 100644 --- a/op3_demo/launch/self_test.launch +++ b/op3_demo/launch/self_test.launch @@ -5,7 +5,7 @@ - + diff --git a/op3_demo/package.xml b/op3_demo/package.xml index 85bd36e..1a0785c 100644 --- a/op3_demo/package.xml +++ b/op3_demo/package.xml @@ -24,7 +24,7 @@ op3_action_module_msgs cmake_modules robotis_math - ball_detector + op3_ball_detector boost eigen yaml-cpp diff --git a/op3_demo/src/soccer/ball_tracker.cpp b/op3_demo/src/soccer/ball_tracker.cpp index 355a21c..e90bb54 100644 --- a/op3_demo/src/soccer/ball_tracker.cpp +++ b/op3_demo/src/soccer/ball_tracker.cpp @@ -59,7 +59,7 @@ BallTracker::~BallTracker() } -void BallTracker::ballPositionCallback(const ball_detector::CircleSetStamped::ConstPtr &msg) +void BallTracker::ballPositionCallback(const op3_ball_detector::CircleSetStamped::ConstPtr &msg) { for (int idx = 0; idx < msg->circles.size(); idx++) { From fd57628bc573a6a1aed14c84986df049ef0d13c6 Mon Sep 17 00:00:00 2001 From: Kayman Date: Wed, 18 Apr 2018 11:37:01 +0900 Subject: [PATCH 50/66] fixed package.xml --- robotis_op3_demo/package.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robotis_op3_demo/package.xml b/robotis_op3_demo/package.xml index 7cf0810..c49be14 100644 --- a/robotis_op3_demo/package.xml +++ b/robotis_op3_demo/package.xml @@ -13,7 +13,7 @@ https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo/issues catkin - ball_detector + op3_ball_detector op3_demo From 13a60409cc93d6da2d3b837484c52c0206b5dcc2 Mon Sep 17 00:00:00 2001 From: Kayman Date: Wed, 18 Apr 2018 13:11:08 +0900 Subject: [PATCH 51/66] Changing file permissions --- op3_ball_detector/cfg/DetectorParams.cfg | 0 op3_ball_detector/cfg/DetectorParamsBlue.cfg | 0 op3_ball_detector/cfg/DetectorParamsRed.cfg | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 op3_ball_detector/cfg/DetectorParams.cfg mode change 100644 => 100755 op3_ball_detector/cfg/DetectorParamsBlue.cfg mode change 100644 => 100755 op3_ball_detector/cfg/DetectorParamsRed.cfg diff --git a/op3_ball_detector/cfg/DetectorParams.cfg b/op3_ball_detector/cfg/DetectorParams.cfg old mode 100644 new mode 100755 diff --git a/op3_ball_detector/cfg/DetectorParamsBlue.cfg b/op3_ball_detector/cfg/DetectorParamsBlue.cfg old mode 100644 new mode 100755 diff --git a/op3_ball_detector/cfg/DetectorParamsRed.cfg b/op3_ball_detector/cfg/DetectorParamsRed.cfg old mode 100644 new mode 100755 From de45d7d080c848ae1d79e506ed18089fc8669de5 Mon Sep 17 00:00:00 2001 From: Kayman Date: Thu, 19 Apr 2018 11:45:31 +0900 Subject: [PATCH 52/66] changed rviz config file --- op3_bringup/rviz/op3_bringup.rviz | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/op3_bringup/rviz/op3_bringup.rviz b/op3_bringup/rviz/op3_bringup.rviz index 7a00cca..cffe130 100644 --- a/op3_bringup/rviz/op3_bringup.rviz +++ b/op3_bringup/rviz/op3_bringup.rviz @@ -281,6 +281,15 @@ Visualization Manager: {} Update Interval: 0 Value: true + - Alpha: 0.200000003 + Class: rviz_plugin_tutorials/Imu + Color: 204; 51; 204 + Enabled: true + History Length: 1 + Name: Imu + Topic: /robotis/open_cr/imu + Unreliable: false + Value: true Enabled: true Global Options: Background Color: 48; 48; 48 @@ -306,7 +315,7 @@ Visualization Manager: Views: Current: Class: rviz/Orbit - Distance: 1.0015856 + Distance: 2.32116389 Enable Stereo Rendering: Stereo Eye Separation: 0.0599999987 Stereo Focal Distance: 1 @@ -321,10 +330,10 @@ Visualization Manager: Invert Z Axis: false Name: Current View Near Clip Distance: 0.00999999978 - Pitch: 0.425398082 + Pitch: 0.275397927 Target Frame: Value: Orbit (rviz) - Yaw: 5.78858471 + Yaw: 5.68858385 Saved: ~ Window Geometry: Displays: From a493ea40fe95834d8063b10e60e9ab71d3e92647 Mon Sep 17 00:00:00 2001 From: Pyo Date: Thu, 19 Apr 2018 21:37:13 +0900 Subject: [PATCH 53/66] updated the CHANGELOG and version to release binary packages --- .travis.yml | 8 +++++--- README.md | 4 +++- op3_ball_detector/CHANGELOG.rst | 12 ++++++------ op3_ball_detector/CMakeLists.txt | 1 - op3_ball_detector/package.xml | 2 +- op3_bringup/CHANGELOG.rst | 11 +++++++++++ op3_bringup/package.xml | 3 ++- op3_demo/CHANGELOG.rst | 8 ++++---- robotis_op3_demo/CHANGELOG.rst | 8 +++++--- robotis_op3_demo/package.xml | 3 ++- 10 files changed, 39 insertions(+), 21 deletions(-) create mode 100644 op3_bringup/CHANGELOG.rst diff --git a/.travis.yml b/.travis.yml index 9316a80..1e400fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,11 @@ notifications: - pyo@robotis.com env: matrix: -# - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian + - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=ubuntu OS_CODE_NAME=xenial # - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=debian OS_CODE_NAME=jessie - - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=file $ROSINSTALL_FILENAME=".robotis_op3_demo.rosinstall" +# - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=file OS_NAME=ubuntu OS_CODE_NAME=xenial $ROSINSTALL_FILENAME=".robotis_op3_demo.rosinstall" +# - ROS_DISTRO=melodic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=ubuntu OS_CODE_NAME=bionic +# - ROS_DISTRO=melodic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=debian OS_CODE_NAME=stretch branches: only: - master @@ -30,4 +32,4 @@ install: - git clone https://github.com/ros-industrial/industrial_ci.git .ci_config script: - source .ci_config/travis.sh - + \ No newline at end of file diff --git a/README.md b/README.md index 51875b9..cd34832 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,8 @@ ## Wiki for robotis_op3_demo Packages - http://wiki.ros.org/robotis_op3_demo (metapackage) -- http://wiki.ros.org/ball_detector +- http://wiki.ros.org/op3_ball_detector +- http://wiki.ros.org/op3_bringup - http://wiki.ros.org/op3_demo ## Open Source related to ROBOTIS OP3 @@ -30,5 +31,6 @@ ## Documents and Videos related to ROBOTIS OP3 - [ROBOTIS e-Manual for ROBOTIS OP3](http://emanual.robotis.com/docs/en/platform/op3/introduction/) +- [ROBOTIS e-Manual for ROBOTIS THORMANG3](http://emanual.robotis.com/docs/en/platform/thormang3/introduction/) - [ROBOTIS e-Manual for ROBOTIS Framework](http://emanual.robotis.com/docs/en/software/robotis_framework_packages/) - [ROBOTIS e-Manual for Dynamixel SDK](http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/) diff --git a/op3_ball_detector/CHANGELOG.rst b/op3_ball_detector/CHANGELOG.rst index 5d3764c..d00eb27 100644 --- a/op3_ball_detector/CHANGELOG.rst +++ b/op3_ball_detector/CHANGELOG.rst @@ -1,12 +1,12 @@ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Changelog for package ball_detector -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package op3_ball_detector +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -0.1.0 (2018-03-30) +0.1.0 (2018-04-19) ------------------ -* first release +* first release for ROS Kinetic * added launch files in order to move the camera setting to op3_camera_setting package * added missing package in find_package() * refacoring to release -* splited repositoryfrom ROBOTIS-OP3 +* split repositoryfrom ROBOTIS-OP3 * Contributors: Kayman, Zerom, Pyo diff --git a/op3_ball_detector/CMakeLists.txt b/op3_ball_detector/CMakeLists.txt index d57df9d..9a1693d 100644 --- a/op3_ball_detector/CMakeLists.txt +++ b/op3_ball_detector/CMakeLists.txt @@ -73,7 +73,6 @@ generate_dynamic_reconfigure_options( cfg/DetectorParams.cfg ) - ################################################################################ # Declare catkin specific configuration to be passed to dependent projects ################################################################################## diff --git a/op3_ball_detector/package.xml b/op3_ball_detector/package.xml index a65ef7f..d507794 100644 --- a/op3_ball_detector/package.xml +++ b/op3_ball_detector/package.xml @@ -11,7 +11,7 @@ Kayman Zerom Pyo - http://wiki.ros.org/ball_detector + http://wiki.ros.org/op3_ball_detector http://emanual.robotis.com/docs/en/platform/op3/introduction/ https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo/issues diff --git a/op3_bringup/CHANGELOG.rst b/op3_bringup/CHANGELOG.rst new file mode 100644 index 0000000..bcad6b2 --- /dev/null +++ b/op3_bringup/CHANGELOG.rst @@ -0,0 +1,11 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package op3_bringup +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +0.1.0 (2018-04-19) +------------------ +* first release for ROS Kinetic +* updated CMakeLists.txt and package.xml of op3_bringup +* changed rviz config file +* refacoring to release +* Contributors: Kayman, Pyo diff --git a/op3_bringup/package.xml b/op3_bringup/package.xml index a185bc1..3161ae0 100644 --- a/op3_bringup/package.xml +++ b/op3_bringup/package.xml @@ -1,7 +1,7 @@ op3_bringup - 0.0.1 + 0.1.0 This package is a demo for first time users. There is an example in the demo where you can run and visualize the robot. @@ -15,6 +15,7 @@ https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo/issues catkin op3_manager + op3_description usb_cam joint_state_publisher robot_state_publisher diff --git a/op3_demo/CHANGELOG.rst b/op3_demo/CHANGELOG.rst index 62ead4d..c28f305 100644 --- a/op3_demo/CHANGELOG.rst +++ b/op3_demo/CHANGELOG.rst @@ -2,11 +2,11 @@ Changelog for package op3_demo ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -0.1.0 (2018-03-30) +0.1.0 (2018-04-19) ------------------ -* first release +* first release for ROS Kinetic * added launch files in order to move the camera setting to op3_camera_setting package * added missing package in find_package() * refacoring to release -* splited repositoryfrom ROBOTIS-OP3 -* Contributors: Kayman, Yoshimaru Tanaka, Pyo +* split repositoryfrom ROBOTIS-OP3 +* Contributors: Kayman, Zerom, Yoshimaru Tanaka, Pyo diff --git a/robotis_op3_demo/CHANGELOG.rst b/robotis_op3_demo/CHANGELOG.rst index b65724b..c761f4a 100644 --- a/robotis_op3_demo/CHANGELOG.rst +++ b/robotis_op3_demo/CHANGELOG.rst @@ -2,11 +2,13 @@ Changelog for package robotis_op3_demo ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -0.1.0 (2018-03-30) +0.1.0 (2018-04-19) ------------------ -* first release +* first release for ROS Kinetic * added launch files in order to move the camera setting to op3_camera_setting package * added missing package in find_package() +* updated CMakeLists.txt and package.xml of op3_bringup +* changed rviz config file * refacoring to release -* splited repositoryfrom ROBOTIS-OP3 +* split repositoryfrom ROBOTIS-OP3 * Contributors: Kayman, Zerom, Yoshimaru Tanaka, Pyo diff --git a/robotis_op3_demo/package.xml b/robotis_op3_demo/package.xml index c49be14..83e6185 100644 --- a/robotis_op3_demo/package.xml +++ b/robotis_op3_demo/package.xml @@ -12,8 +12,9 @@ http://emanual.robotis.com/docs/en/platform/op3/introduction/ https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo/issues - catkin + catkin op3_ball_detector + op3_bringup op3_demo From b3fc340166660595c1683583a6dfcc829a62d27e Mon Sep 17 00:00:00 2001 From: Kayman Date: Mon, 23 Apr 2018 17:30:34 +0900 Subject: [PATCH 54/66] added proto type of demo for read-write tutorial --- op3_read_write_demo/CMakeLists.txt | 80 ++++++++ op3_read_write_demo/package.xml | 24 +++ op3_read_write_demo/src/read_write.cpp | 245 +++++++++++++++++++++++++ 3 files changed, 349 insertions(+) create mode 100644 op3_read_write_demo/CMakeLists.txt create mode 100644 op3_read_write_demo/package.xml create mode 100644 op3_read_write_demo/src/read_write.cpp diff --git a/op3_read_write_demo/CMakeLists.txt b/op3_read_write_demo/CMakeLists.txt new file mode 100644 index 0000000..dd81d23 --- /dev/null +++ b/op3_read_write_demo/CMakeLists.txt @@ -0,0 +1,80 @@ +################################################################################ +# Set minimum required version of cmake, project name and compile options +################################################################################ +cmake_minimum_required(VERSION 2.8.3) +project(op3_read_write_demo) + +################################################################################ +# Find catkin packages and libraries for catkin and system dependencies +################################################################################ +find_package(catkin REQUIRED COMPONENTS + robotis_controller_msgs + roscpp + sensor_msgs + std_msgs +) + +################################################################################ +# Setup for python modules and scripts +################################################################################ + +################################################################################ +# Declare ROS messages, services and actions +################################################################################ + +################################################################################ +# Declare ROS dynamic reconfigure parameters +################################################################################ + +################################################################################ +# Declare catkin specific configuration to be passed to dependent projects +################################################################################ +catkin_package( + INCLUDE_DIRS include + CATKIN_DEPENDS + roscpp + robotis_controller_msgs + roscpp + sensor_msgs + std_msgs +) + +################################################################################ +# Build +################################################################################ +include_directories( + include + ${catkin_INCLUDE_DIRS} +) + +add_executable(read_write + src/read_write.cpp +) + +add_dependencies(read_write + ${${PROJECT_NAME}_EXPORTED_TARGETS} + ${catkin_EXPORTED_TARGETS} +) + +target_link_libraries(read_write + ${catkin_LIBRARIES} +) + +################################################################################ +# Install +################################################################################ +install(TARGETS read_write + RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +) + +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} +) + +install(DIRECTORY data launch list + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + +################################################################################ +# Test +################################################################################ diff --git a/op3_read_write_demo/package.xml b/op3_read_write_demo/package.xml new file mode 100644 index 0000000..28accf9 --- /dev/null +++ b/op3_read_write_demo/package.xml @@ -0,0 +1,24 @@ + + + op3_read_write_demo + 0.0.1 + + The op3_read_write_demo package + + + + Apache 2.0 + Kayman + Pyo + http://wiki.ros.org/op3_demo + http://emanual.robotis.com/docs/en/platform/op3/introduction/ + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo + https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo/issues + catkin + roscpp + std_msgs + sensor_msgs + robotis_controller_msgs + op3_manager + + \ No newline at end of file diff --git a/op3_read_write_demo/src/read_write.cpp b/op3_read_write_demo/src/read_write.cpp new file mode 100644 index 0000000..e893ca6 --- /dev/null +++ b/op3_read_write_demo/src/read_write.cpp @@ -0,0 +1,245 @@ +/******************************************************************************* +* Copyright 2017 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ + +/* Author: Kayman Jung */ + +#include +#include +#include + +#include "robotis_controller_msgs/SetModule.h" +#include "robotis_controller_msgs/SyncWriteItem.h" + +void buttonHandlerCallback(const std_msgs::String::ConstPtr& msg); +void jointstatesCallback(const sensor_msgs::JointState::ConstPtr& msg); +void setModule(const std::string& module_name); +void goInitPose(); +void setLED(int led); +bool checkManagerRunning(std::string& manager_name); +void torqueOnAll(); +void torqueOff(const std::string& body_side); + +const int SPIN_RATE = 30; +const bool DEBUG_PRINT = false; + +ros::Publisher init_pose_pub; +//ros::Publisher play_sound_pub; +ros::Publisher sync_write_pub; +ros::Publisher dxl_torque_pub; +ros::Publisher write_joint_pub; +ros::Subscriber buttuon_sub; +ros::Subscriber read_joint_sub; + +ros::ServiceClient set_joint_module_client; + +//std::string default_mp3_path = ""; +bool demo_ready = false; + +//node main +int main(int argc, char **argv) +{ + //init ros + ros::init(argc, argv, "read_write"); + + ros::NodeHandle nh(ros::this_node::getName()); + + init_pose_pub = nh.advertise("/robotis/base/ini_pose", 0); + // play_sound_pub = nh.advertise("/play_sound_file", 0); + sync_write_pub = nh.advertise("/robotis/sync_write_item", 0); + dxl_torque_pub = nh.advertise("/robotis/dxl_torque", 0); + write_joint_pub = nh.advertise("/robotis/direct_control/set_joint_states", 0); + + read_joint_sub = nh.subscribe("/robotis/present_joint_ctrl_modules", 1, jointstatesCallback); + buttuon_sub = nh.subscribe("/robotis/open_cr/button", 1, buttonHandlerCallback); + + // default_mp3_path = ros::package::getPath("op3_demo") + "/data/mp3/"; + + // service + set_joint_module_client = nh.serviceClient("/robotis/set_present_ctrl_modules"); + + ros::start(); + + //set node loop rate + ros::Rate loop_rate(SPIN_RATE); + + // wait for starting of manager + std::string manager_name = "/op3_manager"; + while (ros::ok()) + { + ros::Duration(1.0).sleep(); + + if (checkManagerRunning(manager_name) == true) + { + break; + ROS_INFO_COND(DEBUG_PRINT, "Succeed to connect"); + } + ROS_WARN("Waiting for op3 manager"); + } + + // init procedure + goInitPose(); + + // turn on R/G/B LED [0x01 | 0x02 | 0x04] + setLED(0x01); + + // change the module to direct_control for demo + setModule("direct_control"); + + // torque off : right arm + torqueOff("right"); + + demo_ready = true; + + //node loop + while (ros::ok()) + { + // process + + + //execute pending callbacks + ros::spinOnce(); + + //relax to fit output rate + loop_rate.sleep(); + } + + //exit program + return 0; +} + +void buttonHandlerCallback(const std_msgs::String::ConstPtr& msg) +{ + // if (msg->data == "mode_long") + // else if (msg->data == "user_long") + // if (msg->data == "start") + // else if (msg->data == "mode") +} + +void jointstatesCallback(const sensor_msgs::JointState::ConstPtr& msg) +{ + if(demo_ready == false) + return; + + sensor_msgs::JointState write_msg; + for(int ix = 0; ix < msg->name.size(); ix++) + { + std::string joint_name = msg->name[ix]; + double joint_position = msg->position[ix]; + + if(joint_name == "r_sho_pitch") + { + write_msg.name.push_back("r_sho_pitch"); + write_msg.position.push_back(-joint_position); + } + if(joint_name == "r_sho_roll") + { + write_msg.name.push_back("l_sho_roll"); + write_msg.position.push_back(-joint_position); + } + if(joint_name == "r_el") + { + write_msg.name.push_back("l_el"); + write_msg.position.push_back(-joint_position); + } + } + + write_joint_pub.publish(write_msg); +} + +void goInitPose() +{ + std_msgs::String init_msg; + init_msg.data = "ini_pose"; + + init_pose_pub.publish(init_msg); +} + +void setLED(int led) +{ + robotis_controller_msgs::SyncWriteItem syncwrite_msg; + syncwrite_msg.item_name = "LED"; + syncwrite_msg.joint_name.push_back("open-cr"); + syncwrite_msg.value.push_back(led); + + sync_write_pub.publish(syncwrite_msg); +} + +bool checkManagerRunning(std::string& manager_name) +{ + std::vector node_list; + ros::master::getNodes(node_list); + + for (unsigned int node_list_idx = 0; node_list_idx < node_list.size(); node_list_idx++) + { + if (node_list[node_list_idx] == manager_name) + return true; + } + + ROS_ERROR("Can't find op3_manager"); + return false; +} + +void setModule(const std::string& module_name) +{ + robotis_controller_msgs::SetModule set_module_srv; + set_module_srv.request.module_name = module_name; + + if (set_joint_module_client.call(set_module_srv) == false) + { + ROS_ERROR("Failed to set module"); + return; + } + + return ; +} + +void torqueOnAll() +{ + std_msgs::String check_msg; + check_msg.data = "check"; + + dxl_torque_pub.publish(check_msg); +} + +void torqueOff(const std::string& body_side) +{ + robotis_controller_msgs::SyncWriteItem syncwrite_msg; + int torque_value = 0; + syncwrite_msg.item_name = "torque_enable"; + + if(body_side == "right") + { + syncwrite_msg.joint_name.push_back("r_sho_pitch"); + syncwrite_msg.value.push_back(torque_value); + syncwrite_msg.joint_name.push_back("r_sho_roll"); + syncwrite_msg.value.push_back(torque_value); + syncwrite_msg.joint_name.push_back("r_el"); + syncwrite_msg.value.push_back(torque_value); + } + else if(body_side == "left") + { + syncwrite_msg.joint_name.push_back("l_sho_pitch"); + syncwrite_msg.value.push_back(torque_value); + syncwrite_msg.joint_name.push_back("l_sho_roll"); + syncwrite_msg.value.push_back(torque_value); + syncwrite_msg.joint_name.push_back("l_el"); + syncwrite_msg.value.push_back(torque_value); + } + else + return; + + sync_write_pub.publish(syncwrite_msg); +} From 88db47aa8870e2e12255f4abca707b4ef1aa923d Mon Sep 17 00:00:00 2001 From: Kayman Date: Mon, 23 Apr 2018 17:36:17 +0900 Subject: [PATCH 55/66] added check point for debuging --- op3_read_write_demo/src/read_write.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/op3_read_write_demo/src/read_write.cpp b/op3_read_write_demo/src/read_write.cpp index e893ca6..673dba7 100644 --- a/op3_read_write_demo/src/read_write.cpp +++ b/op3_read_write_demo/src/read_write.cpp @@ -101,7 +101,7 @@ int main(int argc, char **argv) // torque off : right arm torqueOff("right"); - demo_ready = true; +// demo_ready = true; //node loop while (ros::ok()) @@ -124,8 +124,10 @@ void buttonHandlerCallback(const std_msgs::String::ConstPtr& msg) { // if (msg->data == "mode_long") // else if (msg->data == "user_long") - // if (msg->data == "start") - // else if (msg->data == "mode") + if (msg->data == "start") + demo_ready = false; + else if (msg->data == "mode") + demo_ready = true; } void jointstatesCallback(const sensor_msgs::JointState::ConstPtr& msg) From 5a6c1c61b21e3faf4c5866a902e3cb54a3fce1e7 Mon Sep 17 00:00:00 2001 From: Kayman Date: Thu, 26 Apr 2018 16:20:24 +0900 Subject: [PATCH 56/66] added op3_read_write.launch modified op3_read_write --- op3_read_write_demo/CMakeLists.txt | 2 +- .../launch/op3_read_write.launch | 24 ++++ op3_read_write_demo/src/read_write.cpp | 116 +++++++++++++----- 3 files changed, 111 insertions(+), 31 deletions(-) create mode 100644 op3_read_write_demo/launch/op3_read_write.launch diff --git a/op3_read_write_demo/CMakeLists.txt b/op3_read_write_demo/CMakeLists.txt index dd81d23..e89ed48 100644 --- a/op3_read_write_demo/CMakeLists.txt +++ b/op3_read_write_demo/CMakeLists.txt @@ -71,7 +71,7 @@ install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} ) -install(DIRECTORY data launch list +install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) diff --git a/op3_read_write_demo/launch/op3_read_write.launch b/op3_read_write_demo/launch/op3_read_write.launch new file mode 100644 index 0000000..1089706 --- /dev/null +++ b/op3_read_write_demo/launch/op3_read_write.launch @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/op3_read_write_demo/src/read_write.cpp b/op3_read_write_demo/src/read_write.cpp index 673dba7..9511c22 100644 --- a/op3_read_write_demo/src/read_write.cpp +++ b/op3_read_write_demo/src/read_write.cpp @@ -25,6 +25,7 @@ void buttonHandlerCallback(const std_msgs::String::ConstPtr& msg); void jointstatesCallback(const sensor_msgs::JointState::ConstPtr& msg); +void readyToDemo(); void setModule(const std::string& module_name); void goInitPose(); void setLED(int led); @@ -32,20 +33,27 @@ bool checkManagerRunning(std::string& manager_name); void torqueOnAll(); void torqueOff(const std::string& body_side); +enum ControlModule +{ + None = 0, + Framework = 1, + DirectControlModule = 2, +}; + const int SPIN_RATE = 30; const bool DEBUG_PRINT = false; ros::Publisher init_pose_pub; -//ros::Publisher play_sound_pub; ros::Publisher sync_write_pub; ros::Publisher dxl_torque_pub; ros::Publisher write_joint_pub; +ros::Publisher write_joint_pub2; ros::Subscriber buttuon_sub; ros::Subscriber read_joint_sub; ros::ServiceClient set_joint_module_client; -//std::string default_mp3_path = ""; +int control_module = None; bool demo_ready = false; //node main @@ -57,16 +65,14 @@ int main(int argc, char **argv) ros::NodeHandle nh(ros::this_node::getName()); init_pose_pub = nh.advertise("/robotis/base/ini_pose", 0); - // play_sound_pub = nh.advertise("/play_sound_file", 0); sync_write_pub = nh.advertise("/robotis/sync_write_item", 0); dxl_torque_pub = nh.advertise("/robotis/dxl_torque", 0); - write_joint_pub = nh.advertise("/robotis/direct_control/set_joint_states", 0); + write_joint_pub = nh.advertise("/robotis/set_joint_states", 0); + write_joint_pub2 = nh.advertise("/robotis/direct_control/set_joint_states", 0); - read_joint_sub = nh.subscribe("/robotis/present_joint_ctrl_modules", 1, jointstatesCallback); + read_joint_sub = nh.subscribe("/robotis/present_joint_states", 1, jointstatesCallback); buttuon_sub = nh.subscribe("/robotis/open_cr/button", 1, buttonHandlerCallback); - // default_mp3_path = ros::package::getPath("op3_demo") + "/data/mp3/"; - // service set_joint_module_client = nh.serviceClient("/robotis/set_present_ctrl_modules"); @@ -75,7 +81,7 @@ int main(int argc, char **argv) //set node loop rate ros::Rate loop_rate(SPIN_RATE); - // wait for starting of manager + // wait for starting of op3_manager std::string manager_name = "/op3_manager"; while (ros::ok()) { @@ -89,26 +95,13 @@ int main(int argc, char **argv) ROS_WARN("Waiting for op3 manager"); } - // init procedure - goInitPose(); - - // turn on R/G/B LED [0x01 | 0x02 | 0x04] - setLED(0x01); - - // change the module to direct_control for demo - setModule("direct_control"); - - // torque off : right arm - torqueOff("right"); - -// demo_ready = true; + readyToDemo(); //node loop while (ros::ok()) { // process - //execute pending callbacks ros::spinOnce(); @@ -122,20 +115,36 @@ int main(int argc, char **argv) void buttonHandlerCallback(const std_msgs::String::ConstPtr& msg) { - // if (msg->data == "mode_long") - // else if (msg->data == "user_long") - if (msg->data == "start") - demo_ready = false; - else if (msg->data == "mode") - demo_ready = true; + // starting demo using robotis_controller + if (msg->data == "start") + { + control_module = Framework; + ROS_INFO("Button : start | Framework"); + readyToDemo(); + } + // starting demo using direct_control_module + else if (msg->data == "mode") + { + control_module = DirectControlModule; + ROS_INFO("Button : mode | Direct control module"); + readyToDemo(); + } + // torque on all joints of ROBOTIS-OP3 + else if (msg->data == "user") + { + torqueOnAll(); + control_module = None; + } } void jointstatesCallback(const sensor_msgs::JointState::ConstPtr& msg) { - if(demo_ready == false) + if(control_module == None) return; sensor_msgs::JointState write_msg; + write_msg.header = msg->header; + for(int ix = 0; ix < msg->name.size(); ix++) { std::string joint_name = msg->name[ix]; @@ -144,21 +153,68 @@ void jointstatesCallback(const sensor_msgs::JointState::ConstPtr& msg) if(joint_name == "r_sho_pitch") { write_msg.name.push_back("r_sho_pitch"); + write_msg.position.push_back(joint_position); + write_msg.name.push_back("l_sho_pitch"); write_msg.position.push_back(-joint_position); } if(joint_name == "r_sho_roll") { + write_msg.name.push_back("r_sho_roll"); + write_msg.position.push_back(joint_position); write_msg.name.push_back("l_sho_roll"); write_msg.position.push_back(-joint_position); } if(joint_name == "r_el") { + write_msg.name.push_back("r_el"); + write_msg.position.push_back(joint_position); write_msg.name.push_back("l_el"); write_msg.position.push_back(-joint_position); } } - write_joint_pub.publish(write_msg); + if(control_module == Framework) + write_joint_pub.publish(write_msg); + else if(control_module == DirectControlModule) + write_joint_pub2.publish(write_msg); +} + +void readyToDemo() +{ + ROS_INFO("Start Read-Write Demo"); + // turn off LED + setLED(0x04); + + torqueOnAll(); + ROS_INFO("Torque on All joints"); + + // send message for going init posture + goInitPose(); + ROS_INFO("Go Init pose"); + + // wait while ROBOTIS-OP3 goes to the init posture. + ros::Duration(4.0).sleep(); + + // turn on R/G/B LED [0x01 | 0x02 | 0x04] + setLED(control_module); + + // change the module for demo + if(control_module == Framework) + { + setModule("none"); + ROS_INFO("Change module to none"); + } + else if(control_module == DirectControlModule) + { + setModule("direct_control_module"); + ROS_INFO("Change module to direct_control_module"); + } + else + return; + + // torque off : right arm + torqueOff("right"); + ROS_INFO("Torque off"); } void goInitPose() From f9e2bded67d7050c68228b2e5990686fe2b77507 Mon Sep 17 00:00:00 2001 From: Kayman Date: Thu, 26 Apr 2018 16:23:48 +0900 Subject: [PATCH 57/66] deleted include in op3_read_write_demo/CMakeLists.txt --- op3_read_write_demo/CMakeLists.txt | 3 +-- op3_read_write_demo/package.xml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/op3_read_write_demo/CMakeLists.txt b/op3_read_write_demo/CMakeLists.txt index e89ed48..5198ec8 100644 --- a/op3_read_write_demo/CMakeLists.txt +++ b/op3_read_write_demo/CMakeLists.txt @@ -30,7 +30,7 @@ find_package(catkin REQUIRED COMPONENTS # Declare catkin specific configuration to be passed to dependent projects ################################################################################ catkin_package( - INCLUDE_DIRS include + INCLUDE_DIRS CATKIN_DEPENDS roscpp robotis_controller_msgs @@ -43,7 +43,6 @@ catkin_package( # Build ################################################################################ include_directories( - include ${catkin_INCLUDE_DIRS} ) diff --git a/op3_read_write_demo/package.xml b/op3_read_write_demo/package.xml index 28accf9..3d7c712 100644 --- a/op3_read_write_demo/package.xml +++ b/op3_read_write_demo/package.xml @@ -5,7 +5,6 @@ The op3_read_write_demo package - Apache 2.0 Kayman @@ -21,4 +20,4 @@ robotis_controller_msgs op3_manager - \ No newline at end of file + From 2f3311d5eaad2dbf5955b3afaaa40ba593309bca Mon Sep 17 00:00:00 2001 From: Kayman Date: Thu, 3 May 2018 16:05:02 +0900 Subject: [PATCH 58/66] added comments --- .../launch/op3_read_write.launch | 32 +++++++++---------- op3_read_write_demo/src/read_write.cpp | 2 ++ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/op3_read_write_demo/launch/op3_read_write.launch b/op3_read_write_demo/launch/op3_read_write.launch index 1089706..01217ff 100644 --- a/op3_read_write_demo/launch/op3_read_write.launch +++ b/op3_read_write_demo/launch/op3_read_write.launch @@ -1,24 +1,24 @@ - - + + - - - - + + + + - - + + - - - - + + + + - - + + - - + + diff --git a/op3_read_write_demo/src/read_write.cpp b/op3_read_write_demo/src/read_write.cpp index 9511c22..2f2dc66 100644 --- a/op3_read_write_demo/src/read_write.cpp +++ b/op3_read_write_demo/src/read_write.cpp @@ -150,6 +150,7 @@ void jointstatesCallback(const sensor_msgs::JointState::ConstPtr& msg) std::string joint_name = msg->name[ix]; double joint_position = msg->position[ix]; + // mirror and copy joint angles from right to left if(joint_name == "r_sho_pitch") { write_msg.name.push_back("r_sho_pitch"); @@ -173,6 +174,7 @@ void jointstatesCallback(const sensor_msgs::JointState::ConstPtr& msg) } } + // publish a message to set the joint angles if(control_module == Framework) write_joint_pub.publish(write_msg); else if(control_module == DirectControlModule) From 1e7f6b247909460c603c18cf698018108e741711 Mon Sep 17 00:00:00 2001 From: Kayman Date: Thu, 3 May 2018 16:19:26 +0900 Subject: [PATCH 59/66] fixed wrong CMakeLists.txt --- op3_read_write_demo/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/op3_read_write_demo/CMakeLists.txt b/op3_read_write_demo/CMakeLists.txt index 5198ec8..8826d03 100644 --- a/op3_read_write_demo/CMakeLists.txt +++ b/op3_read_write_demo/CMakeLists.txt @@ -66,10 +66,6 @@ install(TARGETS read_write RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} ) -install(DIRECTORY include/${PROJECT_NAME}/ - DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} -) - install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) From 6c28e17e48bb208de09cb9f8d69b5ffc14d13321 Mon Sep 17 00:00:00 2001 From: Kayman Date: Thu, 31 May 2018 10:23:31 +0900 Subject: [PATCH 60/66] changed a button to operate --- op3_read_write_demo/src/read_write.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/op3_read_write_demo/src/read_write.cpp b/op3_read_write_demo/src/read_write.cpp index 2f2dc66..1b87dc4 100644 --- a/op3_read_write_demo/src/read_write.cpp +++ b/op3_read_write_demo/src/read_write.cpp @@ -36,8 +36,8 @@ void torqueOff(const std::string& body_side); enum ControlModule { None = 0, - Framework = 1, - DirectControlModule = 2, + DirectControlModule = 1, + Framework = 2, }; const int SPIN_RATE = 30; @@ -116,17 +116,17 @@ int main(int argc, char **argv) void buttonHandlerCallback(const std_msgs::String::ConstPtr& msg) { // starting demo using robotis_controller - if (msg->data == "start") + if (msg->data == "mode") { control_module = Framework; - ROS_INFO("Button : start | Framework"); + ROS_INFO("Button : mode | Framework"); readyToDemo(); } // starting demo using direct_control_module - else if (msg->data == "mode") + else if (msg->data == "start") { control_module = DirectControlModule; - ROS_INFO("Button : mode | Direct control module"); + ROS_INFO("Button : start | Direct control module"); readyToDemo(); } // torque on all joints of ROBOTIS-OP3 From 58a62c0721c4d1bd7404475a5423679d1fc4520f Mon Sep 17 00:00:00 2001 From: Kayman Date: Fri, 7 Sep 2018 10:42:05 +0900 Subject: [PATCH 61/66] added a process thread for ball tracking --- op3_demo/include/op3_demo/soccer_demo.h | 4 +- op3_demo/src/soccer/soccer_demo.cpp | 52 +++++++++++++++++++++---- 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/op3_demo/include/op3_demo/soccer_demo.h b/op3_demo/include/op3_demo/soccer_demo.h index a771eda..f5f6df4 100644 --- a/op3_demo/include/op3_demo/soccer_demo.h +++ b/op3_demo/include/op3_demo/soccer_demo.h @@ -72,6 +72,7 @@ class SoccerDemo : public OPDemo void processThread(); void callbackThread(); + void trackingThread(); void setBodyModuleToDemo(const std::string &body_module, bool with_head_control = true); void setModuleToDemo(const std::string &module_name); @@ -114,7 +115,8 @@ class SoccerDemo : public OPDemo bool is_grass_; int wait_count_; - bool on_following_ball_; + bool on_following_ball_; + bool on_tracking_ball_; bool restart_soccer_; bool start_following_; bool stop_following_; diff --git a/op3_demo/src/soccer/soccer_demo.cpp b/op3_demo/src/soccer/soccer_demo.cpp index 0565152..fd50c70 100644 --- a/op3_demo/src/soccer/soccer_demo.cpp +++ b/op3_demo/src/soccer/soccer_demo.cpp @@ -28,6 +28,7 @@ SoccerDemo::SoccerDemo() DEBUG_PRINT(false), wait_count_(0), on_following_ball_(false), + on_tracking_ball_(false), restart_soccer_(false), start_following_(false), stop_following_(false), @@ -48,6 +49,7 @@ SoccerDemo::SoccerDemo() boost::thread queue_thread = boost::thread(boost::bind(&SoccerDemo::callbackThread, this)); boost::thread process_thread = boost::thread(boost::bind(&SoccerDemo::processThread, this)); + boost::thread tracking_thread = boost::thread(boost::bind(&SoccerDemo::trackingThread, this)); is_grass_ = nh.param("grass_demo", false); } @@ -73,6 +75,7 @@ void SoccerDemo::setDemoDisable() enable_ = false; wait_count_ = 0; on_following_ball_ = false; + on_tracking_ball_ = false; restart_soccer_ = false; start_following_ = false; stop_following_ = false; @@ -87,9 +90,9 @@ void SoccerDemo::process() return; // ball tracking - int tracking_status; + int tracking_status = tracking_status_; - tracking_status = ball_tracker_.processTracking(); + //tracking_status = ball_tracker_.processTracking(); // check to start if (start_following_ == true) @@ -120,22 +123,22 @@ void SoccerDemo::process() { case BallTracker::Found: ball_follower_.processFollowing(ball_tracker_.getPanOfBall(), ball_tracker_.getTiltOfBall(), 0.0); - if(tracking_status_ != tracking_status) - setRGBLED(0x1F, 0x1F, 0x1F); +// if(tracking_status_ != tracking_status) +// setRGBLED(0x1F, 0x1F, 0x1F); break; case BallTracker::NotFound: ball_follower_.waitFollowing(); - if(tracking_status_ != tracking_status) - setRGBLED(0, 0, 0); +// if(tracking_status_ != tracking_status) +// setRGBLED(0, 0, 0); break; default: break; } - if(tracking_status != tracking_status_) - tracking_status_ = tracking_status; +// if(tracking_status != tracking_status_) +// tracking_status_ = tracking_status; } // check fallen states @@ -219,6 +222,37 @@ void SoccerDemo::callbackThread() } } +void SoccerDemo::trackingThread() +{ + if(enable_ == false || on_tracking_ball_ == false) + return; + + // ball tracking + int tracking_status; + + tracking_status = ball_tracker_.processTracking(); + + // set led + switch(tracking_status) + { + case BallTracker::Found: + if(tracking_status_ != tracking_status) + setRGBLED(0x1F, 0x1F, 0x1F); + break; + + case BallTracker::NotFound: + if(tracking_status_ != tracking_status) + setRGBLED(0, 0, 0); + break; + + default: + break; + } + + if(tracking_status != tracking_status_) + tracking_status_ = tracking_status; +} + void SoccerDemo::setBodyModuleToDemo(const std::string &body_module, bool with_head_control) { robotis_controller_msgs::JointCtrlModule control_msg; @@ -436,6 +470,7 @@ void SoccerDemo::startSoccerMode() ROS_INFO("Start Soccer Demo"); on_following_ball_ = true; + on_tracking_ball_ = true; start_following_ = true; } @@ -443,6 +478,7 @@ void SoccerDemo::stopSoccerMode() { ROS_INFO("Stop Soccer Demo"); on_following_ball_ = false; + on_tracking_ball_ = false; stop_following_ = true; } From 879366f23e2ea588ebadcf711fe1a0f9d10a2eeb Mon Sep 17 00:00:00 2001 From: Kayman Date: Fri, 7 Sep 2018 11:54:15 +0900 Subject: [PATCH 62/66] fixed bug in tracking thread --- op3_demo/src/soccer/soccer_demo.cpp | 66 +++++++++++++++++------------ 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/op3_demo/src/soccer/soccer_demo.cpp b/op3_demo/src/soccer/soccer_demo.cpp index fd50c70..557ea00 100644 --- a/op3_demo/src/soccer/soccer_demo.cpp +++ b/op3_demo/src/soccer/soccer_demo.cpp @@ -123,22 +123,22 @@ void SoccerDemo::process() { case BallTracker::Found: ball_follower_.processFollowing(ball_tracker_.getPanOfBall(), ball_tracker_.getTiltOfBall(), 0.0); -// if(tracking_status_ != tracking_status) -// setRGBLED(0x1F, 0x1F, 0x1F); + // if(tracking_status_ != tracking_status) + // setRGBLED(0x1F, 0x1F, 0x1F); break; case BallTracker::NotFound: ball_follower_.waitFollowing(); -// if(tracking_status_ != tracking_status) -// setRGBLED(0, 0, 0); + // if(tracking_status_ != tracking_status) + // setRGBLED(0, 0, 0); break; default: break; } -// if(tracking_status != tracking_status_) -// tracking_status_ = tracking_status; + // if(tracking_status != tracking_status_) + // tracking_status_ = tracking_status; } // check fallen states @@ -224,33 +224,47 @@ void SoccerDemo::callbackThread() void SoccerDemo::trackingThread() { - if(enable_ == false || on_tracking_ball_ == false) - return; - // ball tracking - int tracking_status; + //set node loop rate + ros::Rate loop_rate(SPIN_RATE); - tracking_status = ball_tracker_.processTracking(); + ball_tracker_.startTracking(); - // set led - switch(tracking_status) + //node loop + while (ros::ok()) { - case BallTracker::Found: - if(tracking_status_ != tracking_status) - setRGBLED(0x1F, 0x1F, 0x1F); - break; - case BallTracker::NotFound: - if(tracking_status_ != tracking_status) - setRGBLED(0, 0, 0); - break; + if(enable_ == false || on_tracking_ball_ == false) + return; - default: - break; + // ball tracking + int tracking_status; + + tracking_status = ball_tracker_.processTracking(); + + // set led + switch(tracking_status) + { + case BallTracker::Found: + if(tracking_status_ != tracking_status) + setRGBLED(0x1F, 0x1F, 0x1F); + break; + + case BallTracker::NotFound: + if(tracking_status_ != tracking_status) + setRGBLED(0, 0, 0); + break; + + default: + break; + } + + if(tracking_status != tracking_status_) + tracking_status_ = tracking_status; + + //relax to fit output rate + loop_rate.sleep(); } - - if(tracking_status != tracking_status_) - tracking_status_ = tracking_status; } void SoccerDemo::setBodyModuleToDemo(const std::string &body_module, bool with_head_control) From 169cfefccae270daa72aac66b815b06954c9b0a9 Mon Sep 17 00:00:00 2001 From: Kayman Date: Fri, 7 Sep 2018 13:16:54 +0900 Subject: [PATCH 63/66] fixed bug. --- op3_demo/src/soccer/soccer_demo.cpp | 47 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/op3_demo/src/soccer/soccer_demo.cpp b/op3_demo/src/soccer/soccer_demo.cpp index 557ea00..6f8d99e 100644 --- a/op3_demo/src/soccer/soccer_demo.cpp +++ b/op3_demo/src/soccer/soccer_demo.cpp @@ -234,34 +234,33 @@ void SoccerDemo::trackingThread() while (ros::ok()) { - if(enable_ == false || on_tracking_ball_ == false) - return; - - // ball tracking - int tracking_status; - - tracking_status = ball_tracker_.processTracking(); - - // set led - switch(tracking_status) + if(enable_ == true && on_tracking_ball_ == true) { - case BallTracker::Found: - if(tracking_status_ != tracking_status) - setRGBLED(0x1F, 0x1F, 0x1F); - break; + // ball tracking + int tracking_status; - case BallTracker::NotFound: - if(tracking_status_ != tracking_status) - setRGBLED(0, 0, 0); - break; + tracking_status = ball_tracker_.processTracking(); - default: - break; + // set led + switch(tracking_status) + { + case BallTracker::Found: + if(tracking_status_ != tracking_status) + setRGBLED(0x1F, 0x1F, 0x1F); + break; + + case BallTracker::NotFound: + if(tracking_status_ != tracking_status) + setRGBLED(0, 0, 0); + break; + + default: + break; + } + + if(tracking_status != tracking_status_) + tracking_status_ = tracking_status; } - - if(tracking_status != tracking_status_) - tracking_status_ = tracking_status; - //relax to fit output rate loop_rate.sleep(); } From ebaf7f9e2193a56a31b58c1593b19e847f061116 Mon Sep 17 00:00:00 2001 From: Kayman Date: Fri, 7 Sep 2018 17:36:15 +0900 Subject: [PATCH 64/66] added that a head goes init when OP3 stop tracking the ball. --- op3_demo/include/op3_demo/ball_tracker.h | 2 ++ op3_demo/src/soccer/ball_tracker.cpp | 18 +++++++++++++++++- op3_demo/src/soccer/soccer_demo.cpp | 4 ++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/op3_demo/include/op3_demo/ball_tracker.h b/op3_demo/include/op3_demo/ball_tracker.h index e5fe9ff..383c809 100644 --- a/op3_demo/include/op3_demo/ball_tracker.h +++ b/op3_demo/include/op3_demo/ball_tracker.h @@ -56,6 +56,7 @@ public: void stopTracking(); void setUsingHeadScan(bool use_scan); + void goInit(); double getPanOfBall() { @@ -89,6 +90,7 @@ protected: //image publisher/subscriber ros::Publisher module_control_pub_; + ros::Publisher head_joint_offset_pub_; ros::Publisher head_joint_pub_; ros::Publisher head_scan_pub_; diff --git a/op3_demo/src/soccer/ball_tracker.cpp b/op3_demo/src/soccer/ball_tracker.cpp index e90bb54..a1706ad 100644 --- a/op3_demo/src/soccer/ball_tracker.cpp +++ b/op3_demo/src/soccer/ball_tracker.cpp @@ -45,7 +45,8 @@ BallTracker::BallTracker() ROS_INFO_STREAM("Ball tracking Gain : " << p_gain_ << ", " << i_gain_ << ", " << d_gain_); - head_joint_pub_ = nh_.advertise("/robotis/head_control/set_joint_states_offset", 0); + head_joint_offset_pub_ = nh_.advertise("/robotis/head_control/set_joint_states_offset", 0); + head_joint_pub_ = nh_.advertise("/robotis/head_control/set_joint_states", 0); head_scan_pub_ = nh_.advertise("/robotis/head_control/scan_command", 0); // error_pub_ = nh_.advertise("/ball_tracker/errors", 0); @@ -97,6 +98,8 @@ void BallTracker::startTracking() void BallTracker::stopTracking() { + goInit(); + on_tracking_ = false; ROS_INFO_COND(DEBUG_PRINT, "Stop Ball tracking"); @@ -246,6 +249,19 @@ void BallTracker::publishHeadJoint(double pan, double tilt) head_angle_msg.position.push_back(pan); head_angle_msg.position.push_back(tilt); + head_joint_offset_pub_.publish(head_angle_msg); +} + +void BallTracker::goInit() +{ + sensor_msgs::JointState head_angle_msg; + + head_angle_msg.name.push_back("head_pan"); + head_angle_msg.name.push_back("head_tilt"); + + head_angle_msg.position.push_back(0.0); + head_angle_msg.position.push_back(0.0); + head_joint_pub_.publish(head_angle_msg); } diff --git a/op3_demo/src/soccer/soccer_demo.cpp b/op3_demo/src/soccer/soccer_demo.cpp index 6f8d99e..cf5db3c 100644 --- a/op3_demo/src/soccer/soccer_demo.cpp +++ b/op3_demo/src/soccer/soccer_demo.cpp @@ -497,12 +497,12 @@ void SoccerDemo::stopSoccerMode() void SoccerDemo::handleKick(int ball_position) { - usleep(1000 * 1000); + usleep(1500 * 1000); // change to motion module setModuleToDemo("action_module"); - usleep(1500 * 1000); + //usleep(1500 * 1000); if (handleFallen(stand_state_) == true || enable_ == false) return; From bcd6463683da84edc2181661223132d0a4028895 Mon Sep 17 00:00:00 2001 From: Kayman Date: Fri, 28 Sep 2018 16:34:51 +0900 Subject: [PATCH 65/66] changed a header file - added index(out of range) to ball status. --- op3_demo/include/op3_demo/ball_follower.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/op3_demo/include/op3_demo/ball_follower.h b/op3_demo/include/op3_demo/ball_follower.h index 283d842..29857db 100644 --- a/op3_demo/include/op3_demo/ball_follower.h +++ b/op3_demo/include/op3_demo/ball_follower.h @@ -43,8 +43,9 @@ class BallFollower enum { NotFound = 0, - OnRight = 1, - OnLeft = 2, + OutOfRange = 1, + OnRight = 2, + OnLeft = 3, }; BallFollower(); From 285c79b95a163d4b9fd790e608827883ddb0d21f Mon Sep 17 00:00:00 2001 From: Kayman Date: Fri, 28 Sep 2018 17:31:22 +0900 Subject: [PATCH 66/66] deleted unused code. --- op3_demo/src/soccer/soccer_demo.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/op3_demo/src/soccer/soccer_demo.cpp b/op3_demo/src/soccer/soccer_demo.cpp index cf5db3c..37e2c3f 100644 --- a/op3_demo/src/soccer/soccer_demo.cpp +++ b/op3_demo/src/soccer/soccer_demo.cpp @@ -89,11 +89,6 @@ void SoccerDemo::process() if(enable_ == false) return; - // ball tracking - int tracking_status = tracking_status_; - - //tracking_status = ball_tracker_.processTracking(); - // check to start if (start_following_ == true) { @@ -119,26 +114,19 @@ void SoccerDemo::process() // ball following if (on_following_ball_ == true) { - switch(tracking_status) + switch(tracking_status_) { case BallTracker::Found: ball_follower_.processFollowing(ball_tracker_.getPanOfBall(), ball_tracker_.getTiltOfBall(), 0.0); - // if(tracking_status_ != tracking_status) - // setRGBLED(0x1F, 0x1F, 0x1F); break; case BallTracker::NotFound: ball_follower_.waitFollowing(); - // if(tracking_status_ != tracking_status) - // setRGBLED(0, 0, 0); break; default: break; } - - // if(tracking_status != tracking_status_) - // tracking_status_ = tracking_status; } // check fallen states