Skip to content

Melodic #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -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
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As GitHub suggests a newline is missing at the end of file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that GitHub doesn't warn about it everywhere (here not). However generally all files on Unix likes should have an empty line at the bottom.
Git sometimes warns about this too.

5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"python.autoComplete.extraPaths": [
"/opt/ros/melodic/lib/python2.7/dist-packages"
]
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As GitHub suggests a newline is missing at the end of file.

11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down
16 changes: 8 additions & 8 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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}"
Expand All @@ -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}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be deleted.


read -p "Do you wish to install desktop environment (xfce4) [Y/n]" -n 1 -s ans \
&& echo
Expand Down
2 changes: 1 addition & 1 deletion pkglist-gazebo
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ros-dashing-gazebo-ros-pkgs

13 changes: 9 additions & 4 deletions pkglist-ros
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newline missing.

6 changes: 0 additions & 6 deletions pkglist-rosdeps
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
curl
git
gnupg2
lsb-release
python3-argcomplete
python3-pip
15 changes: 11 additions & 4 deletions scripts/ros_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant with

grep "${SOURCE_ROS}" ${HOME}/.bashrc 2> /dev/null || \

Afaik source is needed to the run commands below. The best would be to place source /opt/ros.... on this line. And leave mentioned line in other file as is.

source ~/.bashrc
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If what I wrote above is ok this would be not needed.


sudo apt install python-rosdep
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this go to the pkglist?

sudo rosdep init
rosdep update

}

function install_gazebo
Expand Down
2 changes: 1 addition & 1 deletion scripts/user_setup.sh
Original file line number Diff line number Diff line change
@@ -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
}