Skip to main content
2 votes
Accepted

If i use a lambda function when creating a subscription, when it will be evaluated?

This pb is not ros2 related. cf explanations here : https://realpython.com/python-lambda/#evaluation-time They propose this nice solution : ...
SebL's user avatar
  • 51
2 votes

Where is the preffered position to put a simple control loop in a ROS2 Node (C++) for obstacle avoidance

I wouldn't overcomplicate it with what you're trying to do. Its extremely lightweight :-) this isn't ideal especially if the code took a while to run it could cause sensor messages to be missed You'...
Steve Macenski's user avatar
2 votes
Accepted

Where is the preffered position to put a simple control loop in a ROS2 Node (C++) for obstacle avoidance

In general computations specific to the node are implemented as member functions. If it gets way to big you should think about using different threads / callback groups or split your tasks up into ...
rubimat's user avatar
  • 106
1 vote

Multiple subscriptions in a single callback

There is no reason two messages will be received exactly at the same time, so when do you expect the function proc_signal_callback to be called? If the two topics ...
oKermorgant's user avatar
1 vote
Accepted

what is executors, and callbackgroup in ROS2?

and what is the difference between following code compared to above snippet? example code snippet_2 As explained in the ROS 2 Documentation page, "The call to spin(node) basically expands to an ...
ssarkar's user avatar
  • 596
1 vote

Is it bad practice to declare the node as a global variable to call a service from an external callback?

I don't 100% understand the full situation but here are a couple tips: Split your file into a header and source file, then include header whenever necessary. which will fix your issue with class ...
Sebastian Schroder's user avatar
1 vote

Whats the common way to setup a websocket client in ROS2 robot?

I have come up a ros2 websocket bridge node using python websockets library. You can find it in my GitHub repo. Any suggestion is welcome! I have tested it and so far it doing great. Thanks for all ...
tcluk624's user avatar
1 vote

Whats the common way to setup a websocket client in ROS2 robot?

I would use a synchronous websocket client like websocket-client, and run it in a separate thread from the ros code. My advice is to keep your ros code and your websocket code as separated as you can. ...
Mike973's user avatar
  • 946
1 vote

ROS2 node unable to receive new service calls after first call

I ran into a similar issue and wanted to share my solution since it took me a lot of searching and effort to figure out. In short: when using multiple callback groups you should use a ...
Andrew's user avatar
  • 11
1 vote

message_filters doesn't call the callback function

Doing a rostopic hz on each topic is a good starting point to make sure they are publishing at all. This could help debug further: https://github.com/lucasw/...
Lucas Walter's user avatar
  • 3,347

Only top scored, non community-wiki answers of a minimum length are eligible