A Comprehensive Guide to Building and Simulating Robots
Modeling, Simulation, and Control of 4-Wheeled Mobile Robot in ROS and Gazebo - From Scratch!
Estimated read time: 1:20
Learn to use AI like a Pro
Get the latest AI workflows to boost your productivity and business performance, delivered weekly by expert consultants. Enjoy step-by-step guides, weekly Q&A sessions, and full access to our AI workflow archive.
Summary
In this comprehensive tutorial by Dr. Aleksandar Haber, viewers learn the ins and outs of building, modeling, and simulating a 4-wheeled mobile robot using the Robot Operating System (ROS) and Gazebo from scratch. The video explains the entire process, from creating the robot's geometry to setting up a skid-steer controller and interacting with it via keyboard commands. Essential tools like URDF and Zacro files are covered, as well as setting up the necessary ROS nodes and packages for simulation. The tutorial emphasizes the importance of simulation for testing navigation and SLAM algorithms before real-world implementation, highlighting how this digital setup aids in refining robotic controls and dynamics efficiently.
Highlights
Aleksandar's tutorial offers a step-by-step process for robot simulation in Gazebo using ROS. 🛠️
Keyboard commands serve as an interface to control robot movements in the virtual environment. ⌨️
The tutorial clarifies the importance of various ROS packages and their roles in creating a realistic robot simulation. 📦
Key Takeaways
Building digital twins for testing algorithms in a virtual environment is crucial before real-life implementation. 🤖
URDF and Zacro files are essential for defining robot geometry and dynamics in ROS and Gazebo. 📐
Simulation in Gazebo provides an accurate physics-based environment to validate robot behaviors and control. 🌍
Overview
In the tutorial, Dr. Aleksandar Haber walks us through creating a fully functional 4-wheeled robot model. This includes everything from scratch, utilizing tools like the Unified Robot Description Format (URDF) and the Gazebo simulator.
Viewers will learn how to set up a Gazebo environment and control the robot using keyboard commands, showcasing practical applications of ROS nodes and messages. The video makes complex robotic simulations accessible and straightforward, especially for beginners.
By the end of the tutorial, participants have a comprehensive understanding of how to model robot dynamics, simulate its controls, and why these skills are valuable in robotics research and development.
Chapters
00:00 - 00:30: Introduction In the introduction, the tutorial outlines the creation and simulation of a four-wheeled mobile robot using Robot Operating System (ROS) and Gazebo. It begins with building the robot's geometry from scratch, followed by adding its dynamic description and a controller for keyboard control. The chapter provides an overview of the Gazebo simulation that illustrates the robot operations.
00:30 - 02:30: Simulation Overview This chapter provides an overview of a physics simulation for a robot. It explains that the simulation accurately represents the robot's true dynamics. The tutorial illustrates how to control the robot's motion using keyboard keys: press 'k' to stop, 'I' to move along a straight line, and use different keys to reverse the motion.
02:30 - 09:00: Modeling the Robot The chapter titled 'Modeling the Robot' discusses the mechanisms involved in controlling and observing the robot's states. The chapter explains that the robot can be rotated around its axis, a function facilitated by multiple ROS (Robot Operating System) nodes operating in the background. These nodes manage control actions that are relayed as a 'Twist' ROS data structure, which is then transformed into mechanical motion, enabling the robot's movement and rotation.
09:00 - 13:00: Defining Controllers The chapter titled 'Defining Controllers' focuses on the development of a Skid Steer Drive controller within the Gazebo simulation environment. The tutorial emphasizes the potential for enhancements by adding cameras, sensors, LiDAR, navigation, and SLAM (Simultaneous Localization and Mapping) algorithms in future lessons. It highlights the importance of creating a digital twin of a robot to test and confirm the functionalities of path planning, navigation, and SLAM effectively. The ultimate goal is to equip users with the skills to develop and simulate robotic controls in a virtual space.
13:00 - 18:00: Preparing the Workspace The chapter 'Preparing the Workspace' guides readers on the importance of testing algorithms in a simulation environment before implementation in real systems. It focuses on building a robot model for verifying navigation and SLAM algorithms. The content acknowledges the availability of online tutorials for creating and simulating robot models in Gazebo but points out that many are incomplete.
18:00 - 32:00: Creating Control and Launch Files In the chapter titled 'Creating Control and Launch Files,' the speaker begins by addressing the presence of misinformation in existing resources and expresses their intent to clarify the modeling steps comprehensively. They highlight the effort, energy, and planning that went into creating the tutorial, emphasizing that it is part of a larger collection of over 400 free video tutorials available on their YouTube channel. The speaker urges viewers to support their work by liking and subscribing to the channel.
32:00 - 37:00: Executing Simulation In this chapter, titled 'Executing Simulation,' the focus is on creating a model of a four-wheel robot using the Unified Robot Description Format (URDF) and Zacro, a macro language for URDF files. The chapter promises a video tutorial that will walk the reader through the simulation creation process, encouraging comments and inquiries in the comments section for further clarification.
37:00 - 40:30: Controlling the Robot in Gazebo This chapter focuses on controlling a robot within the Gazebo simulation environment. It begins with preparing a launch file to ensure URDF models can be interpreted by Gazebo. The chapter proceeds to teach loading URDF models into Gazebo. Finally, it covers simulating the Skid Steer Drive controller specifically for a four-wheeled robot. The initial step involves testing the Gazebo installation and installing necessary packages.
40:30 - 42:30: Behind the Scenes In the chapter titled 'Behind the Scenes', the focus is on verifying the installation of the 'gazebo' software. The narrator demonstrates how to open the terminal, adjust its size for better visibility, and type 'gazebo' to check if the software is installed correctly. If installed, a new window should appear, confirming the successful installation of 'gazebo'. Otherwise, the narrator suggests referring to a separate tutorial they created, which provides instructions on installing Ross.
Modeling, Simulation, and Control of 4-Wheeled Mobile Robot in ROS and Gazebo - From Scratch! Transcription
00:00 - 00:30 hello everyone and welcome to mechatronics and Robotics tutorials by using Robot Operating System in this tutorial we will learn how to build a model and simulate a four-wheeled mobile robot in gazebo first we will create a robot geometry from scratch then we will add the dynamical description of the robot and a controller that will enable us to control the robot by using the keyboard Keys over here you can see the gazebo simul ation of the robot that we will
00:30 - 01:00 create in this video tutorial here you should keep in mind that this is a physics simulation that relatively accurately represents the true dynamics of the robot we can control the robot motion by pressing the corresponding key for example I can stop the robot by pressing k then I can move along a straight line by pressing I then I can stop the robot I can reverse the motion easily by pressing another key
01:00 - 01:30 and I can rotate the robot around its axis like this or like this behind the scenes there are several Ross nodes that are running and that enable us to control the robot and observe robot States the control actions are actually sent as a Twist Ross data structure that is converted to Mechanical motion by using the so called
01:30 - 02:00 gazebo Skid Steer Drive controller the model developed in this video tutorial can be improved by including cameras sensors lighters navigation and slam algorithms we will cover these topics in our future tutorials the main motivation for creating this video tutorial comes from the fact that you will often need a simulation environment and a digital twin of a robot to verify path planning navigation and slam
02:00 - 02:30 algorithms it is always a good idea to test the algorithm in a simulation environment before you actually implemented in the real life system this tutorial teaches you how to build a robot model that can be used for verification of navigation and slam algorithms also I noticed that online there are a number of tutorials that explain how to build a robot model in gazebo and how to simulate it however these tutorials are either incomplete or
02:30 - 03:00 they convey inaccurate information consequently I'm creating this tutorial to once for all clarify all the modeling steps but before I start with explanations I would like to mention the following it took me a significant amount of time energy and planning to create this completely free video tutorial as well as more than 400 free video tutorials that you can find on my YouTube channel consequently I kindly ask you to press the like And subscribe
03:00 - 03:30 buttons also please feel free to leave any comment or a question you might have in the comment section below this video tutorial thank you here is a brief outline of this video tutorial first we will learn how to create a model of the four-wheel drot by using the unified Dro description format or urdf and zacro zacro is a macro language for urdf files then with we will learn how to write a
03:30 - 04:00 launch file such that urdf models can be interpreted by gazebo then we will learn how to load the urdf model in gazebo and finally we will learn how to simulate the Skid Steer Drive controller for four-wheeled robot okay let's start in the first step we need to test the installation of gazebo and we need to install the necessary packages so let's start first first start a
04:00 - 04:30 terminal and then I'm going to change the size of this terminal so that you can see over here what I'm typing and I will simply type gazebo and if gazebo is installed properly you should see this window if you see this window then gazebo is installed on your computer if not you need to install gazebo I created a separate tutorial that explains how to install Ross namely
04:30 - 05:00 gazebo comes with the default installation of Ross next let us verify the Gazebo version by typing this you can see that my gazebo version is 11.11 consequently everything that I will explain in this video tutorial is valid for this gazebo version next we need to install the necessary packages here are the packages that we need to install
05:00 - 05:30 the name of the first package is Ross no gazebo Ross package it is a set of Ross packages that provide the necessary interfaces to simulate a robot in the Gazebo 3D Rigid body simulator it integrates nicely with Ross and it uses Ross messages services and other packages the next package is Ros noi Gazo message this package provides
05:30 - 06:00 messages and service data structures for interfacing Ross and gazebo the next package is Ros noi gazebo plugins this is a robo independent gazebo plugin for sensors Motors and dynamic reconfigurable components finally we need to install another gazebo package and the name of that package is Ros noi gazebo Ross control this package is very important
06:00 - 06:30 since it provides controllers and other packages that will enable us to move our robot finally we need to install this package the name of the package is Ros notic teleop twist keyboard this package will enable us to control the robot by using the keyboard Keys let's install these packages first I'll type this and in my case you will see that this package is already installed however in your case case you will see the installation
06:30 - 07:00 progress then run this command to install another package then you need to run this command then you need to install this package and finally you need to install this package the next step is to create the
07:00 - 07:30 workspace and the catkin package for our robot to do that we first need to create the main folder of our package I call this fold folder robot 4 and inside of this folder I'm also creating a source folder note over here that you can change this name robot 4 however the name of this subfolder should not be changed then let's go to our new folder
07:30 - 08:00 for our package and let's run catkin make catkin make will actually initiate the workspace and create the initial package the next step is to Source this file inside develop folder there is a file setup. bash and we need to Source this file this is a very important step next let's let's verify the Ross path to
08:00 - 08:30 make sure that we have properly sourced our package or our workspace and you can see over here that we actually sourced this folder this is very important next let's go to the source folder and let's create the package here is the package to create the package I'm calling this command catk can create
08:30 - 09:00 package then here I specify the name of the package and over here I specify the dependencies my package called robot model package will include the following packages gazebo messages gazebo plugins gazebo Ross and gazebo Ross control note that we have already installed these packages so let's do that let's create a package
09:00 - 09:30 here it is Step number three in Step number three we will create the source files defining the robot geometry that is we will Define urdf and zacro files to do that let's move to our package folder and inside of this folder we will make another folder called urdf this folder will contain the
09:30 - 10:00 geometrical description of our robot next let's move to that folder by typing this and inside of this folder we will create this file robot do zacro this file will contain the geometrical description of our robot to make this video tutorial as short as possible I already created the macro file and here it is and I will
10:00 - 10:30 totally explain this file also to make your life a little bit more easier I will provide a link to this file and to all the files that I will explain in this video tutorial I will provide a link to my GitHub page and all the codes will be posted on my GitHub page every zacho and urdf file starts with this line and you shouldn't change this line over here you can see my
10:30 - 11:00 comments you use these symbols to start a comment and this set of symbols to end a comment then we start the robot section over here we start the section and at the end of the file we end the section like this then we specify the name of the robot in my case the name is differential Drive robot however you can change this name then you shouldn't change this part
11:00 - 11:30 next we specify the geometrical dimensions of our robot however we use parameters to specify the dimensions such that we can change these parameters as we wish here is the top view of my robot showing all the dimensions except the dimensions in the Za axis Direction however you will see them in the code my robot is actually a box with a dimension 0.6 in the Y Direction one One
11:30 - 12:00 in the X Direction and in the Z Direction it's 0.3 consequently I need to specify these parameters body link X Dimension one body link y Dimension 0.6 and body link Z Dimension 0.3 next I specify wheel Dimensions wheel link radius is 0.15 as you can see over here
12:00 - 12:30 then the length of the cylinder is 0.1 and I need to specify that over here and I specify the wheel link Z location that is this is the location of the center of the wheel in the Z Direction it's equal to minus 0.1 next I specify material density I have a body and I have wheels I assume that body and wheels are made of aluminum and here I specify the
12:30 - 13:00 density of aluminum next I Define the constant I will need Pi constant and here is the value I will need this constant to compute moment of inertia areas and some other parameters next I need to specify the robot body and the whe Mass here's my body mass and here's the wheel Mass I actually calculate over here here my body mass by using these
13:00 - 13:30 parameters that is I simply multiply body density with the body volume of my robot then I do the same thing for my wheel I do it like this and here's the power of zacro you can actually enter formulas like this you will simply use the dollar sign then you will create this section and inside you will simply enter the formula simple as that and that's the power of zacro
13:30 - 14:00 modeling over here I compute the moments of inertia of the wheel this is the moment of inertia with respect to the z-axis and this is the moment of inertia with respect to X and ya AIS again I use very well-known formulas given over here for moments of inertia of a cylinder next I Define a specific macro this macro will actually Define an
14:00 - 14:30 environment in appropriate link section later on in the code I will explain this part later on now over here I include the file that defines extra gazebo options and motion control drivers I will explain this file later on in this video tutorial for the time being just type this over here I Define links and joints of my robot but
14:30 - 15:00 wait a second water links and water joints let's look into the structure of our robot essentially this robot consists of five parts we have body and we have four wheels in Ross terminology elements that is the structural elements such as a body links or wheels are actually called links consequently I have I have a body link
15:00 - 15:30 and I have four additional links I have wheel one link wheel 2 Link wheel three link and wheel four link then between every link I need to have a joint that is there is a joint connecting my body link that is the body and wheel one link and the joint is actually shown over here this is the coordinate frame of V one joint consequently I I have a joint over here
15:30 - 16:00 I have a joint over here and I have a joint over here let's define these geometrical elements first of all I need to define a dummy link otherwise gazebo will complain and over here I start my link section I call the link dummy and I end the link section next I need to assign a joint to that link I call the joint dami joint type is fixed and what do I do
16:00 - 16:30 over here I specify the parent link the parent link will be dummy link and the Child Link will be the body link and that's it note again that I need to have this link otherwise gazebo will complain okay let's start with the geometry of our robot here is the body link of the robot I start the link section over here and I end the link section over here here over here is the visual
16:30 - 17:00 representation of my link here I Define the geometry it's a box with the dimensions body link X Dimension body link y Dimension and body link Z Dimension that is the dimensions of the box in the X Y and Z Direction notice over here that these are the parameters defined at the top of this script okay next I need to define a coordinates system attached to the center of the mass of my
17:00 - 17:30 box XYZ is actually the translation of this coordinate system with respect to XY Z axis and with respect to the coordinate frame or coordinate system attached to the parent joint and in this case the parent joint as you can see over here is a dami joint rpy are roll pitch and yo rotations of the coordinate systems that is these parameters represent the
17:30 - 18:00 orientation they're all set to zero next I Define the Collision section you don't need to know more about the Collision section at this point for the time being you can just simply copy and paste this part over here the Collision section is very important if you want to simulate the Collision of elements that is you can detect collisions in that way if this geometric Al area is being violated next I need to
18:00 - 18:30 define the inertial properties of my link and over here I Define the mass moment of inertia I use the classical formula here they are this is the moment of inertia with respect to xaxis this is the moment inertia with respect to the Z AIS and this is the moment of inertia with respect to the Y AIS and I use the standard form formula for the moment of inertia of a box or of a cuboid as it's
18:30 - 19:00 officially called by using mathematical terminology and that's it this is the body link of the robot let's continue with the back right wheel of the robot and its joint first we will Define the wheel one joint its frame is located over here let's do that we start the joint environment and over here we end the joint envir environment first we need to specify the parent link let's
19:00 - 19:30 look at this picture the parent link is actually the body link and the Child Link is wheel one link note over here that I still didn't Define wheel one link however you can simply write write it as a child over here next we need to specify the origin that is the frame of wheel one joint and as you can see over here this Frame is
19:30 - 20:00 displaced with respect to the dummy frame that is the dummy frame is the parent frame of the body link and we always need to define the orientation and position of the joint with respect to that initial frame and we do that recursively that is we always specify joint frame with respect to the previous joint frame this is very important to keep in mind and here are the
20:00 - 20:30 dimensions they're parameterized like this and these parameter parameters are actually defined at the top of this script next we specify the axis of rotation let's look at the picture we can see over here that the wheel rotates with respect to the Y AIS and consequently over here we have 0 1 0 next we specify the limit effort and velocity then we specify the Dynamics of
20:30 - 21:00 our joints we specify the damping and we specify the friction you can change these parameters and you can tune them and that was the first joint that is the wheel one joint next we Define wheel one link here we Define the visual description of the link We specify the origin rotation that is we specify the correct rotation this is very important why let's look at the
21:00 - 21:30 picture if we create a simple cylinder in gazebo this cylinder will be extruded with respect to the Za axis however we need to rotate the wheel such that it stands in its correct position and location and we need to perform rotation around the X AIS to bring it in this position consequently over here we specify the roll rotation that is the rotation around the x axis and this rotational
21:30 - 22:00 angle is actually given in radians this rotational angle in degrees is actually equal to 90° keep in mind here you need to specify the rotation angle in radians and over here we specify the geometry of the cylinder we specify the length of the cylinder we specify the radius of the cylinder and that's it that's the visual representation here is Collision Collision is simply obtained
22:00 - 22:30 by copy and pasting the visual representation and here comes a very important part over here I'm actually using macros to speed up the coding that is to make my code more Compact and to speed my coding process so what's happening over here let's go back and let's look into this link that is into the body link if we follow this notation we will
22:30 - 23:00 have to define the same section over here however we need to do that for all four wheels so is there a quicker way to do that yes there is we can simply create a macro and here's the macro that will automatically add the piece of the code to the appropriate wheel sections since this pie Pat of code will repeat four times and what's
23:00 - 23:30 happening over here we're defining the mass moment of inertia of our wheel we use the classic formulas for the mass moment of inertia of a cylinder we specify the mass we specify the inertia for the xaxis the inertia for the Y AIS and the inertia for the Z AIS and that's it so what will happen over here once this script is being add the compiler will
23:30 - 24:00 simply add this part over here and that's it next we need to create the back left ve of the robot and the joint here is the code again the procedure is equivalent we Define The Joint then we Define the link and that's it we are actually defining this wheel over
24:00 - 24:30 here again here is the code such that you can type it then we model the front right wheel of the robot and the joint where is the front right wheel the front right wheel is actually located over here and here is the code defining the front front right
24:30 - 25:00 wheel finally here is the code defining the front left wheel of the robot and the corresponding joint here it is and we modeling this wheel and that's it we end our file with the end of the robot section as I mentioned previously the
25:00 - 25:30 geometrical description presented in this file is not complete and consequently we will not be able to simulate the robot only on the basis of this file that's why over here we're including another file and the name of that file is robot. gazebo that file contains additional information that will enable us to simulate the complete robot in Gazo and let's create that file first let's save this file and let's
25:30 - 26:00 close it then let's see our file here it is next we will create the robot. Gazebo file so we will type gedit robot. gazebo and here it is and here I will simply paste the file and I will save it let us explain this file over over here this code line shouldn't be changed
26:00 - 26:30 again here are the comments I start my robot environment and I end my robot environment at the end first I need to specify the friction coefficients for the body link here they are 0.2 and 0.2 then I need to specify the color of my body link over here I'm using red color then I do the same thing for wheel one
26:30 - 27:00 link wheel 2 Link wheel 3 link and wheel 4 link as you can see over here I use the same parameters the friction coefficients and all the wheels are yellow so if you type this code be careful over here you need to use this environment gazebo and you need to end gazebo that is whenever you want to Define any property you will start the section gazebo and will end the section
27:00 - 27:30 gazebo next we need to create a section corresponding to the controller for the four-wheeled robot so what is a controller the controller is a virtual device that will receive commands from our keyboard and that will transform this these commands into robot motions we will be using the so-called Skid Steer Drive controller we need to start the plug-in and we need
27:30 - 28:00 to end the plugin over here in the Gazebo environment we specify the name of the plugin we specify the file name and watch out this is a Ross plug-in and we specify the parameters of our controller over here we specify the control update rating Hertz it is 100 Hertz over here this part you should leave empty then we specify the robot
28:00 - 28:30 kinematics we specify the left front joint here it is the right front joint the left rear joint and the right rear joint notice that these joints are defined in the previous robot. zacro file then we need to specify the wheel separation that is we're specifying this distance from here to here and here it is and we need to specify
28:30 - 29:00 the whe diameter the whe diameters is actually two times the whe link radius so make sure that this is correct next we need to specify the maximum torqus that our Wheels can produce and over here since I have a relatively big robot made out of aluminum not out of plastic I'm specifying a very large torque to make sure that I can actually move my robot however you can modify this parameter
29:00 - 29:30 depending on the material of your robot and depending on its dynamical properties as well as other properties next we need to define the appropriate topics we will send the control commands by using the twist Ross data structure that is we will be using this standard common velocity topic this common velocity topic will be used to communicate velocities and angular velocity of our
29:30 - 30:00 robot these velocities will be sent actually to the controller and the controller will Implement them that is the controller will move the wheels such that the desired velocity is achieved next we want to send some information back and we are using the autum odometry topic then we need to specify the odometry frame and we need to specify the robot frame to calculate automet from we are
30:00 - 30:30 specifying dami then we publishing wheel TF that's why we're specifying true here and we are publishing automet and we are specifying true over here next we also want to publish wheel joint State that's why we have true over here and this part is required by gazebo that is I need to specify the appropriate covariances here they
30:30 - 31:00 are next let's save this file and let's close our G editor okay the next step is actually to create the launch file and to launch the file in gazebo so let's do that let's go back to our terminal let's go to this folder and in this folder let us create the folder called launch here's the
31:00 - 31:30 folder let then let's go to that folder and in the lunch folder we will create this file called robot uncore zacro do lunch let's create the launch file here's our launch file we start the launch environment and close the lunch environment and notice over here that again we have this
31:30 - 32:00 default line the first step is to tell to gazebo the world that we start with namely when we want to simulate a 3D model we want to actually embed this model in a 3D World and consequently we are actually specifying a path to this file empty world. lunch this is a gazebo lunch file that inside of itself will launch the default empty world and over here we
32:00 - 32:30 specify the parameters we are using the simulation time we will be definitely using the graphic user interface and we specify this parameter which is not very important and this parameter that is also not very important now this part is super important over here we actually load our robo. zacro file this file defines the geum of the robot and notice what's happening over here we actually
32:30 - 33:00 trying to locate this command zacro by looking into the path then look what's happening over here we need to specify relative path to the robot. zacro file and we again use these commands next we need to start our gazebo simulation with the robot State publisher node and we do that by simply specifying node name and the package this is the package and the type and
33:00 - 33:30 finally over here we create the 3D model of our system that is of our world and of our robot this is how we do that we use the urdf spawner we use gaze Ros we use this type we use this command output is the screen and here are the arguments these are pretty much standard param me next let's save this file let's close this
33:30 - 34:00 window and let's go back to the terminal next let's do the following we will go to the base folder and over here we will run again catkin make okay perfect next let us run our world that is let us start the Gazebo simulation to do that that we actually need to invoke a Ros score to start the Ros score we
34:00 - 34:30 will open a new terminal over here and we will type Ros score this is our Ross Master anytime you want to run a Ross nodee you need to have this program running in background and finally we can launch our gazebo model so let's do that go back to the original terminal and execute this code line and let's see what will
34:30 - 35:00 happen here it is here is our gazebo simulation one thing that I like to do is to change the light so I will click over here and I will add more light over here to my simulation for example I will zoom out and I will place the light over here then I will do the following I will click on lights then here's my light and I will change it a little bit I will
35:00 - 35:30 play with attenuation over here there is a constant and continuation however I will decrease that and I will do another thing I will click on pae over here and I will move my light a little bit up such that we can have nice lightning over here perfect however there is one issue with our simulation we cannot move the robot to be able to to move the robot we need to run another node we need to run this
35:30 - 36:00 node teleop Twi keyboard and we need to run this python file this python file will enable us to control the robot by using the keyboard keys so let's do that I will simply copy this line then I will go to my terminal over here I will open a new terminal and in this new terminal I will simply paste this command and let's see the outcome what will happen ahuh let me expand this so you can
36:00 - 36:30 clearly see what's happening over here let's see what's written over here we can move the robot by pressing these Keys UI o j k l m command dot then we can change the velocities we can change the linear angular velocities by pressing W and X for the linear velocity and E and C for the angular velocity
36:30 - 37:00 Let's test this now if you would now just click over here as I did and if you try to press for example the key I that should move the robot nothing will happen this is because this terminal that is this part over here should be active when you're are doing this so what I do usually I actually move my robot over here that is I slide
37:00 - 37:30 The View then I do this and I click over here and now I can control the robot let's see what will happen if I press J if I press J the robot will rotate counterclockwise around its z-axis perfect to stop the robot motion press k then let's move the Rob along a straight line to do that I will press I
37:30 - 38:00 and you can see the robot moves then again press k then to move in the opposite direction press comma then press K again to stop the robot then you can press L to rotate the robot clockwise and press K and you can drive the robot like this then if you press U the robot will describe this motion very interesting it will actually
38:00 - 38:30 move left or right so for example if you press U it's going to move right if you press l or o it's going to move in the opposite direction side so U and O can be used to steer the robot left and right as I'm doing it right now and I can be used to force the robot to move along the straight line similarly if you press
38:30 - 39:00 M and Dot you will achieve steering left or right and if you press comma the robot will move along the straight line on only in the opposite direction with respect to direction of the I key and that's it this is how we drive the robot simple as that let's press L and oh let the robot rotate like this let us now investigate
39:00 - 39:30 what's happening behind the scenes to do that open a new terminal and in this new terminal type Ross topic list this will list all active topics and for us the most important topics is this one and this one this topic is actually used to transfer commands from our keyboard to a robot and let's see more about this
39:30 - 40:00 topic let us obtain more information about our Command topic consequently I will type this Ros topic info command velocity and let's see the output ahuh we can see the data type we are sending geometry messages twist that is we are sending the twist data structure The Twist data structure defines linear and angular velocities that are actually commands for our controller we can see the publisher the
40:00 - 40:30 publisher is teleop Twist keyboard that is here's our publisher this note the subscriber obviously is gazebo and gazebo transfers the information to the controller and that's it this is a very important information