Skip to content

Commit 4d0cab5

Browse files
committed
remove support for catkin
1 parent a027b84 commit 4d0cab5

File tree

9 files changed

+4
-155
lines changed

9 files changed

+4
-155
lines changed

.github/workflows/ros1.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,6 @@ if ( ament_cmake_FOUND )
8282
message(STATUS "BehaviorTree is being built using AMENT.")
8383
message(STATUS "------------------------------------------")
8484
include(cmake/ament_build.cmake)
85-
86-
elseif( CATKIN_DEVEL_PREFIX OR CATKIN_BUILD_BINARY_PACKAGE)
87-
88-
add_definitions( -DUSING_ROS )
89-
message(STATUS "------------------------------------------")
90-
message(STATUS "BehaviorTree is being built using CATKIN.")
91-
message(STATUS "------------------------------------------")
92-
include(cmake/catkin_build.cmake)
93-
set(catkin_FOUND TRUE)
9485
else()
9586
message(STATUS "------------------------------------------")
9687
message(STATUS "BehaviorTree is being built with conan.")

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ If you are looking for a more fancy graphical user interface (and I know you do)
5555

5656
Three build systems are supported:
5757

58-
- **catkin**, if you use ROS
5958
- **colcon (ament)**, if you use ROS2
6059
- **conan** otherwise (Linux/Windows).
6160
- **straight cmake** if you want to be personally responsible for dependencies :)

cmake/catkin_build.cmake

Lines changed: 0 additions & 40 deletions
This file was deleted.

include/behaviortree_cpp/bt_factory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ class BehaviorTreeFactory
281281
* @throws If not compiled with ROS support or if the library cannot load for any reason
282282
*
283283
*/
284-
void registerFromROSPlugins();
284+
[[deprecated]] void registerFromROSPlugins();
285285

