Controller algorithm implementation in ROS/Gazebo

asked 2020-02-03 23:50:15 -0600

fahadrazakhan gravatar image

I am doing some robotic simulations in ROS/Gazebo and wondering what is the best way (programming-wise since I don't have a CS background) to implement a robot's motion controller.

Here are the questions:

  1. Where should I call my Controller function (In a callback? which callback if I have multiple callbacks running simultaneously)?
  2. How to sync data coming from different nodes i.e. callbacks or Is there any way to subscribe to different topics with a single callback?
  3. What if my sensor nodes are running faster than my controller loop, then how should I implement the controller function?
  4. Should I process the data in a callback or process it in the controller function?
  5. What is the exact use of buffers in ROS subscribers?

Sorry for a long list of inquiries but these questions have been bothering me for some time and I would like to make my code more efficient and aesthetically pleasant at the same time if possible.

P.S: I am using C++ in ROS Melodic on Ubuntu.

edit retag flag offensive close merge delete


Sorry for a long list of inquiries but these questions

unfortunately it's not a good idea to post questions which consist of multiple questions: you'll either get no responses (as people can't answer all questions, so don't respond at all), or only responses to one or a few of them.

In addition: this makes the title of your question not actually convey what it is that you're asking help with. It's too generic -- which is likely caused by the fact that you have 5 questions in the body.

gvdhoorn gravatar image gvdhoorn  ( 2020-02-04 04:27:32 -0600 )edit