Skip to main content

Create a Node and spin it without blocking.

Usually:

import rclpy
from rclpy.node import Node
from threading import Thread

node = Node("robot", namespace="MK14QWZ024480005")
Thread(target=rclpy.spin, args=(node,), daemon=True).start()

Now:

</code></pre>
<p>Create a publisher which publishes a message every 100ms.</p>
<p>Usually:</p>
<pre><code class="language-python">msg = String()
publisher = node.create_publisher(String, "topic", 10)
timer = node.create_timer(0.1, lambda: publisher.publish(msg))
# update the message
msg.data = "Hello, world!"

Now:

</code></pre>
<p>Wait for a message to be subscribed.</p>
<p>Usually:</p>
<pre><code class="language-python">message = String()
def callback(msg):
    message.data = msg.data
subscriber = node.create_subscription(String, "topic", callback, 10)
while not message.data:
    rclpy.spin_once(node)

Now:

The above comparison is just a simple example. For more complex examples, please read the following tutorial.

Metadata

Release files for ros2-geek 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ros2-geek 0.2.0
File Size Uploaded Provenance
ros2_geek-0.2.0.tar.gz 22.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ros2-geek 0.2.0
File Interpreter ABI Platform
ros2_geek-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 46.9 kB

Release files / ros2_geek-0.2.0.tar.gz

Download URL ros2_geek-0.2.0.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
36a63a4bfbe40abaf050d2f38706873cf3e2de42cbf0207c872e2b004c8244d1
BLAKE2b-256 checksum
How to use checksums
85adafdd243353b24daaace3e9798a324f226de4e24394593dddf9f7bea98648
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.10

Release files / ros2_geek-0.2.0-py3-none-any.whl

Download URL ros2_geek-0.2.0-py3-none-any.whl
Size 24.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9de226e08174148097677c1985041a7df89374b64711ddbcdd8a551496c018a
BLAKE2b-256 checksum
How to use checksums
9fdd3e64b3c9e553b7085ca6c7c0767311b8232f12b1b1a38388def725758870
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.10

Security for ros2-geek 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page