Skip to content

Commit 2018ca3

Browse files
committed
Merge remote-tracking branch 'btros2-fork/humble' into humble
2 parents 94e6bdb + 7a6ace6 commit 2018ca3

32 files changed

+1459
-0
lines changed

.clang-format

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
BasedOnStyle: Google
3+
AccessModifierOffset: -2
4+
ConstructorInitializerIndentWidth: 2
5+
AlignEscapedNewlinesLeft: false
6+
AlignTrailingComments: true
7+
AllowAllParametersOfDeclarationOnNextLine: false
8+
AllowShortIfStatementsOnASingleLine: false
9+
AllowShortLoopsOnASingleLine: false
10+
AllowShortFunctionsOnASingleLine: None
11+
AlwaysBreakTemplateDeclarations: true
12+
AlwaysBreakBeforeMultilineStrings: false
13+
BreakBeforeBinaryOperators: false
14+
BreakBeforeTernaryOperators: false
15+
BreakConstructorInitializers: BeforeComma
16+
BinPackParameters: true
17+
ColumnLimit: 90
18+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
19+
DerivePointerBinding: false
20+
PointerBindsToType: true
21+
ExperimentalAutoDetectBinPacking: false
22+
IndentCaseLabels: true
23+
MaxEmptyLinesToKeep: 1
24+
NamespaceIndentation: None
25+
ObjCSpaceBeforeProtocolList: true
26+
PenaltyBreakBeforeFirstCallParameter: 19
27+
PenaltyBreakComment: 60
28+
PenaltyBreakString: 1
29+
PenaltyBreakFirstLessLess: 1000
30+
PenaltyExcessCharacter: 1000
31+
PenaltyReturnTypeOnItsOwnLine: 90
32+
SpacesBeforeTrailingComments: 2
33+
Cpp11BracedListStyle: false
34+
Standard: Auto
35+
IndentWidth: 2
36+
TabWidth: 2
37+
UseTab: Never
38+
IndentFunctionDeclarationAfterType: false
39+
SpacesInParentheses: false
40+
SpacesInAngles: false
41+
SpaceInEmptyParentheses: false
42+
SpacesInCStyleCastParentheses: false
43+
SpaceAfterControlStatementKeyword: true
44+
SpaceBeforeAssignmentOperators: true
45+
SpaceBeforeParens: Never
46+
ContinuationIndentWidth: 4
47+
SortIncludes: false
48+
SpaceAfterCStyleCast: false
49+
ReflowComments: false
50+
51+
# Configure each individual brace in BraceWrapping
52+
BreakBeforeBraces: Custom
53+
54+
# Control of individual brace wrapping cases
55+
BraceWrapping: {
56+
AfterClass: 'true',
57+
AfterControlStatement: 'true',
58+
AfterEnum : 'true',
59+
AfterFunction : 'true',
60+
AfterNamespace : 'true',
61+
AfterStruct : 'true',
62+
AfterUnion : 'true',
63+
BeforeCatch : 'true',
64+
BeforeElse : 'true',
65+
IndentBraces : 'false',
66+
SplitEmptyFunction: 'false'
67+
}
68+
...

.github/workflows/pre-commit.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-python@v3
14+
- uses: pre-commit/[email protected]

