Questions tagged [rclpy]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

Understanding nested node behavior with subscribers

When I run action info, the action subscriber shown is a different node than the node I passed to the AclientClient constructor. Why is this? It's not what I ...
Dan Sandberg's user avatar
-2 votes
3 answers
40 views

Import "rclypy" could not be resolvedPylancereportMissingImports [closed]

I am trying to follow a ros2 tutorial, and I have a test node working, it's an executable and runs as expected from the terminal. I am now trying to make the turtlesim node draw a circle. I have ...
carolinerooney's user avatar
0 votes
1 answer
15 views

Flickering OccupancyGrid data in RViz2

I'm implementing my own custom message of type nav_msgs/msg/OccupancyGrid to visualize grid-based quantities in a local map (namely virtual pheromones). Back in ROS Noetic, my implementation worked ...
juxyper's user avatar
0 votes
0 answers
10 views

Gazebo error: Robot not moving although apply_joint_effort applied

This is my state publisher node executable ...
Fc0001's user avatar
  • 1
0 votes
0 answers
16 views

ROS2 serial driver with ROS message subscription

I need to set up a ROS2 python serial device driver that also subscribes to a ROS message. For serial drivers the only publish messages I set up the serial input in a select call like this. Here, the ...
Chris's user avatar
  • 1
0 votes
0 answers
17 views

reset model position in ros2

I want to reset the position of robot under certain circumstances. I am trying to do it with python node. I know we call '/reset_world" service to to this but i am unable to call it with python. ...
Pratham's user avatar
  • 25
0 votes
0 answers
14 views

How to control a loop rate inside a node with RCLPY Rate object

I'm quite new to ros2 and I'm trying to understand how to control the rate of a loop inside the main method of an action server. There are many issues related to this topic but I think that none of ...
Antonio Bono's user avatar
0 votes
0 answers
23 views

ros2 python package setup for cuda

I'm trying to use a YOLOv8 model to make inference in a ros2 python node (ubuntu 22.04, ros2 rolling,Intel® Core™ i7-7700HQ CPU, GeForce GTX 1050 Mobile). After few tests, I realized that CUDA is not ...
Antonio Bono's user avatar
0 votes
2 answers
41 views

YAML-standard parameter specification not one of the allowed types

I'm having a problem regarding code migration from ROS Noetic to ROS Foxy. The problem is related to parameter access from scripts. I'm using Python nodes for my code. Originally these sorts of YAML ...
juxyper's user avatar
0 votes
0 answers
20 views

rclpy: Set parameter value before defining a node

I have a node like this: ...
skalkoto's user avatar
0 votes
1 answer
164 views

Installed ROS2 Humble but rclpy not found

I installed ROS2 humble as per the instructions on https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html on Windows 11 WSL2 using Ubuntu 22.04. No issues during installation and ...
Razgriz117's user avatar
1 vote
3 answers
63 views

Get the name of the node calling a service in the service callback

In rclpy (python), I'm creating a service. How can this service tell the name of the node that is calling it? My goal is to allow the service to check the node-name of the client before performing the ...
Sorawit Inprom's user avatar
0 votes
0 answers
54 views

While loop is blocking callback function

My goal is to stop while loop if return value from callback function ui_listener_callback will return False (stop) value ...
reinzler's user avatar
0 votes
0 answers
27 views

Does rclpy supports intraprocess communication?

I wanted to know if rclpy supports intraprocess communication or is there a way to do intraprocess in rclpy with python based libraries? Thanks,
Kirito's user avatar
  • 1
1 vote
1 answer
90 views

Running a websocket server from within a ros2 node

I have an application that requires me to run a websocket server from within a ROS2 node, but I'm running into issues with using async websocket code with rclpy. The typical way of running one of ...
Matthew Gomes's user avatar
1 vote
0 answers
27 views

Pybind11 python bindings for Node

I'm currently creating python bindings for libhri, a ROS C++ library on Humble. The current C++ implementation (not public yet) takes a rclcpp::Node::SharedPtr argument to internally create topic ...
Luka Juricic's user avatar
0 votes
0 answers
15 views

How to I stop a ros2 node in python from generating an empty log file under ~/.ros/log?

