In this post, we will install ROS Noetic Ninjemys. As of the date of this tutorial, ROS Noetic Ninjemys is the latest ROS distribution that has long term support. It will be supported until May 2025.
You Will Need
In order to complete this tutorial, you will need:
The official steps for installing ROS are at this link at ROS.org, but I will walk you through the process below so that you can see what each step should look like.
Now, update the package list. This command makes sure you have the most recent list of software packages that can be installed in your Linux system.
sudo apt update
Now do a full desktop install of ROS. The command below installs all the software, tools, algorithms, and robot simulators for ROS.
sudo apt install ros-noetic-desktop-full
After you type the command and press Enter, press Y and hit Enter when asked if you want to continue. It will take a while to download all this stuff, so feel free to take a break while ROS downloads to your system.
Set up the environment variables. These variables are necessary in order for ROS to work.
Type the following commands, one right after the other. We are using Bash, so this is what we type:
All the ROS software packages that you create need to reside inside a catkin workspace. The name of this catkin workspace can be anything, but by convention, it is typically called catkin_ws.
Open a new terminal window, and type the following commands, one right after the other.
First create the workspace.
mkdir -p ~/catkin_ws/src
Move inside the workspace.
cd ~/catkin_ws/
Build the workspace.
catkin_make
You should now have a build, devel, and src folder. Type this command to see those:
dir
Now, source the new setup.*sh file. This is a file that makes sure your workspace is recognized in your ROS environment.
source devel/setup.bash
Let’s add this code to the .bashrc file so that we don’t have to run it everytime we open a new terminal window.
We can check to see if that was set up properly by typing this command:
echo $ROS_PACKAGE_PATH
Finally, let’s launch a program to do a final check everything is set up properly. We will launch a simulation of a turtle.
Open a new terminal window, and type this command:
roscore
Open a new terminal tab, and type this command:
rosrun turtlesim turtlesim_node
Here is what you should see:
Congratulations. You have installed ROS!
From here, you can go check out the basics of ROS Noetic Ninjemys. If you’re already familar with ROS, it is often helpful to go through these tutorials to refresh the basics.
If you’re an absolute beginner to Creo Parametric, this tutorial is your guide. We’ll go step-by-step through the most common functions you’ll use again and again as you work with Creo Parametric for your design work. By the end of this tutorial, you’ll know how to create the animated part below.
Creo Parametric is a powerful 3D modeling CAD software program that is used by engineers all over the world. Without further ado, let’s get started!
Click OK on the window that pops up once you’ve selected your desired working directory.
Click New.
Select Sketch.
Click OK.
Go to File -> Options -> Sketcher.
Under “Accuracy and Sensitivity” change the Number of decimal places for dimensions to 3 (I like to use 3 decimal places).
Click OK.
Click No at the prompt.
Click the small arrow next to Rectangle on the Sketch tab on the top of your screen.
Select Center Rectangle.
Click a point anywhere.
Drag to create a rectangle.
Click another point to create the rectangle.
Click the Select button to stop creating rectangles.
Double-click on one of the dimensions in order to alter it. In this case, I will make both the length and the width equal to 10.000.
The little green squares indicate the constraints. For example, the green square with the black line indicates that the corresponding side of the square is exactly horizontal. Likewise, the sides are vertical.
To shift the view on the screen, you hold down the Shift key on your keyboard while holding down the middle mouse button (or pressing the scroll wheel on your mouse). It is a bit awkward, but it is what it is.
Similarly, to rotate the object in your view, hold down the Ctrl key on your keyboard while pressing the middle mouse button (or pressing the scroll wheel on your mouse).
You can move the position of the dimension labels (e.g. the 10.000 markets) but click on them and dragging them to where you want them to be.
To save your rectangle, go to File -> Save and then click OK.
The default selection for Type is Part and Solid for Sub-type. These are fine.
Uncheck the Use default template checkbox.
Click OK.
Select your units. Creo Parametric enables you to choose a variety of predefined systems of units.
I’ll select mmns_part_solid. mmns means millimeter Newton second, where all lengths are in millimeters, force will be in Newtons, and time will be in seconds.
Click OK.
What you see in front of you are three different planes: RIGHT, TOP, and FRONT. These are the three dimensions that your part design will be limited to.
In Creo Parametric, the defaults are:
RIGHT = YZ plane
TOP = XZ plane
FRONT = XY plane
Let’s select the FRONT plane by clicking on it. This is your standard XY plane in the Cartesian Coordinate system.
Click the Extrude button.
Click the Sketch View button to flatten the sketch. The Sketch View button is on the small toolbar above the sketch.
Click File System in the upper-left part of the screen.
Select the file we’ve been working on so far and click Open.
Click in the middle of the screen to place the sketch.
Move it to the center of the x-y reference lines by clicking the circle in the middle and dragging it to the origin.
Up top on the bar, you can scale the image to 1.000. To the left of the green checkmark you should see a white box. Put 1.000 in this box, and then click the green checkmark.
Now press OK again.
Hold down the middle mouse button (or scroll wheel) while moving your wrist in order to rotate the object and see it in three dimensions.
Change the Depth to 2.000.
Click OK.
Save it by going to File -> Save or clicking the Save icon at the top-left of the window.
To examine the dimensions of the part, click on Extrude 1 on the left side of the window.
Press Ctrl + E or click the Edit Definition button.
Click Placement -> Edit.
Click the Sketch View icon on the small toolbar to flatten the sketch. You can see the dimensions.
Mechanisms in Creo Parametric enable cool animations.
At the top-left of your window, there is a small arrow that enables you to change windows. Go to the assembly .ASM file.
On the left-hand side, select the circle-rectangle plate part, and click the Edit Definition icon (or type Ctrl+E).
Click Placement.
Right-click on Coincident.
Click Delete.
Right Click on Distance.
Click Delete.
Go to User Defined dropdown menu, and Select Pin.
Click the arrow on the circle-rectangle plate that is parallel to the nail and hold down your mouse.
Slide the plate off the nail.
Click the interior hole of the circle-plate combination.
Drag the cursor to a point on the nail cylinder (i.e. shaft). We have now connected the two surfaces.
Now click on the flat part of the circle-rectangle plate, and connect that surface to the surface of the nail head that faces the plate.
In the dropdown menu, select Distance.
Change Distance to 20.000.
Now change to 15.000.
Click OK (the green check).
Click the Applications tab.
Click Mechanism.
Click the Servo Motors tab.
Click Profile Details.
Select Velocity in the dropdown menu.
Change Velocity to 10 mm/sec.
Now click on the part.
Press OK.
Click on Mechanism Analysis.
Change End Time to 100.
Click Run to run the animation. Here is what you should see:
You can exit when you want to.
Regenerate the model in order to rebuild the changes you have just made.
Click Save.
You can exit the software.
That’s it!
What I have shown you is a quick taste of some of the things Creo Parametric enables you to do. There is much more functionality than what we’ve gone through, but you now have experience with the basics.
In this tutorial, we’ll learn how to create a ROS package. Software in ROS is organized into packages. Each package might contain a mixture of code (e.g. ROS nodes), data, libraries, images, documentation, etc. Every program you write in ROS will need to be inside a package.
Each ROS package is designed to produce some functionality. ROS packages promote code reuse.
ROS packages promote software reuse. The goal of a ROS package is to be large enough to provide a specific useful functionality, but not so large and complicated that nobody wants to reuse it for their own project.
ROS packages are organized as follows:
launch folder: Contains launch files
src folder: Contains the source code (C++, Python)
CMakeLists.txt: List of cmake rules for compilation
package_name is the name of the package you want to make, and depend1, depend2, depend3, etc., are the names of other ROS packages that your package depends on.
Now, open a new terminal window, and move to the source directory of the workspace you created. If you don’t already have a workspace set up, check out this tutorial.
cd ~/catkin_ws/src
Create a ROS package named ‘hello_world’ inside the src folder of the catkin workspace (i.e. catkin_ws). This package will have three dependencies (i.e. libraries the package depends on in order for the code inside the package to run properly): roscpp (the ROS library for C++), rospy (the ROS library for Python), and std_msgs (common data types that have been predefined in ROS … “standard messages”).
Type dir , and you will see that we now have a package named hello_world inside the source folder of the workspace.
Change to the hello_world package.
cd hello_world
Note, we could have also used the ROS command to move to the package.
roscd hello_world
Type:
dir
You can see that we have four files:
CMakeLists.txt: This text file contains the commands to compile the programs that you write in ROS. It also has the commands to convert your source code and other files into an executable (i.e. the code that your computer can run).
include: Contains package header files. You might remember when we wrote header files in the C++ tutorial…well this folder is where your header files would be stored.
src: This folder will contain the C++ source code. If you are doing a project in Python, you can create a new folder named scripts that will contain Python code. To create this new folder type:
mkdir scripts
package.xml: This is an Extensible Markup Language (XML) file. An XML file is a text file written in a language (called XML) that is easy to read by both humans and computers. An XML file does not do anything other than store information in a structured way.
Our package.xml file contains information about the hello_world package. You can see what is inside it by typing:
gedit package.xml
That’s it! You’re all done.
Note that if you ever want to go straight to a package without typing the full path, ROS has a command to enable you to do that. In the terminal window, type the following:
roscd <package_name>
For example, if we want to go straight to the hello_world package, we would open a new terminal window and type the following command:
roscd hello_world
Compiling a Package in ROS
When you create a new package in ROS, you need to compile it in order for it to be able to run. The command to compile a package in ROS is as follows:
catkin_make
The command above will compile all the stuff inside the src folder of the package.
You must be inside your catkin_ws directory in order for the catkin_make command to work. If you are outside the catkin_ws directory, catkin_make won’t work.
To get to your catkin_ws directory, you can type this command anywhere inside your terminal:
roscd
cd ..
Then to compile all the packages inside the catkin workspace, you type:
catkin_make
If you just want to compile specific packages (in cases where your project is really big), you type this command:
catkin_make --only-pkg-with-deps
For example, if you have a package named hello_world, you can compile just that package: