Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [subscribe]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
22 views

ROS2 rclcpp subscriber callback uses same shared_ptr for each new message

I have an rclcpp node with some message data coming in (images, scans, etc). I would like to apply temporal filtering to this data, and therefore store a copy of each incoming message. I assumed ...
edgex004's user avatar
0 votes
0 answers
12 views

Cancel previous callback made from subscription ROS2

I'm new to ROS2 and I don't really know how to do this is in a clean way. I'm in this condition ...
Alexander's user avatar
0 votes
0 answers
13 views

Is there an architecture in ROS 2 to put “backpressue” on upstream nodes to slow is down?

Pipeline description: Node A - Camera Driver Node that publishes images(topic 1) at 30 Hz. Node B - Objection detection Node subscribes to images(topic 1) and publishes 2D detections(topic 2) Node C -...
ashwin kuruttukulam's user avatar
0 votes
2 answers
29 views

Multiple subscriptions in a single callback

I want to do parallel process of multiple subscriptions in a single callback. I have been looking for information, but there is barely any information regarding this in ROS 2 Humble. I found callback ...
paul's user avatar
  • 1
0 votes
0 answers
24 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
1 vote
0 answers
82 views

Read topic message from subscription without executing callback

"Reading data from subscription without executing callback" is considered to be one of the common use cases of ROS 2. However, I wonder why there is less description about this use case in ...
takamine's user avatar
0 votes
1 answer
35 views

Calling ROS2 subscriber callback function from another function

I try to use x and y in timer_callback function but I get ‘x’ was not declared in this scope I don't know how can I do this ...
HCA's user avatar
  • 3
0 votes
1 answer
155 views

C++ Publisher and Subscriber in ROS2

I use Ubuntu 20.04 and Ros2 Galactic when I run the code I'm able to get subscribe information and pub this information and also I can see publisher information on topic echo continuously but when I ...
HCA's user avatar
  • 3
0 votes
0 answers
321 views

ROS2 C++ custom node using image transport not subscribing to a topic

I am trying to write a custom ROS2 node in c++ that subscribes to /depth_to_rgb/image_raw coming from Azure Kinect of type 'sensor_msgs/msg/Image' topic. Then I am trying to get a depth value at a ...
kmartbirthdaycake's user avatar
0 votes
0 answers
46 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
0 votes
0 answers
45 views

Subscriber in python to std_msgs.msg.Float32 crashes when the maximum float-32bits is sent

Setup: a publisher in c++ of std_msgs/msg/Float32 sends the maximum float-32bits (using std::numeric_limits::max()) a subcriber in c++ to the topic above works just fine a subcriber in python to the ...
POtaoPereiraRosen's user avatar
0 votes
1 answer
207 views

Subscribe to geometry_msgs/TransformStamped (tf) Message with message_filters ApproximateTime subscriber

I am trying to use a message_filters::sync::ApproximateTime subscriber in a C++ node that must subscribe to 2 custom messages (which have a Header each), nav_msgs/OccupancyGrid Message, and a tf/...
hunterlineage's user avatar
1 vote
1 answer
308 views

Arduino IDE micro-ros two subscriber in Arduino due issue

I’m recently started working with micro-ros and also tested the publisher and subscriber with Arduino Due, but I want to add multi subscriber in my Arduino code (at-least two). but it’s not working ...
Sourabh Tiwari's user avatar
0 votes
1 answer
400 views

ROS2/create_subscription: How to pass callback arguments

In ROS 1, I was able to pass arguments to the callback function of a subscriber: rospy.Subscriber(topic_name, type, call_back, call_back_arg) How can I do this in ROS2? My goal is to pass the name of ...
user avatar
0 votes
1 answer
6 views

Definitions of map and tf using turtlebot3

Hello, I am using turtlebot3 and SLAM. My environment is Ubuntu 18.04 LTS and ROS1 melodic. I have the questions about /tf and /map. I want to implement subscriber callback, but I don't know the type ...
user avatar
0 votes
1 answer
18 views

What happens when two messages in a topic came one after another?

Let's say I have a node that is subscribed to a topic. Every time a message comes it will call a callback where it will process the message. So, a message comes in and the node calls the callback ...
user avatar
0 votes
1 answer
6 views

Number of TCP connections for a "bidirectional" topic?

