Skip to main content

Questions tagged [rclpy]

The tag has no usage guidance.

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

High frequency service call cause the freeze of service client on ros2

The service client sometimes freeze in spin_until_future_complete on high frequency service call. I run 1 service server and 3 service clients which call service on high frequency. I tested it on ros:...
kjjpc's user avatar
  • 1
0 votes
1 answer
44 views

Is there a more elegant way to get the time in seconds in a ROS 2 node? (taken over from ROS Answers)

While I was looking for a way to convert an rclpy.Duration object to it's equivalent in seconds, I came across this OP from ROS-Answers: https://answers.ros.org/...
shri_ram's user avatar
2 votes
1 answer
37 views

Is there a ROS 2 (Iron) exampe for docker available?

I've been using ROS 1 for my projects and am considering either moving away from ROS or to ROS 2. I am using Ubuntu 20.04 so I want to try it inside docker. I was not able to find easy examples using ...
thzu's user avatar
  • 21
1 vote
0 answers
28 views

How can I schedule a function/callback to be executed by a callback group from another callback group?

Basically: While inside callback group A or B of a node. I need a way to add any callback ...
Elian's user avatar
  • 11
1 vote
0 answers
34 views

Debugging ROS2 rclpy Service Call

I have a project using ROS2 Humble running on Ubuntu 22.04. I’m looking for advice on debugging a issue with a synchronous service call. middleware: rmw_fastrtps_cpp Context I’ve completed a large ...
AlexandreBorowczyk's user avatar
0 votes
0 answers
35 views

ROS2 rclpy subscription problem

I have a following problem: I am trying to subscribe two topic (image and pointcloud) and once the program detect falling edge from gpio pins it should publish the image and point cloud. However the ...
JereK's user avatar
  • 1
0 votes
0 answers
56 views

Shutdown all nodes using rclpy

shutdown alll nodes Above talks about shutting down nodes in rospy how do I do proper clean up in rclpy. I tried: ...
nohacks's user avatar
  • 15
0 votes
0 answers
45 views

Arguments in ROS2 callback function

I want to create subscribers from a topic list, and therefor have to use a common callback I found the Lambda example for creating a common callback, but the issue is that the argument that ends up ...
Viktor T's user avatar
1 vote
0 answers
58 views

Deadlock with spin_until_future_complete in a timer

I am trying to understand how rclpy manages async calls, with a simple example: a timer waits 1sec and then calls a service. ...
courrier's user avatar
0 votes
1 answer
12 views

Cannot get the message using rosbag2 and rclpy

Good day everyone, I've been struggling with this for two days now. and I can't seem to find a solution. I have a dictionary with topic names and their types, what is the correct module to read the ...
Shadowolf's user avatar
0 votes
1 answer
62 views

Executing an action before shutting down the node

I want to stop my robot upon killing my process with SIGINT (CTRL+C). I registered a signal to handle SIGINT and typically this approach works. However in case the topic is not available/reachable ...
geko's user avatar
  • 33
0 votes
0 answers
25 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
188 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
47 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
23 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
50 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
42 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
  • 45
0 votes
0 answers
99 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
68 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
62 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
30 views

rclpy: Set parameter value before defining a node

I have a node like this: ...
skalkoto's user avatar
0 votes
2 answers
1k 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
143 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
66 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
48 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
199 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
34 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
18 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
  • 125
0 votes
1 answer
4k 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
55 views

How to share a service among packages?

I have the following ROS workspace structure: ...
Donca's user avatar
  • 11
0 votes
1 answer
2k 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
2k 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
92 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
  • 51
0 votes
1 answer
120 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
8 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
114 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
284 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
85 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
211 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
98 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
23 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
47 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
66 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
68 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
114 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
807 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
58 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
1 vote
1 answer
145 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
60 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