.github/workflows/test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Test
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- humble
7+
8+
jobs:
9+
build_and_test:
10+
runs-on: ubuntu-latest
11+
env:
12+
ROS_DISTRO: ${{ matrix.ros_distro }}
13+
container:
14+
image: rostooling/setup-ros-docker:ubuntu-jammy-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
ros_distro: [humble]
19+
steps:
20+
- name: Build and run tests
21+
id: action-ros-ci
22+
uses: ros-tooling/[email protected]
23+
with:
24+
target-ros2-distro: ${{ matrix.ros_distro }}
25+
- uses: actions/upload-artifact@v1
26+
with:
27+
name: colcon-logs
28+
path: ros_ws/log

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,36 @@
1+
<<<<<<< HEAD
12
.deps/*
3+
=======
4+
# Prerequisites
5+
*.d
6+
7+
# Compiled Object files
8+
*.slo
9+
*.lo
10+
*.o
11+
*.obj
12+
13+
# Precompiled Headers
14+
*.gch
15+
*.pch
16+
17+
# Compiled Dynamic libraries
18+
*.so
19+
*.dylib
20+
*.dll
21+
22+
# Fortran module files
23+
*.mod
24+
*.smod
25+
26+
# Compiled Static libraries
27+
*.lai
28+
*.la
29+
*.a
30+
*.lib
31+
32+
# Executables
33+
*.exe
34+
*.out
35+
*.app
36+
>>>>>>> btros2-fork/humble

.pre-commit-config.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
# To use:
3+
#
4+
# pre-commit run -a
5+
#
6+
# Or:
7+
#
8+
# pre-commit install # (runs every time you commit in git)
9+
#
10+
# To update this file:
11+
#
12+
# pre-commit autoupdate
13+
#
14+
# See https://github.com/pre-commit/pre-commit
15+
16+
exclude: ^3rdparty/|3rdparty|^include/behaviortree_cpp/contrib/
17+
repos:
18+
19+
# Standard hooks
20+
- repo: https://github.com/pre-commit/pre-commit-hooks
21+
rev: v4.5.0
22+
hooks:
23+
- id: check-added-large-files
24+
- id: check-ast
25+
- id: check-case-conflict
26+
- id: check-docstring-first
27+
- id: check-merge-conflict
28+
- id: check-symlinks
29+
- id: check-xml
30+
- id: check-yaml
31+
- id: debug-statements
32+
- id: end-of-file-fixer
33+
exclude_types: [svg]
34+
- id: mixed-line-ending
35+
- id: trailing-whitespace
36+
exclude_types: [svg]
37+
- id: fix-byte-order-marker
38+
39+
# CPP hooks
40+
- repo: https://github.com/pre-commit/mirrors-clang-format
41+
rev: v17.0.6
42+
hooks:
43+
- id: clang-format
44+
args: ['-fallback-style=none', '-i']

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Our main goals are:
6060
- to minimize the amount of boilerplate.
6161
- to make asynchronous Actions non-blocking.
6262

63+
<<<<<<< HEAD
6364
It uses [behaviortree_eut_plugins](https://ice.eurecat.org/gitlab/robotics-automation/behavior_tree_eut_plugins) for augmenting its original [public version](https://github.com/BehaviorTree/BehaviorTree.ROS2.git) with custom serialization and deserialization policies, providing out of the box json one, essentially adding the following plugins templates to be used with a one-liner:
6465

6566
Plugin Template | Deserialization Policy | Serialization Policy | Extra Pre/Post processing
@@ -148,6 +149,9 @@ Note that you can specialize some functions for specific MessageType `T` in the
148149
# Examples
149150

150151
# Further Documentation
152+
=======
153+
# Documentation
154+
>>>>>>> btros2-fork/humble
151155
152156
- [ROS Behavior Wrappers](behaviortree_ros2/ros_behavior_wrappers.md)
153157
- [TreeExecutionServer](behaviortree_ros2/tree_execution_server.md)
@@ -156,9 +160,15 @@ Note that you can specialize some functions for specific MessageType `T` in the
156160
Note that this library is compatible **only** with:
157161

158162
- **BT.CPP** 4.6 or newer.
163+
<<<<<<< HEAD
159164
- **ROS2** Humble or Jazzy.
160165

161166
Additionally, check **plugins.hpp** and **plugins.cpp** to see how to learn how to
167+
=======
168+
- **ROS2** Humble or newer.
169+
170+
Additionally, check **plugins.hpp** to see how to learn how to
171+
>>>>>>> btros2-fork/humble
162172
wrap your Nodes into plugins that can be loaded at run-time.
163173

164174

behaviortree_ros2/CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ project(behaviortree_ros2)
44
set(CMAKE_CXX_STANDARD 17)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)
66

7+
<<<<<<< HEAD
78
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
89
add_compile_options(-fPIC)
910

11+
=======
12+
>>>>>>> btros2-fork/humble
1013
set(THIS_PACKAGE_DEPS
1114
rclcpp
1215
rclcpp_action
1316
ament_index_cpp
1417
behaviortree_cpp
18+
<<<<<<< HEAD
1519
behaviortree_eut_plugins
1620
btcpp_ros2_interfaces
1721
generate_parameter_library
@@ -23,6 +27,10 @@ set(THIS_PACKAGE_DEPS
2327
tf2
2428
tf2_geometry_msgs
2529
tf2_ros
30+
=======
31+
btcpp_ros2_interfaces
32+
generate_parameter_library
33+
>>>>>>> btros2-fork/humble
2634
)
2735

2836
find_package(ament_cmake REQUIRED)
@@ -31,6 +39,10 @@ foreach(PACKAGE ${THIS_PACKAGE_DEPS})
3139
find_package(${PACKAGE} REQUIRED )
3240
endforeach()
3341

42+
<<<<<<< HEAD
43+
=======
44+
45+
>>>>>>> btros2-fork/humble
3446
generate_parameter_library(
3547
bt_executor_parameters
3648
src/bt_executor_parameters.yaml)
@@ -48,6 +60,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
4860

4961
target_link_libraries(${PROJECT_NAME} bt_executor_parameters)
5062

63+
<<<<<<< HEAD
5164
# Executable to generate xml from .so plugin for "simple" and ros2 based bt plugins .so
5265
add_executable(bt_ros_plugins_to_xml src/tools/bt_ros_plugins_to_xml.cpp )
5366
include_directories(${behaviortree_cpp_INCLUDE_DIRS} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
@@ -61,13 +74,18 @@ target_include_directories(${PROJECT_NAME}_nodemodels PRIVATE
6174
target_compile_definitions(${PROJECT_NAME}_nodemodels PRIVATE BT_PLUGIN_EXPORT )
6275
ament_target_dependencies(${PROJECT_NAME}_nodemodels ${THIS_PACKAGE_DEPS})
6376

77+
=======
78+
>>>>>>> btros2-fork/humble
6479

6580
######################################################
6681
# INSTALL
6782

83+
<<<<<<< HEAD
6884
install(TARGETS bt_ros_plugins_to_xml
6985
DESTINATION lib/${PROJECT_NAME} )
7086

87+
=======
88+
>>>>>>> btros2-fork/humble
7189
install(DIRECTORY include/ DESTINATION include/)
7290

7391
ament_export_targets(${PROJECT_NAME}Targets HAS_LIBRARY_TARGET)
@@ -80,6 +98,7 @@ install(
8098
LIBRARY DESTINATION lib
8199
RUNTIME DESTINATION lib/${PROJECT_NAME})
82100

101+
<<<<<<< HEAD
83102
# Recover subfolder path for plugins
84103
execute_process(
85104
COMMAND bash -c "xmllint --xpath 'string(//description/plugins/@folder_path)' plugins_description.xml | awk '{print \$1\}'"
@@ -129,6 +148,8 @@ ament_index_register_resource(
129148
CONTENT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/palettes_description.xml"
130149
)
131150

151+
=======
152+
>>>>>>> btros2-fork/humble
132153
ament_export_include_directories(include)
133154
ament_export_libraries(${PROJECT_NAME})
134155

behaviortree_ros2/include/behaviortree_ros2/bt_action_node.hpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ inline void RosActionNode<T>::cancelGoal()
546546

547547
auto& action_client = client_instance_->action_client;
548548

549+
<<<<<<< HEAD
549550
try
550551
{
551552
auto future_result = action_client->async_get_result(goal_handle_);
@@ -571,6 +572,23 @@ inline void RosActionNode<T>::cancelGoal()
571572
}
572573
catch(const std::exception& ex) {
573574
RCLCPP_ERROR(logger(), "Exception while canceling goal: %s", ex.what());
575+
=======
576+
auto future_result = action_client->async_get_result(goal_handle_);
577+
auto future_cancel = action_client->async_cancel_goal(goal_handle_);
578+
579+
constexpr auto SUCCESS = rclcpp::FutureReturnCode::SUCCESS;
580+
581+
if(executor.spin_until_future_complete(future_cancel, server_timeout_) != SUCCESS)
582+
{
583+
RCLCPP_ERROR(logger(), "Failed to cancel action server for [%s]",
584+
action_name_.c_str());
585+
}
586+
587+
if(executor.spin_until_future_complete(future_result, server_timeout_) != SUCCESS)
588+
{
589+
RCLCPP_ERROR(logger(), "Failed to get result call failed :( for [%s]",
590+
action_name_.c_str());
591+
>>>>>>> btros2-fork/humble
574592
}
575593
}
576594

0 commit comments

Comments
 (0)