Hi all, I have a (possibly) simple question: assume if I have two nodes A, B that communicate over a topic "/my_topic", i.e., both nodes subscribe and publish to "/my_topic" using ...
user avatar
0 votes
1 answer
18 views

Can't find package: cartographer_ros

I'm trying to get a marker array containing pose info from cartographer_ros. I got the 2D cartographer_ros demo working, and the Subscribe demo working. I'm now trying to modify the Subscribe demo to ...
user avatar
0 votes
1 answer
2 views

[Solved] Error when subscribing to multiple topics in python

Hello, I'm new to ROS and I'm having a problem when I try to move my turtle to a goal that I'm publishing. I created a node that subscribes to 2 topics: the position of the turtle and the ...
user avatar
0 votes
1 answer
6 views

NodeHandle::subscribe fail to subscribe topic

Hi, I'm new to ROS and C++ and doing Programming for Robotics (http://www.rsl.ethz.ch/education-students/lectures/ros.html). My problem is "Create a subscriber to the /scan topic" in ...
user avatar
0 votes
1 answer
20 views

Subscribe vs. waitForMessage for a 30hz topic

I would like to read a topic (which is published at ~30hz) at specific moments in the execution of my code. This Q&A shows I have 2 ways to proceed: waitForMessage (from here) which is a "...
user avatar
0 votes
1 answer
4 views

Subscribing to a topic whenever it publishes without affecting the execution of program

Hello, I'm writing a project with C++ in ROS indigo installed in Ubuntu. In my project, I do some processes in one node and publish the result data and in an other node, want to subscribe to this data ...
user avatar
0 votes
1 answer
67 views

Subscribe to actions on keyboard (press key)

Hi, I want to receive messages in ROS that tell me which key was pressed on a keyboard that is connected with the PC. I found several examples for other input devices and also some of them treated ...
user avatar
0 votes
1 answer
5 views

depth_image_proc subscriber

I am trying to use the depth_image_proc node and am unsure how to connect it to my network. I have no experience with a nodelet and cannot seem to remap the topics correctly. Below is my output ...
user avatar
0 votes
1 answer
2 views

Accessing previous estimated joint states of a robot

Hi, I am new to ROS and I am trying to implement a Kalman filter for estimating the joints velocity and acceleration of a robotic manipulator. The angular position of each joint is published to the ...
user avatar
0 votes
1 answer
8 views

Is it possible to read data from /map?

