Skip to content

Commit 0b2c381

Browse files
authored
Merge branch 'BehaviorTree:humble' into 2024-07-11_b-adkins_doxygen_documentation
2 parents 29e6ba4 + cc31ea7 commit 0b2c381

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

behaviortree_ros2/src/bt_utils.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,19 @@ btcpp_ros2_interfaces::msg::NodeStatus ConvertNodeStatus(BT::NodeStatus& status)
2929
{
3030
case BT::NodeStatus::RUNNING:
3131
action_status.status = btcpp_ros2_interfaces::msg::NodeStatus::RUNNING;
32+
break;
3233
case BT::NodeStatus::SUCCESS:
3334
action_status.status = btcpp_ros2_interfaces::msg::NodeStatus::SUCCESS;
35+
break;
3436
case BT::NodeStatus::FAILURE:
3537
action_status.status = btcpp_ros2_interfaces::msg::NodeStatus::FAILURE;
38+
break;
3639
case BT::NodeStatus::IDLE:
3740
action_status.status = btcpp_ros2_interfaces::msg::NodeStatus::IDLE;
41+
break;
3842
case BT::NodeStatus::SKIPPED:
3943
action_status.status = btcpp_ros2_interfaces::msg::NodeStatus::SKIPPED;
44+
break;
4045
}
4146

4247
return action_status;

behaviortree_ros2/src/tree_execution_server.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@
1111
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1212
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1313

14+
#ifdef _MSC_VER
15+
#pragma warning(push)
16+
#pragma warning(disable : 4244)
1417
#include <thread>
18+
#pragma warning(pop)
19+
#else
20+
#include <thread>
21+
#endif
1522

1623
#include "behaviortree_ros2/tree_execution_server.hpp"
1724
#include "behaviortree_ros2/bt_utils.hpp"
@@ -235,7 +242,8 @@ void TreeExecutionServer::execute(
235242
const auto now = std::chrono::steady_clock::now();
236243
if(now < loop_deadline)
237244
{
238-
p_->tree.sleep(loop_deadline - now);
245+
p_->tree.sleep(std::chrono::duration_cast<std::chrono::system_clock::duration>(
246+
loop_deadline - now));
239247
}
240248
loop_deadline += period;
241249
}

behaviortree_ros2/tree_execution_server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Furthermore, the user can customize it to:
1818

1919
- Register custom BT Nodes directly (static linking).
2020
- Attach additional loggers. The **Groot2** publisher will be attached by default.
21-
- Use the "global blackboard", a new idiom/pattern explained in [this tutorial](https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/examples/t19_global_blackboard.cpp).
21+
- Use the "global blackboard", a new idiom/pattern explained in [this tutorial](https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/examples/t16_global_blackboard.cpp).
2222
- Customize the feedback of the `rclcpp_action::Server`.
2323

2424
## Customization points

btcpp_ros2_interfaces/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ find_package(ament_cmake REQUIRED)
88
find_package(rosidl_default_generators REQUIRED)
99

1010
rosidl_generate_interfaces(btcpp_ros2_interfaces
11-
"msgs/NodeStatus.msg"
11+
"msg/NodeStatus.msg"
1212
"action/ExecuteTree.action"
1313
"action/Sleep.action")
1414

0 commit comments

Comments
 (0)