I still cannot understand the function of hardware interface and its relationship when doing simulation (Gazebo) and real robot

I got quite confused after watching both the courses “Model the robot with URDF” and “ROS control”. My question is, how can we move the robot in Gazebo by simply publish the velocity command in the course “Model the robot with URDF” with only the controller? My guess is that Gazebo by default use the DefaultRobotHWSim, so it still has a hardware interface. When building the real robot, we need to write our own hardware interface. Am I right about the whole thing?

Besides, I would like to know when we are running the algorithm on real robot, then we don’t launch gazebo, right? Only Rviz will be used for monitoring the robot status, am I right?

Hello @yunjinli ,

You are right, yes. Have a look at this tutorial, especially the 1st image that appears which shows what you are talking about.

Also yes, when working with a real robot you won’t be using Gazebo at all. You can, however, use other visualization tools such as RViz or rqt.

Hi @albertoezquerro! Thanks for the reply! After understanding more about ROS, I cannot help but admiring how modular it could be!!!