Navigation

    蓝鲸ROS机器人论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Popular
    1. Home
    2. Sandro
    ROS交流群
    ROS Group
    产品服务
    Product Service
    开源代码库
    Github
    官网
    Official website
    技术交流
    Technological exchanges
    激光雷达
    LIDAR
    ROS教程
    ROS Tourials
    深度学习
    Deep Learning
    机器视觉
    Computer Vision
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Groups 0

    Sandro

    @Sandro

    0
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Email ningjc@szlanyou.com

    Sandro Unfollow Follow

    Latest posts made by Sandro

    • ROS2 订阅的回调函数如何实现自定义参数??

      目前订阅通用的回调函数都是只有一个参数的,如下
      MinimalSubscriber()
      : Node(“minimal_subscriber”)
      {
      subscription_ = this->create_subscription<std_msgs::msg::String>(
      “topic”, 10, std::bind(&MinimalSubscriber::topic_callback, this, _1));
      }
      private:
      void topic_callback(const std_msgs::msg::String::SharedPtr msg)const
      {
      RCLCPP_INFO(this->get_logger(), “I heard: ‘%s’”, msg->data.c_str());
      }
      是否可以增加一个参数,如下
      void topic_callback(const std_msgs::msg::String::SharedPtr msg,int falg)const
      {
      RCLCPP_INFO(this->get_logger(), “I heard: ‘%s’”, msg->data.c_str());
      }

      posted in ROS教程
      Sandro
      Sandro