Controller algorithm implementation in ROS/Gazebo

asked 2020-02-03 23:46:07 -0500

franky 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 in Ubuntu.

edit retag flag offensive close merge delete