{"path":"99 Work/0 OneSec/OneSecNotes/Multimedia/Pasted image 20231005135001.png","text":"B s e e e s e e e e AR s o e e e e e e e R e e e - — O N | - MBS, 2 i 6 // standard ROS2 node with BT: public BT::SyncActionNode S 7 class Readinglasen : public BT::SyncActionNode, public rclcpp::Node { “===<= 8 — 9 private: ——— 2] rclepp::Subscription: :SharedPtr subscri ,i“:— 1 ——— 2 void topic_callback(const sensor_msgs: :msg::LaserScan: :SharedPtr me _ — - _ - e 3 1 e A data2 = msg->ranges[100]; = 5 datal = _msg->ranges[0]; —_— 5} = 7 -T-_,:_ 8 public: e 9 // Node constructor e 1 //See how we define the subscriber. We use lambda function which \"pro\\ Z==__ 2 // to collect data and later reuse data in BT node. 'Sjfi-f': 3 = 4 ReadinglLaser(const std::string &name, const BT::NodeConfiguration & ;E:’—_ 5 : BT::SyncActionNode(name, config), Node(“scanner node™) { p——— 3 auto sensor_qos = rclcpp::QoS(rclcpp::SensorDataQos()); k;‘ 8 subscription_ = this->create subscription