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

Questions tagged [timer]

The tag has no usage guidance.

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

adjusting Timer period as it is in use, RCLCPP

I am using a rclcpp Timer, namely: rclcpp::TimerBase::SharedPtr timer = this->create_wall_timer(100m, std::bind(&MyTimerProg::timer_callback, this)); I would like to adjust the timer period as ...
Can Altineller's user avatar
0 votes
0 answers
101 views

How do you change a ROS2 WallTimer period after initialization?

Is there a way in ROS2 to use the ROS1 WallTimer function setPeriod? I'm trying to change the timer's period in runtime in my C++ node. Currently I cancel the ...
Yato's user avatar
  • 58
1 vote
0 answers
342 views

error: no type named ‘type’ in ‘struct std::enable_if<false, void>’ when calling rclcpp::create_timer()

I am trying to convert a piece of code written in ROS1 to ROS2. I am having trouble with the following line, which instantiates a ros:::Timer object: in ROS1: ...
Natanel Birarov's user avatar
0 votes
0 answers
52 views

Multiple publishers and a timer to publish tf in the same node is leading to crash

Description I have a node that publishes 2 topics and a timer to publish TF using ros-noetic. However this setup throws an exception: ...
ignacio's user avatar
  • 125
0 votes
0 answers
31 views

how to manage a timer in a pytest?

I've got a Node that publish a message in a timer. The code works fine but I want to write a pytest to ensure the message is published. My test code is this one ...
SebL's user avatar
  • 51
0 votes
1 answer
7 views

noetic createTimer always segfault

Hi, After introducing ROS to my program with success, i wanted to use it more and added timer. I am using the same code on both Ubuntu20/noetic and Ubuntu18/melodic without any issue. But with timer i ...
user avatar
0 votes
1 answer
20 views

Can ROS timers be safe to clock jumps?

Ubuntu 20.04, ROS noetic It seems that ROS timers are not completely robust to clock jumps e.g. from daylight time savings. I created a ros::WallTimer that triggered every second and logged the ...
user avatar
0 votes
1 answer
61 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
2 answers
604 views

Create wall timer using callback with parameters - ROS2, C++

Hi. I have two image msg synchronized as follows: ...
user avatar
0 votes
1 answer
124 views

Do Timers run in different threads? [roscpp]

I'm wondering if I'm setting up different timers, do they run in different threads using roscpp? The background is that one Timer callback is taking a longer time to be executed and, therefore, I want ...
user avatar
0 votes
1 answer
942 views

How should I create a timer in ros2?

I am looking for the create_timer function in ros2 but I only find the rclcpp::Node::create_wall_timer. From my understanding there should be some abstract create_timer function (instead of wall timer)...
Pablo Iñigo Blasco's user avatar
0 votes
1 answer
29 views

createTimer() replacement in eloquent

In ROS1 we can simply do: ros::Timer timer = nh.createTimer(ros::Duration(0.1), timerCallback); This gives us a tick approximately every 100 ms of ROS time. In ...
user avatar
0 votes
1 answer
6 views

ROS Answers SE migration: Ros2 Stopwatch

Hi guys, I want to implement a timer thats working like a stopwatch to check if my joy_node is continously sending messages. Everytime it gets called the timer starts and if it doesnt get called again ...
user avatar
0 votes
1 answer
25 views

Timer callback function do not working when action server be called?

##Timer callback function do not working when action server be called?## Hello, I find a interested problem just now. It was action server callback function may ...
user avatar
0 votes
1 answer
17 views

how to use Twist with Timer()

I'd like to make the robot moves a certain time toward x-direction using Twist with Timer full code: ...
user avatar
0 votes
1 answer
17 views

Wait for timer to be stopped

Hi everybody, I'm working on a state_machine right now and I have the following problem: I have a ROS timer running on a timerCallback which supervises the current states and depending on the state ...
user avatar
0 votes
1 answer
44 views

ROS2 serious memory leak when using timer?

I have created almost the simplest ROS node possible in python with a single time doing nothing - code below. When I run it, memory consumption continuously increases and ultimately the my memory is ...
user avatar
0 votes
1 answer
35 views

In ROS2, is a wall timer connected to a node in a way meaningfull for a user

Hi, I need an object (a node) to create a timer in ROS2. I can create any node just in order to call the respective method create_wall_timer, but I would like to ...
user avatar
0 votes
1 answer
1 view

How to call a service with begin and end time as request/input

Hi, I am looking to call laser_assembler call back service -AssembleScans . ...
user avatar
0 votes
1 answer
8 views

Does ros::Timer::hasPending method actually work?

I used it expecting that it will return true after starting the timer, until the callback get's called (in a one-shot timer). But I turned out to be wrong; the following program will return always ...
user avatar
0 votes
1 answer
1 view

ROS Answers SE migration: ros timer bug?

Hi, I'm currently writing a simple application to publish a message only for certain time. For that I used a oneshoot timer which is setting a flag. The outcome was that the flag and so the timer ...
user avatar
0 votes
1 answer
15 views

ros::Time::now() very different in callback

Hi, I am getting very different results when calling ros::Time::now() in the main function and in a Timer's callback function. I want to get the elapsed time since the Timer began, so I have something ...
user avatar
0 votes
1 answer
11 views

How Timer Callback Function Does the Timing?

I want to know how accurate ROS timer is. So for example, I create the timer as follows: ...
user avatar
0 votes
1 answer
17 views

