diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..3a72db8 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,20 @@ +{ + "configurations": [ + { + "browse": { + "databaseFilename": "", + "limitSymbolsToIncludedHeaders": true + }, + "includePath": [ + "/opt/ros/melodic/include/**", + "/usr/include/**" + ], + "name": "ROS", + "intelliSenseMode": "gcc-x64", + "compilerPath": "/usr/bin/gcc", + "cStandard": "c11", + "cppStandard": "c++17" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..a560512 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "python.autoComplete.extraPaths": [ + "/opt/ros/melodic/lib/python2.7/dist-packages" + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 72c16b9..490bb29 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Setup scripts for ROS environment +# Setup scripts for ROS Melodic environment ![Build](https://github.com/agv-polsl/ros-setup-scripts/workflows/Build/badge.svg) -Shell scripts for installing ROS2 Dashing on Ubuntu 18.04.4 LTS Bionic. +Shell scripts for installing ROS Melodic on Ubuntu 18.04.4 LTS Bionic. Includes Gazebo installation. ## Setup steps @@ -17,13 +17,6 @@ Includes Gazebo installation. 7. To enter desktop environment start X server `startx`. 8. Setting up xfce theming may require re-running the script after entering gui. -## Setup test - -After typing following commands you should see a simple robot moving. - -1. `gazebo --verbose /opt/ros/dashing/share/gazebo_plugins/worlds/gazebo_ros_diff_drive_demo.world`. -2. `ros2 topic pub /demo/cmd_demo geometry_msgs/Twist '{linear: {x: 1.0}}' -1`. - ## Files in repo When extending the setup please put packages in according files: diff --git a/install b/install index 12ecdab..cfafb56 100644 --- a/install +++ b/install @@ -5,7 +5,7 @@ set_colors -echo -e "${BLUE}This is ROS setup sript${NOCOLOR}" +echo -e "${BLUE}This is ROS Melodic setup sript${NOCOLOR}" read -p "Do you wish to start the installtion? [Y/n]" -n 1 -s ans && echo [ "${ans}" != "n" ] || exit 0 @@ -14,14 +14,14 @@ sudo apt update && sudo apt upgrade -y [ $? -eq 0 ] || error "Failed to update apt-get, aborting..." echo -e "${GREEN}System update done${NOCOLOR}" -echo -e "${BLUE}Installing ROS dependencies${NOCOLOR}" +echo -e "${BLUE}Installing ROS Melodic dependencies${NOCOLOR}" install_rosdeps -[ $? -eq 0 ] || error "Failed to install ROS dependencies, aborting..." +[ $? -eq 0 ] || error "Failed to install ROS Melodic dependencies, aborting..." echo -e "${GREEN}ROS dependencies installation done${NOCOLOR}" -echo -e "${BLUE}Installing ROS${NOCOLOR}" +echo -e "${BLUE}Installing ROS Melodic${NOCOLOR}" install_ros -[ $? -eq 0 ] || error "Failed to install ROS, aborting..." +[ $? -eq 0 ] || error "Failed to install ROS Melodic, aborting..." echo -e "${GREEN}ROS installation done${NOCOLOR}" echo -e "${BLUE}Installing pip modules${NOCOLOR}" @@ -30,9 +30,9 @@ python3 -m pip install -r requirements.txt [ $? -eq 0 ] || echo "${RED}Failed install pip modules, continuing...${NOCLOR}" echo -e "${GREEN}Pip modules installaion done${NOCOLOR}" -read -p "Do you wish to install simulator (Gazebo) [Y/n]" -n 1 -s ans && echo -[ "${ans}" != "n" ] && install_gazebo -echo -e "${GREEN}Gazebo installation done${NOCOLOR}" +# read -p "Do you wish to install simulator (Gazebo) [Y/n]" -n 1 -s ans && echo +# [ "${ans}" != "n" ] && install_gazebo +# echo -e "${GREEN}Gazebo installation done${NOCOLOR}" read -p "Do you wish to install desktop environment (xfce4) [Y/n]" -n 1 -s ans \ && echo diff --git a/pkglist-gazebo b/pkglist-gazebo index a13807f..8b13789 100644 --- a/pkglist-gazebo +++ b/pkglist-gazebo @@ -1 +1 @@ -ros-dashing-gazebo-ros-pkgs + diff --git a/pkglist-ros b/pkglist-ros index 5ea6cff..4021362 100644 --- a/pkglist-ros +++ b/pkglist-ros @@ -1,4 +1,9 @@ -ros-dashing-ros-base -ros-dashing-desktop -ros-dashing-geometry* -ros-dashing-rqt* +git +ros-melodic-desktop-full +python-rosdep +python-rosinstall +python-rosinstall-generator +python-wstool +build-essential +ros-melodic-ros-control +ros-melodic-ros-controllers \ No newline at end of file diff --git a/pkglist-rosdeps b/pkglist-rosdeps index 8c618ba..e69de29 100644 --- a/pkglist-rosdeps +++ b/pkglist-rosdeps @@ -1,6 +0,0 @@ -curl -git -gnupg2 -lsb-release -python3-argcomplete -python3-pip diff --git a/scripts/ros_setup.sh b/scripts/ros_setup.sh index 501d643..74e1c9c 100644 --- a/scripts/ros_setup.sh +++ b/scripts/ros_setup.sh @@ -6,14 +6,21 @@ function install_rosdeps function install_ros { - ROS_KEY_URL=https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc + sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' - curl -s $ROS_KEY_URL | sudo apt-key add - - sudo sh -c 'echo "deb http://packages.ros.org/ros2/ubuntu \ - `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list' + sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654z + curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add - sudo apt update sudo apt -y install --no-install-recommends `cat pkglist-ros` + + echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc + source ~/.bashrc + + sudo apt install python-rosdep + sudo rosdep init + rosdep update + } function install_gazebo diff --git a/scripts/user_setup.sh b/scripts/user_setup.sh index a1423fe..f134067 100644 --- a/scripts/user_setup.sh +++ b/scripts/user_setup.sh @@ -1,6 +1,6 @@ function setup_user { - SOURCE_ROS="source /opt/ros/dashing/setup.bash" + SOURCE_ROS="source /opt/ros/melodic/setup.bash" grep "${SOURCE_ROS}" ${HOME}/.bashrc 2> /dev/null || \ echo "${SOURCE_ROS}" >> ${HOME}/.bashrc }