111763 Views
85221 Views
83639 Views
51774 Views
49949 Views
48472 Views
Obsidian - the best tool for Makers
10 Projects for your Raspberry Pi Pico
Raspberry Pi Telegraf Setup with Docker
Setting Up Dynamic DNS on a Raspberry Pi for Self-Hosting
Raspberry Pi WordPress Setup with Docker
Raspberry Pi WireGuard VPN Setup with Docker
Using the Raspberry Pi Pico's Built-in Temperature Sensor
Getting Started with SQL
Introduction to the Linux Command Line on Raspberry Pi OS
How to install MicroPython
Wall Drawing Robot Tutorial
BrachioGraph Tutorial
KevsRobots Learning Platform
55% Percent Complete
By Kevin McAleer, 1 Minute
Lets create another program, that will publishes messages.
This time we’ll make it in a class:
import rclpy from rclpy.node import Node class talker(Node): def __init__(self): super().__init__("node_test") self.counter_ = 0 self.get_logger().info("Hello World") self.create_timer(0.5, self.timer_callback) def timer_callback(self): self.counter_ += 1 self.get_logger().info("Hello" + str(self.counter_)) def main(args=None): rclpy.init(args=args) node = talker() rclpy.spin(node) rclpy.shutdown() if __name__ == "__main__": main()
< Previous Next >