286286
/**
287287
* @brief registerBehaviorTreeFromFile.

package.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
<build_depend>ros_environment</build_depend>
1616

17-
<buildtool_depend condition="$ROS_VERSION == 1">catkin</buildtool_depend>
18-
<depend condition="$ROS_VERSION == 1">roslib</depend>
1917

2018
<buildtool_depend condition="$ROS_VERSION == 2">ament_cmake</buildtool_depend>
2119
<depend condition="$ROS_VERSION == 2">rclcpp</depend>
@@ -27,7 +25,6 @@
2725
<test_depend condition="$ROS_VERSION == 2">ament_cmake_gtest</test_depend>
2826

2927
<export>
30-
<build_type condition="$ROS_VERSION == 1">catkin</build_type>
3128
<build_type condition="$ROS_VERSION == 2">ament_cmake</build_type>
3229
</export>
3330

src/bt_factory.cpp

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
#include "behaviortree_cpp/xml_parsing.h"
1818
#include "wildcards/wildcards.hpp"
1919

20-
#ifdef USING_ROS
21-
#include <ros/package.h>
22-
#endif
23-
2420
namespace BT
2521
{
2622

@@ -196,66 +192,12 @@ void BehaviorTreeFactory::registerFromPlugin(const std::string& file_path)
196192
}
197193
}
198194

199-
#ifdef USING_ROS
200-
201-
#ifdef _WIN32
202-
const char os_pathsep(';'); // NOLINT
203-
#else
204-
const char os_pathsep(':'); // NOLINT
205-
#endif
206-
207-
// This function is a copy from the one in class_loader_imp.hpp in ROS pluginlib
208-
// package, licensed under BSD.
209-
// https://github.com/ros/pluginlib
210-
std::vector<std::string> getCatkinLibraryPaths()
211-
{
212-
std::vector<std::string> lib_paths;
213-
const char* env = std::getenv("CMAKE_PREFIX_PATH");
214-
if(env)
215-
{
216-
const std::string env_catkin_prefix_paths(env);
217-
std::vector<BT::StringView> catkin_prefix_paths =
218-
splitString(env_catkin_prefix_paths, os_pathsep);
219-
for(BT::StringView catkin_prefix_path : catkin_prefix_paths)
220-
{
221-
std::filesystem::path path(static_cast<std::string>(catkin_prefix_path));
222-
std::filesystem::path lib("lib");
223-
lib_paths.push_back((path / lib).string());
224-
}
225-
}
226-
return lib_paths;
227-
}
228-
229-
void BehaviorTreeFactory::registerFromROSPlugins()
230-
{
231-
std::vector<std::string> plugins;
232-
ros::package::getPlugins("behaviortree_cpp", "bt_lib_plugin", plugins, true);
233-
std::vector<std::string> catkin_lib_paths = getCatkinLibraryPaths();
234-
235-
for(const auto& plugin : plugins)
236-
{
237-
auto filename = std::filesystem::path(plugin + BT::SharedLibrary::suffix());
238-
for(const auto& lib_path : catkin_lib_paths)
239-
{
240-
const auto full_path = std::filesystem::path(lib_path) / filename;
241-
if(std::filesystem::exists(full_path))
242-
{
243-
std::cout << "Registering ROS plugins from " << full_path.string() << std::endl;
244-
registerFromPlugin(full_path.string());
245-
break;
246-
}
247-
}
248-
}
249-
}
250-
#else
251-
252195
void BehaviorTreeFactory::registerFromROSPlugins()
253196
{
254197
throw RuntimeError("Using attribute [ros_pkg] in <include>, but this library was "
255198
"compiled without ROS support. Recompile the BehaviorTree.CPP "
256199
"using catkin");
257200
}
258-
#endif
259201

260202
void BehaviorTreeFactory::registerBehaviorTreeFromFile(
261203
const std::filesystem::path& filename)

src/xml_parsing.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
#include "tinyxml2/tinyxml2.h"
3737
#include <filesystem>
3838

39-
#ifdef USING_ROS
40-
#include <ros/package.h>
41-
#endif
42-
4339
#ifdef USING_ROS2
4440
#include <ament_index_cpp/get_package_share_directory.hpp>
4541
#endif
@@ -283,9 +279,7 @@ void XMLParser::PImpl::loadDocImpl(XMLDocument* doc, bool add_includes)
283279
else
284280
{
285281
std::string ros_pkg_path;
286-
#ifdef USING_ROS
287-
ros_pkg_path = ros::package::getPath(ros_pkg_relative_path);
288-
#elif defined USING_ROS2
282+
#if defined USING_ROS2
289283
ros_pkg_path =
290284
ament_index_cpp::get_package_share_directory(ros_pkg_relative_path);
291285
#else

tests/CMakeLists.txt

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,44 +33,27 @@ set(BT_TESTS
3333
test_helper.hpp
3434
)
3535

36-
set(TEST_DEPENDENCIES
37-
${BTCPP_LIBRARY}
38-
foonathan::lexy
39-
bt_sample_nodes)
40-
4136
if(ament_cmake_FOUND)
4237

4338
find_package(ament_cmake_gtest REQUIRED)
4439

4540
ament_add_gtest(behaviortree_cpp_test ${BT_TESTS})
46-
target_link_libraries(behaviortree_cpp_test
47-
${TEST_DEPENDECIES}
48-
${ament_LIBRARIES})
49-
50-
elseif(catkin_FOUND AND CATKIN_ENABLE_TESTING)
51-
52-
catkin_add_gtest(behaviortree_cpp_test ${BT_TESTS})
53-
target_link_libraries(behaviortree_cpp_test
54-
${TEST_DEPENDECIES}
55-
Threads::Threads
56-
${catkin_LIBRARIES})
41+
target_link_libraries(behaviortree_cpp_test ${ament_LIBRARIES})
5742

5843
else()
5944

6045
find_package(GTest REQUIRED)
6146

6247
enable_testing()
63-
6448
add_executable(behaviortree_cpp_test ${BT_TESTS})
65-
6649
add_test(NAME btcpp_test COMMAND behaviortree_cpp_test)
6750

6851
target_link_libraries(behaviortree_cpp_test
69-
${TEST_DEPENDENCIES}
7052
GTest::gtest
7153
GTest::gtest_main)
7254

7355
endif()
7456

57+
target_link_libraries(behaviortree_cpp_test ${BTCPP_LIBRARY} bt_sample_nodes)
7558
target_include_directories(behaviortree_cpp_test PRIVATE include ${PROJECT_SOURCE_DIR}/3rdparty)
7659
target_compile_definitions(behaviortree_cpp_test PRIVATE BT_TEST_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}")

0 commit comments

Comments
 (0)