Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a flag to not send goal in BtActionNode #3293

Merged
merged 3 commits into from
Dec 5, 2022

Conversation

owen7900
Copy link
Contributor

Signed-off-by: Owen Hooper [email protected]


Basic Info

Info Please fill out this column
Ticket(s) this addresses #3150
Primary OS tested on Ubuntu
Robotic platform tested on Gazebo

Description of contribution in a few bullet points

  • I added a parameter to allow an implementing developer to prevent the BtActionNode from sending a goal
  • Parameter gets reset before on_tick is called
  • Parameter is checked before both calls to send_new_goal

Description of documentation updates required from your changes

  • Needs to get added to the migration guide
  • Needs to be added to the table in writing_new_bt_plugin

Future work that may be required in bullet points

For Maintainers:

  • Check that any new parameters added are updated in navigation.ros.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists

@mergify
Copy link
Contributor

mergify bot commented Nov 19, 2022

@owen7900, please properly fill in PR template in the future. @SteveMacenski, use this instead.

  • Check that any new parameters added are updated in navigation.ros.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists

Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@SteveMacenski
Copy link
Member

Any update?

@owen7900
Copy link
Contributor Author

owen7900 commented Dec 3, 2022

@SteveMacenski Got busy. Made the changes.

@SteveMacenski SteveMacenski merged commit 8e7090b into ros-navigation:main Dec 5, 2022
@SteveMacenski
Copy link
Member

Thanks!

jwallace42 pushed a commit to jwallace42/navigation2 that referenced this pull request Dec 14, 2022
* Added a flag to not send goal in BtActionNode

Signed-off-by: Owen Hooper <[email protected]>

* Fixed cpplint and uncrustify issues.

* Update nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp

Signed-off-by: Owen Hooper <[email protected]>
Co-authored-by: Steve Macenski <[email protected]>
andrewlycas pushed a commit to StratomInc/navigation2 that referenced this pull request Feb 23, 2023
* Added a flag to not send goal in BtActionNode

Signed-off-by: Owen Hooper <[email protected]>

* Fixed cpplint and uncrustify issues.

* Update nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp

Signed-off-by: Owen Hooper <[email protected]>
Co-authored-by: Steve Macenski <[email protected]>
tonynajjar pushed a commit to logivations/navigation2 that referenced this pull request Feb 28, 2023
* Added a flag to not send goal in BtActionNode

Signed-off-by: Owen Hooper <[email protected]>

* Fixed cpplint and uncrustify issues.

* Update nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp

Signed-off-by: Owen Hooper <[email protected]>
Co-authored-by: Steve Macenski <[email protected]>
(cherry picked from commit 8e7090b)
@tonynajjar
Copy link
Contributor

When I set should_send_goal_ to false in my on_tick(), the navigator crashes, here is the log with backward_ros:

[amr_navigate_to_pose-6]          77:   template<typename _Res, typename _MemPtr, typename _Tp>
[amr_navigate_to_pose-6] #6    Source "/code/ros2_ws/install/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server_impl.hpp", line 237, in executeCallback [0x7f841716e71f]
[amr_navigate_to_pose-6]         234:     };
[amr_navigate_to_pose-6]         235: 
[amr_navigate_to_pose-6]         236:   // Execute the BT that was previously created in the configure step
[amr_navigate_to_pose-6]       > 237:   nav2_behavior_tree::BtStatus rc = bt_->run(tree_, on_loop, is_canceling, bt_loop_duration_);
[amr_navigate_to_pose-6]         238: 
[amr_navigate_to_pose-6]         239:   // Make sure that the Bt is not in a running state from a previous execution
[amr_navigate_to_pose-6]         240:   // note: if all the ControlNodes are implemented correctly, this is not needed.
[amr_navigate_to_pose-6] #5    Object "/code/ros2_ws/build/nav2_behavior_tree/libnav2_behavior_tree.so", at 0x7f841652f552, in nav2_behavior_tree::BehaviorTreeEngine::run(BT::Tree*, std::function<void ()>, std::function<bool ()>, std::chrono::duration<long, std::ratio<1l, 1000l> >)
[amr_navigate_to_pose-6] #4    Object "/opt/ros/humble/lib/libbehaviortree_cpp_v3.so", at 0x7f8417561745, in BT::TreeNode::executeTick()
[amr_navigate_to_pose-6] #3    Object "/opt/ros/humble/lib/libbehaviortree_cpp_v3.so", at 0x7f8417575b3b, in BT::SequenceNode::tick()
[amr_navigate_to_pose-6] #2    Object "/opt/ros/humble/lib/libbehaviortree_cpp_v3.so", at 0x7f8417561745, in BT::TreeNode::executeTick()
[amr_navigate_to_pose-6] #1    Object "/code/ros2_ws/build/amr_behavior_tree/libset_lift_level_action_bt_node.so", at 0x7f8410188861, in nav2_behavior_tree::BtActionNode<control_msgs::action::SingleJointPosition>::tick()
[amr_navigate_to_pose-6] #0    Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7f841697ff74, in pthread_mutex_lock
[amr_navigate_to_pose-6] Segmentation fault (Address not mapped to object [0xb0])
[ERROR] [amr_navigate_to_pose-6]: process has died [pid 2432571, exit code -11, cmd '/code/ros2_ws/install/amr_bt_navigator/lib/amr_bt_navigator/amr_navigate_to_pose --ros-args -r __node:=amr_navigate_to_pose -p use_sim_time:=True --params-file /tmp/unaliased_2knhja99'].

As you can probably see a lot of the code in there in custom so I'm not 100% sure that the issue is on Nav2 side but a test for this would have been really useful to confirm or deny this. Do you see any obvious reason for this crash?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants