(ROS2-6 시작) 매개변수
ROS2 매개변수 노드 설정, 런타임에 설정된 값 노드별 매개변수 ROS2 매개변수 유형 부울, 정수, 복식, 문자열, 목록… 매개변수 선언 number_publisher.cpp #include “rclcpp/rclcpp.hpp” #include “example_interfaces/msg/int64.hpp” class NumberPublisherNode : public rclcpp::Node { public: NumberPublisherNode() : Node(“number_publisher”), number_(2) { // add this line this->declare_parameter(“name”); number_publisher_ = this->create_publisher<example_interfaces::msg::Int64>(“number”, 10); number_timer_ = this->create_wall_timer(std::chrono::seconds(1), std::bind(&NumberPublisherNode::publishNumber, this)); RCLCPP_INFO(this->get_logger(), “Number publisher has been … Read more