I have a custom node which I create in a Python program, the specifics don't matter since any basic node creates such a log file under ~/.ros/log. How can I prevent ...
Hakaishin's user avatar
  • 105
0 votes
1 answer
2k views

rclpy.time.Time() vs Node.get_clock().now()

I'm using Ubuntu 22, ROS2 Humble, Gazebo 11. I tried to print the same value in two different ways that are: rclpy.time.Time() Node.get_clock().now() The time ...
oferb's user avatar
  • 1
0 votes
1 answer
49 views

How to share a service among packages?

I have the following ROS workspace structure: ...
Donca's user avatar
  • 11
0 votes
1 answer
659 views

Actions in Humble: Cancel action in action client

for learning purposes I'm trying to play around with the tutorial (rclpy) for writing an action server + client. So, my action server is providing me with a fibonacci sequence up to n items and ...
robin_rob96's user avatar
2 votes
1 answer
809 views

how to use the rate.sleep function properly

So I have a task of making turtle sim draw a heart using parametric equations I don't know if all my equations are correct but here's my code ...
Ahmed Sallam's user avatar
0 votes
0 answers
61 views

pytest with spin_until_future_complete doesn't work

I've got a short test that works fine with spin_once, but not with spin_until_future_complete, I probably badly use ...
SebL's user avatar
  • 31
0 votes
1 answer
38 views

AssertionError: The 'time_from_start' field must be a sub message of type 'Duration'

Hi everyone, i created a python node, that should controll a Universal Robot UR10 via a Joint Trajectory. Here's its code: ...
user avatar
0 votes
1 answer
3 views

rclpy.action.ActionServer callback 'goal_handle' type

Hi, When opening an action server it looks something like this: ...
user avatar
0 votes
1 answer
58 views

Service call from python hangs

Hi, I am trying to call an existing service (/reinitialise_global_localization from AMCL). I tried creating a client node, but the client gets to request and hangs. I am not sure what is wrong. The ...
user avatar
0 votes
1 answer
174 views

[ROS2] asyncio await with timeout a service call in a callback

Hi! I am trying to use the asyncio syntax to await for a service to complete inside a callback function of a Node. A dummy node to test this: ...
user avatar
1 vote
1 answer
48 views

Handling long actions in rclpy (with cancellation)

The Fibonacci action demo is nice, but it doesn't support cancellation. I added a custom cancel_callback, called it from ...
Clyde McQueen's user avatar
0 votes
1 answer
58 views

Is there an equivalent of rospy.wait_for_message in ros2?

Hi. Sorry for all mistakes, English is not my native language. I have following line of code in my ROS1 project: ...
user avatar
0 votes
1 answer
36 views

Help me understand ros2 execution model

I'm new to ROS2 and struggling to understand how to architect certain aspects of my system. A recurrent problem I'm facing is dealing with nodes that subscribe to specific data and need to provide ...
user avatar
0 votes
1 answer
1 view

where to suggest ideas

Hi, I started developing stuff using ROS2 about a month ago. If I have an idea for a ROS package, where would be the appropriate place be to discuss it and garner support? I am thinking of making a ...
user avatar
0 votes
1 answer
17 views

Communication between rclpy client and rlcpp server

I am working on converting a ros 1 (noetic) project to ros 2 (foxy). I am on Ubuntu 20.04 I am running into an issue where the python node call the service and the cpp node receives the request and ...
user avatar
0 votes
1 answer
32 views

How to convert a Pose to PyKDL Frame in python (and vice versa)

In ROS1 I used tf_conversions.posemath, toMsg and fromMsg. I'm porting my code to ROS2 and ...
user avatar
0 votes
1 answer
49 views

why does rclpy timer have no update method and stored in ns?

using rclpy timer there does not appear to be any method for updating the timer period/interval there is simply a timer_period_ns variable which can be changed but it feels a bit off, especially the ...
user avatar
0 votes
1 answer
20 views

ROS2: What is the purpose of a guard condition?

I was browsing the rclpy repository the other day and found this example which implements something called a guard condition. What is the use case for something like this? Is this a single use ...
user avatar
0 votes
1 answer
30 views

[ROS2] ros2 command stucks without exit

