Skip to content

Commit

Permalink
Add Backward-ROS for improved logging in event of segfaults (#327)
Browse files Browse the repository at this point in the history
* Add Backward-ROS for improved logging in event of segfaults

`backward-ros` provides a clean way to catch unhandled exceptions and
segfaults and is able to print a stack trace when a program crashes.
This PR adds `backward-ros` to rmf ros2 nodes so that we can trace
causes for segfaults.

Note: This will only work for pure C++ nodes. If we want logging in
downstream fleetadapters they will have to handle that themselves either
using `backward-cpp` or `faulthandler` in python.

Signed-off-by: Arjo Chakravarty <arjoc@google.com>

* Alphabetize deps

Signed-off-by: Arjo Chakravarty <arjoc@google.com>

---------

Signed-off-by: Arjo Chakravarty <arjoc@google.com>
Co-authored-by: Yadu <yadunund@openrobotics.org>
  • Loading branch information
arjo129 and Yadunund committed Mar 6, 2024
1 parent c0b89ff commit a2269ab
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 27 deletions.
1 change: 1 addition & 0 deletions rmf_fleet_adapter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake REQUIRED)
find_package(backward_ros REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(yaml-cpp REQUIRED)
find_package(Threads REQUIRED)
Expand Down
31 changes: 17 additions & 14 deletions rmf_fleet_adapter/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,33 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<depend>rclcpp</depend>

<depend>backward_ros</depend>
<depend>nlohmann_json_schema_validator_vendor</depend>
<depend>nlohmann-json-dev</depend>
<depend>rclcpp_components</depend>
<depend>rmf_utils</depend>
<depend>rmf_door_msgs</depend>
<depend>rmf_ingestor_msgs</depend>
<depend>rclcpp</depend>
<depend>rmf_api_msgs</depend>
<depend>rmf_battery</depend>
<depend>rmf_building_map_msgs</depend>
<depend>rmf_dispenser_msgs</depend>
<depend>rmf_door_msgs</depend>
<depend>rmf_fleet_msgs</depend>
<depend>rmf_ingestor_msgs</depend>
<depend>rmf_lift_msgs</depend>
<depend>rmf_task_msgs</depend>
<depend>rmf_traffic</depend>
<depend>rmf_traffic_ros2</depend>
<depend>rmf_task_ros2</depend>
<depend>rmf_battery</depend>
<depend>rmf_task</depend>
<depend>rmf_task_sequence</depend>
<depend>rmf_task</depend>
<depend>rmf_traffic_ros2</depend>
<depend>rmf_traffic</depend>
<depend>rmf_utils</depend>
<depend>rmf_websocket</depend>
<depend>std_msgs</depend>
<depend>rmf_api_msgs</depend>
<depend>rmf_building_map_msgs</depend>
<depend condition="$RMF_ENABLE_FAILOVER == 1">stubborn_buddies</depend>

<depend condition="$RMF_ENABLE_FAILOVER == 1">stubborn_buddies_msgs</depend>
<depend condition="$RMF_ENABLE_FAILOVER == 1">stubborn_buddies</depend>

<depend>rmf_websocket</depend>
<depend>nlohmann-json-dev</depend>
<depend>nlohmann_json_schema_validator_vendor</depend>

<build_depend>eigen</build_depend>
<build_depend>yaml-cpp</build_depend>
Expand Down
1 change: 1 addition & 0 deletions rmf_task_ros2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ endif()
include(GNUInstallDirs)

find_package(ament_cmake REQUIRED)
find_package(backward_ros REQUIRED)
find_package(rmf_api_msgs REQUIRED)
find_package(rmf_traffic REQUIRED)
find_package(rmf_traffic_ros2 REQUIRED)
Expand Down
13 changes: 7 additions & 6 deletions rmf_task_ros2/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<depend>rmf_utils</depend>
<depend>backward_ros</depend>
<depend>nlohmann_json_schema_validator_vendor</depend>
<depend>nlohmann-json-dev</depend>
<depend>rclcpp</depend>
<depend>rmf_api_msgs</depend>
<depend>rmf_traffic</depend>
<depend>rmf_traffic_ros2</depend>
<depend>rmf_task_msgs</depend>
<depend>rclcpp</depend>
<depend>rmf_traffic_ros2</depend>
<depend>rmf_traffic</depend>
<depend>rmf_utils</depend>
<depend>rmf_websocket</depend>
<depend>nlohmann-json-dev</depend>
<depend>nlohmann_json_schema_validator_vendor</depend>

<build_depend>eigen</build_depend>

Expand Down
1 change: 1 addition & 0 deletions rmf_traffic_ros2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/cmake)
include(GNUInstallDirs)

find_package(ament_cmake REQUIRED)
find_package(backward_ros REQUIRED)
find_package(rmf_traffic 3 REQUIRED)
find_package(rmf_traffic_msgs REQUIRED)
find_package(rmf_site_map_msgs REQUIRED)
Expand Down
15 changes: 8 additions & 7 deletions rmf_traffic_ros2/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<depend>rmf_utils</depend>
<depend>rmf_traffic</depend>
<depend>rmf_traffic_msgs</depend>
<depend>backward_ros</depend>
<depend>nlohmann-json-dev</depend>
<depend>proj</depend>
<depend>rclcpp</depend>
<depend>rmf_building_map_msgs</depend>
<depend>rmf_fleet_msgs</depend>
<depend>rmf_site_map_msgs</depend>
<depend>rmf_building_map_msgs</depend>
<depend>rclcpp</depend>
<depend>rmf_traffic_msgs</depend>
<depend>rmf_traffic</depend>
<depend>rmf_utils</depend>
<depend>yaml-cpp</depend>
<depend>nlohmann-json-dev</depend>
<depend>proj</depend>
<depend>zlib</depend>

<build_depend>uuid</build_depend>
Expand Down

0 comments on commit a2269ab

Please sign in to comment.