How to Improve Inaccurate ROS Timer

I use a ROS timer in my progarm and plot the difference between the expected event time and the real event time as follows: ...
user avatar
0 votes
1 answer
3 views

Publish at the time of a vector

Dears, I have a vector containing double type numbers representing the ros time that I recorded from a previous simulation. I need to publish data of a node at this given time. I try to explain better:...
user avatar
0 votes
1 answer
17 views

How does rospy.Timer behave if it triggers while the previous callback is still busy?

I'm using a rospy.Timer (periodic, not one-shot) to handle a long-running process in a non-blocking way. I only want one instance of the process to be running at ...
user avatar
0 votes
1 answer
6 views

does callbacks get drop from queue when it is exceeded it expected execution time by too much

Current I have a application with a timer which triggers at a fixed interval to grab a frame from a camera stream. This works fine when only two camera streaming at 720p are running. When all 3 of my ...
user avatar
0 votes
1 answer
8 views

Rosbag and simulated time

Hello all, I am trying to run a bag file if simulated time but I am not succeeding on it. Here is what happens: After I run the bag file with the command ...
user avatar
0 votes
1 answer
7 views

ROS Timer: difference between types of NodeHandles?

Dear all, a student approached me a day back with a question that I just couldn't answer: "Should a ROS timer be on a a private NodeHandle, or on a global one?" (or any other, obviously...) ...
Matthias's user avatar
  • 5,815
0 votes
1 answer
8 views

Thread safety and rospy Timer

I'm a little confused by how rospy.Timer works with regards to thread-safety. My understanding of callbacks in rospy in general is they're essentially handled sequentially during calls to Sleep and ...
user avatar
0 votes
1 answer
5 views

Timer fires all at once

I'm on Ubuntu 14.04 with ROS Indigo. I'm trying to repeat a published message for a few times, with some delay in between. It seemed that a ros::Timer was the tool ...
user avatar
0 votes
1 answer
27 views

Setting Timer period for next callback

Hi, I have a ros::Timer that I want to change the period for at each callback. In the callback function, I'm calculating the time I want the next callback to occur at and calling setPeriod. However, ...
user avatar
0 votes
1 answer
4 views

Right Angle Turn Problem

Hi, I'm trying to move my urdf model on a rectangular/square trajectory in rviz. In order to do that I try to broadcast certain transforms within certain time intervals using a timer. But the robot ...
user avatar
0 votes
1 answer
2 views

how to use Timer

I have read the tutorial on webpage, but still don't know how to use it,special don't know how to write the funtion void callback( ). I hope someone could tell me how to write and use it more ...
user avatar
0 votes
1 answer
4 views

How to keep a class "alive" (...and passing the same NodeHandle)?

Hi, here the minimal example I could create to explain a problem with my program which is splitted into 2 classes. One class creates an istance of the second one: Let's start with the main file: ...
user avatar
0 votes
1 answer
1 view

using simple timers in ROS - doesn't show up in rqt

I am on ROS Hydro (with Catkin). I made a node with a C++ timer, with the following code; ...
user avatar
0 votes
1 answer
3 views

Periodic long pauses between rospy.Timer callback calls

I have a Python node that contains a class similar to this: ...
user avatar
0 votes
1 answer
2 views

What am i doing wrong with ros::timer in rqt?

Hello, i have some problems with making the ros::timer work. Usually if i need a timer within a class i add these three lines to the header: ...
user avatar
0 votes
1 answer
65 views

How do I reset a rospy Timer?

How do I reset a rospy Timer? I want to have a Python node that sends out a message like cmd_vel as a step function to test a controller, but I also want to use ...
Thomas Denewiler's user avatar
0 votes
2 answers
3 views

ROS Answers SE migration: timer callback

Hello, all, Been searching for a while but I figured I'd ask directly. What are the pros/cons of using rate.sleep() to control loop frequency versus using a timer callback? From what I have gathered ...
user avatar
0 votes
1 answer
7 views

timing function for while loop

I was just wondering, if I want to write a while loop which says while x seconds hasn't reach execute this statement, how would I go about it? I tried using while(ros::Duration(x).sleep()){ .... } but ...
user avatar
0 votes
1 answer
12 views

Problem with ros::Timer

Hello I have trouble creating a timer in Ros. I defined a class in which one of its members is the timer callback. To create it, in the constructor of the class I put the following: ...
user avatar
0 votes
2 answers
8 views

Intermittent subscription to a topic with/without timer possible?

Hello, It is really important for me to know this before I start any coding. Here is what I want: A continuous stream of data is being published as a topic. (At frequency >= 50Hz). I want to read ...
user avatar
0 votes
1 answer
8 views

Threading function - udp client integration to a Ros node

Hi, I have working ROS node with callBacks for subscriptions, and also with timers like this: ...
user avatar
0 votes
1 answer
52 views

Ros::Timer, will stopping it with .stop() cause its counter to restart?

Hello, If I declare a basic timer like this: ros::Timer my_timer = nh.createTimer(ros::Duration(1), callback); And then I stop it like this (say, 0.5 seconds later)...
user avatar
0 votes
3 answers
12 views

Timer callbacks not working

Previously working timers in some of my packages/nodes have stopped working. The roscpp_tutorials/Tutorials/Timers example doesn't work either as the timer callbacks never execute. The program aborts ...
user avatar