Add backward_ros dependency#5404
Conversation
Signed-off-by: Sushant Chavan <gitecsvc@gmail.com>
4d3d62d to
1389e07
Compare
|
@Sushant-Chavan, your PR has failed to build. Please check CI outputs and resolve issues. |
SteveMacenski
left a comment
There was a problem hiding this comment.
LGTM. Two questions:
- How does this look when a crash occurs? Can you cause one on a normal
nav2_bringupcomposed bringup and let me know (a) the logging output (b) what do the other servers react to it - Did you do any perf testing to check on the runtime difference on this addition? Anything appreciable?
|
Sorry, this PR was meant to be for my fork. Unfortunately I didnt realize that I created an upstream PR until you reviewed it 😞 I am yet to test it properly, so setting this PR as a draft for now. But I realized that using backward_ros with composed node will not work and there is already an open issue in rclcpp for addressing this. I will perform some tests without node composition and re-request a review with the details you requested :) |
|
I was able to do some tests to see the effects of using backward_ros. I updated the PR description with details of the same, along with answers to your questions :)
The behavior of other servers was exactly the same in both cases as can be seen in the app logs. |
|
Pull in
I think adding these instructions to https://docs.nav2.org/tutorials/docs/get_backtrace.html for the backward ros section is important context to add. What happens if we don't use
Whats your sense on the likelihood of this being completed? |
|
@Sushant-Chavan, your PR has failed to build. Please check CI outputs and resolve issues. |
Done
Created a PR for updating the docs: ros-navigation/docs.nav2.org#753
It seems the maintainer of rclpp agrees that it is indeed a good idea to have this feature. But I am not sure how high this issue is on their priority list. I pinged them to check the status on that issue, waiting for their response
Yes, you will get some context to narrow down where the issue is coming from. But it will not pin-point to the exact line of code causing the crash. Below is the log generated with the same test scenario, but Nav2 built with [rviz2-7] Start navigation
[bt_navigator-16] [INFO] [1754463292.959638390] [bt_navigator]: Begin navigating from current location (-1.97, -0.49) to (-0.08, 2.00)
[planner_server-13] [INFO] [1754463292.960594359] [planner_server]: Computing path to goal....
[planner_server-13] Stack trace (most recent call last) in thread 130805:
[planner_server-13] #11 Object "/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2", at 0xffffffffffffffff, in
[planner_server-13] #10 Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7509de004c3b, in
[planner_server-13] #9 Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7509ddf77aa3, in
[planner_server-13] #8 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.33", at 0x7509de207db3, in
[planner_server-13] #7 Object "/opt/overlay_ws/src/navigation2/install/nav2_planner/lib/libplanner_server_core.so", at 0x7509de887ee7, in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<nav2::SimpleActionServer<nav2_msgs::action::ComputePathToPose>::handle_accepted(std::shared_ptr<rclcpp_action::ServerGoalHandle<nav2_msgs::action::ComputePathToPose> >)::{lambda()#1}> >, void>::_M_run()
[planner_server-13] #6 Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7509ddf7ced2, in
[planner_server-13] #5 Object "/opt/overlay_ws/src/navigation2/install/nav2_planner/lib/libplanner_server_core.so", at 0x7509de8825cc, in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)
[planner_server-13] #4 Object "/opt/overlay_ws/src/navigation2/install/nav2_planner/lib/libplanner_server_core.so", at 0x7509de8bd380, in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<nav2::SimpleActionServer<nav2_msgs::action::ComputePathToPose>::handle_accepted(std::shared_ptr<rclcpp_action::ServerGoalHandle<nav2_msgs::action::ComputePathToPose> >)::{lambda()#1}> >, void> >::_M_invoke(std::_Any_data const&)
[planner_server-13] #3 Object "/opt/overlay_ws/src/navigation2/install/nav2_planner/lib/libplanner_server_core.so", at 0x7509de8bc2f4, in nav2::SimpleActionServer<nav2_msgs::action::ComputePathToPose>::work()
[planner_server-13] #2 Object "/opt/overlay_ws/src/navigation2/install/nav2_planner/lib/libplanner_server_core.so", at 0x7509de87b798, in nav2_planner::PlannerServer::computePlan()
[planner_server-13] #1 Object "/opt/overlay_ws/src/navigation2/install/nav2_planner/lib/libplanner_server_core.so", at 0x7509de873ce4, in nav2_planner::PlannerServer::publishPlan(nav_msgs::msg::Path_<std::allocator<void> > const&)
[planner_server-13] #0 Object "/opt/ros/rolling/lib/librclcpp_lifecycle.so", at 0x7509de62bf94, in rclcpp_lifecycle::SimpleManagedEntity::is_activated() const
[planner_server-13] Segmentation fault (Address not mapped to object [0x8])
[ERROR] [planner_server-13]: process has died [pid 129889, exit code -11, cmd '/opt/overlay_ws/src/navigation2/install/nav2_planner/lib/nav2_planner/planner_server --ros-args --log-level info --ros-args -r __node:=planner_server -r __ns:=/ -p use_sim_time:=True --params-file /tmp/launch_params_apyru5sq -r /tf:=tf -r /tf_static:=tf_static'].
[lifecycle_manager-21] [INFO] [1754463296.983307895] [lifecycle_manager_navigation]: Have not received a heartbeat from planner_server.
[lifecycle_manager-21] [ERROR] [1754463296.983366864] [lifecycle_manager_navigation]: CRITICAL FAILURE: SERVER planner_server IS DOWN after not receiving a heartbeat for 4000 ms. Shutting down related nodes.
[lifecycle_manager-21] [INFO] [1754463296.983441085] [lifecycle_manager_navigation]: Terminating bond timer...
[lifecycle_manager-21] [INFO] [1754463296.983452753] [lifecycle_manager_navigation]: Resetting managed nodes...
[lifecycle_manager-21] [INFO] [1754463296.983459892] [lifecycle_manager_navigation]: Deactivating docking_server
[opennav_docking-20] [INFO] [1754463296.984245322] [docking_server]: Deactivating docking_server
[opennav_docking-20] [INFO] [1754463297.002580425] [docking_server]: Destroying bond (docking_server) to lifecycle manager.
[lifecycle_manager-21] [INFO] [1754463297.117445489] [lifecycle_manager_navigation]: Deactivating waypoint_follower
[waypoint_follower-17] [INFO] [1754463297.117987811] [waypoint_follower]: Deactivating
[waypoint_follower-17] [INFO] [1754463297.118062979] [waypoint_follower]: Destroying bond (waypoint_follower) to lifecycle manager.
[lifecycle_manager-21] [INFO] [1754463297.235593800] [lifecycle_manager_navigation]: Deactivating bt_navigator
[bt_navigator-16] [INFO] [1754463297.236281265] [bt_navigator]: Deactivating
[bt_navigator-16] [WARN] [1754463297.236385551] [bt_navigator]: [navigate_to_pose] [ActionServer] Requested to deactivate server but goal is still executing. Should check if action server is running before deactivating.
[bt_navigator-16] [ERROR] [1754463297.260222224] [bt_navigator_navigate_to_pose_rclcpp_node]: Failed to cancel action server for compute_path_to_pose
[bt_navigator-16] [ERROR] [1754463297.280637622] [bt_navigator_navigate_to_pose_rclcpp_node]: Failed to get result for compute_path_to_pose in node halt!
[bt_navigator-16] [WARN] [1754463297.281230649] [bt_navigator]: [navigate_to_pose] [ActionServer] Aborting handle. error_code:0, error_msg:''.
[bt_navigator-16] [INFO] [1754463297.281471797] [bt_navigator]: Goal canceled
[bt_navigator-16] [WARN] [1754463297.281535018] [bt_navigator]: [navigate_to_pose] [ActionServer] Stopping the thread per request.
[bt_navigator-16] [INFO] [1754463297.281735336] [bt_navigator]: Destroying bond (bt_navigator) to lifecycle manager.
[lifecycle_manager-21] [INFO] [1754463297.399884645] [lifecycle_manager_navigation]: Deactivating collision_monitor
[collision_monitor-19] [INFO] [1754463297.400991688] [collision_monitor]: Deactivating
[collision_monitor-19] [INFO] [1754463297.401080186] [collision_monitor]: Destroying bond (collision_monitor) to lifecycle manager.
[lifecycle_manager-21] [INFO] [1754463297.519304697] [lifecycle_manager_navigation]: Deactivating velocity_smoother
[velocity_smoother-18] [INFO] [1754463297.520282723] [velocity_smoother]: Deactivating
[velocity_smoother-18] [INFO] [1754463297.520360207] [velocity_smoother]: Destroying bond (velocity_smoother) to lifecycle manager.
[lifecycle_manager-21] [INFO] [1754463297.635293658] [lifecycle_manager_navigation]: Deactivating behavior_server
[behavior_server-15] [INFO] [1754463297.636249442] [behavior_server]: Deactivating
[behavior_server-15] [INFO] [1754463297.636403848] [behavior_server]: Destroying bond (behavior_server) to lifecycle manager.
[lifecycle_manager-21] [INFO] [1754463297.750896319] [lifecycle_manager_navigation]: Deactivating route_server
[route_server-14] [INFO] [1754463297.751678080] [route_server]: Deactivating
[route_server-14] [INFO] [1754463297.751800100] [route_server]: Destroying bond (route_server) to lifecycle manager.
[lifecycle_manager-21] [INFO] [1754463297.867020752] [lifecycle_manager_navigation]: Deactivating planner_server |
Signed-off-by: Sushant Chavan <gitecsvc@gmail.com>
Signed-off-by: Sushant Chavan <gitecsvc@gmail.com>
Basic Info
Description of contribution in a few bullet points
RelWithDebInfoorDebugconfigurations. See sample output belowDescription of how this change was tested
plan_publisher_shared pointer right before publishing the global plan in thePlannerServer::publishPlan()RelWithDebInfoconfigurationuse_compositionflag set to false, using the command:ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False use_composition:=falseLogs without backward_ros dependency
Logs with backward_ros dependency
Future work that may be required in bullet points
None
For Maintainers:
backport-*.