Hello weveryone, I'm trying to read the data from the topic /map (in ROS Kinetic) but I don't know if I'm subscribing correctly. I'm using the following code to count the number of gray pixels (...
user avatar
0 votes
2 answers
4 views

ros_tutorials roscpp talker/listener loses first message or two

This must've been seen before...I ran into it while trying to track down a lost message from a command-line app which publishes one message then exits. I'm running ros kinetic on Ubuntu 16.04.4. My ...
user avatar
0 votes
1 answer
5 views

Unable to print subscribed sensor_msgs with ROS_INFO

Hello and thanks for reading my post. I am trying to subscribe to a topic from an imu using the sensor_msgs::MagneticField. This topic is published by a 3rd party package called mavros. I am trying to ...
user avatar
0 votes
1 answer
194 views

Are ROS2 messages guaranteed to be received by a Subscriber in the same order they were published?

According to https://github.com/ros2/ros2/wiki/About-Quality-of-Service-Settings it's possible to vary the QoS settings of History, Depth, Reliability and Durability. However, I can't find any mention ...
user avatar
0 votes
1 answer
18 views

Make gazebo subscribe to a ROS topic?

Hi, I've noticed that there are some ros topics that have the gazebo as a subscriber. Can someone tell me how can I make gazebo subscribe to a topic I create or where I can learn about it? Originally ...
user avatar
0 votes
1 answer
6 views

Rospy callback attribute error

Am following a youtube tutorial (https://www.youtube.com/watch?v=DLVyc9hOvk8) with my own code: Executable: ...
user avatar
0 votes
1 answer
4 views

Subscribe Message file

Hello! I want to subscribe data from .msg file. However the file has four other msgs inside. The format of the .msg file is: ...
user avatar
0 votes
1 answer
7 views

writing a publisher and subscriber and unsure how to finish it

I am taking this edx course on robotics using ROS and our first project is "writing a node that subscribes to a topic and publishes to another. Your code will subscribe to a topic called '...
user avatar
0 votes
1 answer
32 views

Subscribing to /rosout topic

Is there a way I can write a node to subscribe the log messages from the /rosout topic and save in a HTML file? Originally posted by robo_ninja on ROS Answers with karma: 55 on 2017-07-18 Post score: ...
user avatar
0 votes
1 answer
4 views

The question about ros::publisher and ros::subscriber

I want to achieve receiving and transform data using rostopic at the same time or in a low time. I know that ros::subscriber can subscribe rostopic and receive the data included in topic. So I hope ...
user avatar
0 votes
1 answer
1 view

One time publish executable

Hi, Im trying to use a specific node (program A) as a test program being executed once taking the value to be published on a topic (lets call it "foo"). Program B is already subscribed to ...
user avatar
0 votes
1 answer
1 view

what if computation complexity cannot meet the demand of callback frequency

According to the totorials, the callback function frequency is dependent on the its subscribing topic frequency. What will happen if the callback function is very complex and the computation time is ...
user avatar
0 votes
1 answer
8 views

Interrupting a topic callback to call a service

I am currently facing an issue with my code, which both subcribes to a topic, and runs the server side of a service. The problem i am currently facind is that the topic which i am subscribing to is ...
user avatar
0 votes
1 answer
4 views

subsribe to two integer type msgs with one call back function

I tried to subscribe to two integer types .But lot of errors are showing .Please help me to correct the code code: ...
user avatar
0 votes
1 answer
2 views

subscribe to two topics of int and sensormsg types

I want to subscribe to topics that are of types int and sensor_msg .I want only one call back function to proces these two messages together .Please give an example code for this: Originally posted ...
user avatar
0 votes
2 answers
36 views

How do Publisher/Subscriber Message Queues Work?

Hi all, I can't seem to find any documentation on this, but it I want to understand more deeply how messaging queues work. My understanding is that each node has its own publisher and subscriber ...
user avatar
0 votes
1 answer
1 view

Is it possible to publish/subscribe as root?

Hello smart people, I have made a ROS node that makes use of an FTDI library that requires that I run the executable as root to have access to the usb device that the node reads data from. The trouble ...
user avatar
0 votes
2 answers
11 views

Template argument deduction fails

Hi, I have this call for a Subscriber: ros::Subscriber sub = handle.subscribe<std_msgs::Bool>(topic_str.str(), 10, boost::bind(obIcCb, _1, i)); Why do I need ...
user avatar
0 votes
1 answer
6 views

An alternative to data processing inside callback functions?

I want to perform calculations on the data from my subscriptions the instant it arrives. I could of course just do this inside the callback function, but i would insted like to perform these ...
user avatar
0 votes
1 answer
4 views

In general: How to catch subscription errors?

How do i catch errors from subscribers, or even better in general. Originally I tried to catch only subscription errors but as I moved on how to do catch ros exceptions in general as its done in c++ ...
user avatar
0 votes
1 answer
2 views

Node that Subscribes then Publishes to another node

Hey guys, I am working on a project that requires me to subscribe to a node, make sure it is within a certain bounds then publish it to another. It subscribes and reads the information correctly ...
user avatar
0 votes
1 answer
3 views

eclipse and catkin_make not linking to ros.h dependencies

Hello all, So I am working on a project where I basically want to create a node to take information from another, check it, then publish that information elsewhere. I was working on it yesterday and ...
user avatar
0 votes
1 answer
26 views

How do i publish in a callback function?

Good evening, my problem is that i want to subscribe and publish in the same node. I need to publish in a callback function but the nodehandle is initialized in the ...
user avatar
0 votes
1 answer
8 views

How to subscribe to a topic, while publishing to another

Hey guys, I want to write a basic controller for a quadrotor. For a target_position it should take the current_position from a simulated quadrotor, calculate an error between the two and send the ...
user avatar
0 votes
1 answer
11 views

Listening to Publisher in Python from C++ Subscriber: Problem

Hello all, I have a publisher in Python that I want publishing an Integer value from 0-2. I want to subscribe to that publisher from C++ and obtain that value. Below is the relevant code: PYTHON: <...
user avatar