ROS Projects
https://youtu.be/9vbJYU0qqGM?t=110
Installation Steps
- Setup your computer to accept software from packages.ros.org.
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
- Set up your keys.
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
- Make sure your Debian package index is up-to-date.
sudo apt update
- Installing the ROS recommended configuration.
sudo apt install ros-melodic-desktop-full
Config Steps
- Adding environment variables: To Automatically add ROS environment variables to your bash session every time a new shell (terminal) is launched, enter the following commands (this step is similar as adding environmental variable in windows):
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
- Initialize rosdep: Before you can use many ROS tools, you will need to initialize rosdep. rosdep enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS.
sudo apt install python-rosdep
sudo rosdep init
rosdep update
More packages to install
sudo apt-get install ros-melodic-catkin python-catkin-tools
sudo apt install ros-melodic-std-msgs
sudo apt-get install ros-melodic-ros-tutorials
sudo apt-get install ros-melodic-gmapping
sudo apt-get install ros-melodic-teleop-twist-keyboard
sudo apt-get install ros-melodic-navigation
sudo apt-get install ros-melodic-tf2-sensor-msgs
sudo apt-get install ros-melodic-amcl
sudo apt-get install ros-melodic-map-server
sudo apt install ros-melodic-moveit
sudo apt install ros-melodic-moveit-ros-planning
sudo apt-get install ros-melodic-ros-control ros-melodic-ros-controllers
Create Catkin WS
cd ~/
mkdir --parents catkin_ws/src
cd catkin_ws
catkin init
cd ~/catkin_ws
catkin build or catkin_make
Create Pkg
cd to Ws
catkin_create_pkg <package_name> [depend1] [depend2] [depend3]
catkin build or catkin_make
Create and edit node
touch node_hello_ros.py (create)
gedit node_hello_ros.py (edit)
#!/usr/bin/env python (first line)