I am a beginner, and I am following the ros2ROS 2 tutorial. I have a couple of questions about this tutorial: https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Py-Publisher-And-Subscriber.htmlthis tutorial
Q1: In line 1, we import rclpy, so why do we need to import Node separately in line 2?
Q2: In line 9, we write self as the argument of init function. Can we write anything else instead of self? For example, can we define the function as: def init(us):?
Q3: In line 10, we give the name minimal_publisher. Can I write anything else instead of minimal_publisher in line 27? Can I write in line 27: test_minimal_publisher = MinimalPublisher()
Q4: What will be the name of our node? Is it MinimalPublisher or minimum_publisher?
- Q1: In line 1, we import
rclpy
, so why do we need to importNode
separately in line 2? - Q2: In line 9, we write
self
as the argument of__init__
function. Can we write anything else instead ofself
? For example, can we define the function as:def __init__(us):
? - Q3: In line 10, we give the name
minimal_publisher
. Can I write anything else instead ofminimal_publisher
in line 27? Can I write in line 27:test_minimal_publisher = MinimalPublisher()
- Q4: What will be the name of our node? Is it
MinimalPublisher
orminimum_publisher
?
Thank you for your time.