1. First, source your ROS environment

    source /opt/ros/melodic/setup.bash

  2. Create catkin directories

    mkdir -p ~/catkin_ws/src

  3. Initialize catkin workspace

     cd ~/catkin_ws
     catkin_make
    

New environment can be sourced by running

source ~/catkin_ws/devel/setup.bash