Install ROS Melodic & Opencv Ubuntu 18.04
1. Install ROS Melodic :
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update
sudo apt install ros-melodic-desktop-full
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
sudo rosdep init
rosdep update
2. Create catkin workspace :
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws
catkin_make
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
# Install rosbridge-suite
sudo apt-get install ros-melodic-rosbridge-server
sudo apt-get install cmake-qt-gui
3. Install Library yang diperlukan :
sudo apt-get install libfontconfig1-dev libdbus-1-dev libfreetype6-dev libudev-dev libicu-dev libsqlite3-dev libxslt1-dev libssl-dev libasound2-dev libavcodec-dev libavformat-dev libswscale-dev libgles2-mesa-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-xinerama0-dev libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler libopenblas-dev liblapack-dev libopenblas-dev liblapack-dev libgflags-dev libgoogle-glog-dev liblmdb-dev cmake cmake-gui gfortran liblapack-dev libblas-dev libatlas-base-dev libarpack2-dev libarpack++2-dev
4. download opencv di google, versi terserah, lalu extract
5. Clone contoh project :
cd ~/Download
git clone https://github.com/fpt-corp/ROS_Package_example.git
jika mendownlad, maka extract dulu
6.
cd ~/Download/opencv
mkdir build
7. Buka cmake
8.
-
browse source -> opencv
browse build -> build
configure
generate
cd ~/Download/opencv/build
make -j16
sudo make install
10.
cd ~/Download/ROS_Package_example/
# copy semua folder ke ~/catkin_ws/src/
11. restart terminal
12.
cd ~/catkin_ws/
catkin_make
roslaunch lane_detect lane_detect.launch
13. Ada step selanjutnya, tp ribet pake bgt