Hi, I'm planning to convert my code to ROS2 Galactic. So i installed on all my machines ROS2 Galactic beside Foxy. Now I have a problem only on one PC: After sourcing ROS2 Galactic ...
user avatar
0 votes
1 answer
361 views

How can I kill a ros2 node with rclpy?

Hi, I have a launch file that launches 3 ROS2 nodes and the nodes are wrote using rclpy. Now, I'm planning to write a service call that will kill 2 of those nodes. After doing some research, I found ...
user avatar
0 votes
1 answer
32 views

TransformListener x10 higher CPU load in rclpy than rclpp

System info Operating System: Docker + Ubuntu 20.04, 10th gen i7 Docker + Ubuntu 20.04, jetson AGX Xavier ROS2 Version: Foxy binaries Steps to reproduce issue Make sure the system is publishing ...
user avatar
0 votes
1 answer
77 views

Spinning multiple nodes across multiple threads

I have an application which dynamically spins up multiple nodes and needs to spin them (as they have subscribers). Quick example, stolen from here: https://answers.ros.org/question/358343/rate-and-...
user avatar
0 votes
1 answer
30 views

ROS2 Performance: rclpy is 30x-100x slower than rclcpp

Hi there, TL;DR: Publishing a typical 10MB Pointcloud on a very fast system takes only 2.8 ms in rclypp but 92 ms in rclpy. We observed significant latency/performance problems when publishing large ...
user avatar
0 votes
1 answer
21 views

import rclpy without sourcing setup.bash

Hi, I want to use the rclpy module in a python script. This script is called by a flask application which is invoked by an apache2 webserver and does not get the necessary bash context. When I run the ...
user avatar
0 votes
1 answer
83 views

How to create Streaming Qos Profile for publisher in Python ROS2

Hi, I am trying to create a QoS profile for the publisher, but couldn't find any examples for it. Can anyone please guide me on how I can create one. I am using Foxy for ROS2 and python as the ...
user avatar
0 votes
1 answer
17 views

rclpy.Subscription getting the number of connections

Is it possible to get the number of connections from a rclpy.Subscription object? (In ROS1 we had "subscriber.get_num_connections()") If it is not possible, what is the alternative? ...
Pablo Iñigo Blasco's user avatar
0 votes
1 answer
185 views

How to use (python) virtual environments with ROS2?

Hello, I am trying to run a python node which has imported some dependencies installed in a python virtual environment (using virtualenv). I have followed this tutorial: https://index.ros.org/doc/ros2/...
user avatar
0 votes
1 answer
4 views

Fail building rclpy from source

Hi everyone. I faced a problem that fail building rclpy from source. I followed a official guide in this repository, but falied building during ...
user avatar
1 vote
2 answers
220 views

Including a Python module in a ROS2 package

Hey you all I have been scratching at my head for a solid day trying to figure out why this is proving to be such a problem. So i have a python ROs2 package. Inside my package i have a node trying to ...
user avatar
0 votes
1 answer
10 views

Why is the Future 'done callback' order reversed?

I'd like to attach multiple callbacks to a Future provided by a ClientGoalHandle. However, when I do this I find that the ...
user avatar
0 votes
1 answer
28 views

rclpy: Change the output format of the default logger (RcutilsLogger)

My log messages look like: [INFO] [1605205588.116214862] [path_to_node.subsystem_name.node_name]: Here is a log message The bit before the actual message takes up too much horizontal space, making ...
user avatar
0 votes
1 answer
138 views

Launching and killing nodes within a Python node in ROS 2 Foxy

I'm in the process of migrating a ROS Melodic python node into a ROS 2 Foxy python node. This particular node acts as the state machine for our software stack. It receives a message from another part ...
Siliconlad's user avatar
0 votes
2 answers
214 views

Rate and sleep function in RCLPY library for ROS2

Recently I started learning ROS2, but I've encountered one issue, I've created a package & defined a node. ...
user avatar
0 votes
2 answers
47 views

[ROS2] creating integration tests for python nodes

I'm trying to create some tests for my nodes. I have already done simple unittests with pytest and unittest. Now we say i have following simple node called publisher: ...
user avatar