BehaviorTree.ROS2 icon indicating copy to clipboard operation
BehaviorTree.ROS2 copied to clipboard

"process has died" related to tick() in `bt_topic_sub_node.hpp`

Open AndyZe opened this issue 11 months ago • 0 comments

I'm running a gtest on Humble branch. After hours of debugging, combing over my own code over and over again, I've found that commenting this code in RosTopicSubNode<T>::tick() resolves the issue. I don't know why yet. This code is related to changing the topic name at runtime, I think. (I don't do that, in fact I don't even define the topic_name input port.)

This is how my BT node is defined:

  factory.registerNodeType<aladdin_behaviors::BoolSubscriber>("CheckSuctionMonitor1",
                                                              BT::RosNodeParams(node, "/monitor_1_suction_status"));

https://github.com/BehaviorTree/BehaviorTree.ROS2/blob/cc31ea7b97947f1aac6e8c37df6cec379c84a7d9/behaviortree_ros2/include/behaviortree_ros2/bt_topic_sub_node.hpp#L290

template <class T>
inline NodeStatus RosTopicSubNode<T>::tick()
{
  // First, check if the subscriber_ is valid and that the name of the
  // topic_name in the port didn't change.
  // otherwise, create a new subscriber
  // std::string topic_name;
  // getInput("topic_name", topic_name);

  // if(!topic_name.empty() && topic_name != "__default__placeholder__" &&
  //    topic_name != topic_name_)
  // {
  //   sub_instance_.reset();
  // }

  // if(!sub_instance_)
  // {
  //   createSubscriber(topic_name);
  // }

Prior to commenting it, I got:

StdoutLine: {'line': b"1: [ERROR] [suction_test-16]: process has died [pid 98336, exit code -11, cmd '/home/apptronik/workspaces/isaac_ros-dev/build/aladdin_behaviors/suction_test --ros-args'].\n"}

AndyZe avatar Jan 15 '25 20:01 AndyZe