Installing the ROS configuration software source for Ubuntu
Configuring Ubuntu requires a software source that accepts restricted, universe, and multiverse, which can be configured according to the following link:
Https://help.ubuntu.com/community/Repositories/Ubuntu
Configured as shown, these configurations are, in general, default.
Software source configuration Add software source to Sources.list
The code for setting up the software source is as follows:
‘echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list‘
Once the correct software source is added, the operating system knows where to download the program and automatically installs the software according to the command.
Set the key
$ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
Installation
First verify that your Debian package index is up-to-date. The Debian program is a cooperative organization dedicated to creating a free operating system. The operating system that we created is named Debian. The Debian system currently uses the Linux kernel or the FreeBSD kernel.
$ sudo apt-get update
There are many different function libraries and tools in Ros, which are recommended to be fully installed or installed separately according to your requirements. Fully installed tools include Ros, RQT, visual environment Rviz, General Robotics Library Robot-generic libraries, 2D (e.g. stage) and 3D (e.g. gazebo) simulation environment 2d/3d simulators, The navigation Feature Pack sets navigation and 2d/3d (move, position, map drawing, robotic arm control), perceptual library perception (such as vision, LiDAR, rgb-d camera, etc.).
install ros-indigo-desktop-full
Initialize ROSDEP
ROSDEP not only makes it easier for you to install some system-dependent packages, but some of the main components of ROS also need to be ROSDEP.
$ sudo rosdep init$ rosdep update
Installing Rosinstall
The Rosinstall command is a very frequent command that allows you to easily download many Ros packages using this command.
$ sudo apt-get install python-rosinstall
Setting up the environment
Add ROS environment variables so that when you open your new shell, your bash session will automatically add environment variables.
echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc# 使环境变量设置立即生效$ source ~/.bashrc
Configure your ROS Environment
Note: When you install Ros with a package Installation manager like APT, these package users do not have the right to edit, when creating a Ros package and processing a ROS packages, you should always select a directory that you have permission to work as the working directory.
Manage your environment
When you install Ros, you'll see a hint: source (command) several setup.*sh files, or even add sourcing to your shell startup script. This is necessary because ROS relies on the concept of using the shell environment in combination. This makes it easier to develop a package that relies on different versions of Ros or different series.
If you're having trouble finding or using your Ros package, make sure your ROS environment variable is set up to check for Ros_root and ros_package_path these environment variables.
export | grep ROS
If not, you need to source some setup.*sh files.
Environment settings files are generated for you, but can come from different places:
- Setup.*sh files are provided by the ROS package installed with the Package manager;
- Rosbuild workspace uses tools such as ROSWS to provide setup.*sh files;
- The Setup.*sh file is created as a byproduct when compiling and installing the Catkin package.
Note: Rosbuild and Catkin are two ways to organize and compile Ros code, which is simple to use, the latter more complex but provides more flexibility, especially for those who need to integrate external code or want to publish their own software.
If you install Ros using the Apt tool on Ubuntu, you will have setup.*sh files in the '/opt/ros/indigo/' directory, and you can source them like this:
source /opt/ros/indigo/setup.bash
You need to run this command every time you open a new shell, and if you add Source/opt/ros/indigo/setup.bash. bashrc files, you don't have to run this command every time you open a new shell to use ROS commands.
Create a ROS working environment
For Ros Groovy and later versions, the Catkin work environment can be established in the following ways. Run in the shell:
$ mkdir -p ~/catkin_ws/src$ cd ~/catkin_ws/src$ catkin_init_workspace
You can see a CMakeLists.txt link file in the SRC folder, even if the workspace is empty (there is no package in SRC), you can still create a workspace.
$ cd ~/catkin_ws/$ catkin_make
Catkin_make command can be very convenient to create a Catkin workspace, in your current directory can see the build and Devel two folders, in the Devel folder can see a lot of setup.*sh files. Enabling these files will overwrite your current environment variables, and for more information, you can view the document Catkin. Start your new Setup.*sh file before proceeding to the next step.
source devel/setup.bash
To verify that your environment variable is overwritten by the setup script, you can run the command to confirm that your current directory is in an environment variable:
echo $ROS_PACKAGE_PATH
Output:
/home/youruser/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks
So far, your environment has been established, you can continue to learn the Ros file system!
Ubuntu14.04 Installing and configuring Ros Indigo