Skip to content

Instantly share code, notes, and snippets.

@Dtananaev
Forked from ShreyasSkandan/ros_py35_setup.bash
Last active March 15, 2019 22:24
Show Gist options
  • Select an option

  • Save Dtananaev/ce42e51decad2892d3771cbe74bdd546 to your computer and use it in GitHub Desktop.

Select an option

Save Dtananaev/ce42e51decad2892d3771cbe74bdd546 to your computer and use it in GitHub Desktop.
ROS Python3.5 Set Up
#!/usr/bin/env bash
# Create isolated ROS Workspace
cd ~
mkdir ros_py3
cd ros_py3
mkdir src
# Unset sourced workspace
# Go to ~/.bashrc and comment out lines from previous installation of ROS (Lunar)
# Get python3 helper libraries
sudo pip3 install rosdep
sudo pip3 install rosinstall_generator
#sudo pip3 install wstool
sudo pip3 install rosinstall
# Configure your catkin workspace
catkin config --init
catkin config -DCMAKE_BUILD_TYPE=Release
#ensure you have python 3 env
virtualenv rospy3
source rospy3/bin/activate
git clone https://github.com/tkruse/vcstools
cd vcstools
git checkout mock_server_tar_test
python setup.py develop
cd ..
git clone https://github.com/vcstools/wstool
cd wstool
python setup.py develop
wstool --help
# Pull bare-bone dependencies for ROS (Melodic) and use workspace tool to initialize
rosinstall_generator desktop_full --rosdistro melodic --deps --tar > melodic-desktop-full.rosinstall
wstool init -j8 src melodic-ros_comm.rosinstall
# If any installations failed, fix and continue using:
wstool update -j 4 -t src
# For me failed rosconsole so I downloaded tar archive and unpacked it to the ros_py3/src
# and add line to CMakeLists.txt: include_directories(${LOG4CXX_INCLUDE_DIRS})
# Set python version before catkin build
export ROS_PYTHON_VERSION=3
# Install some other dependencies
sudo apt install python3-empy
sudo apt install libgpgme11-dev
catkin build
# Note:
# You will probably see two build errors because of inappropriately set compile flags. They will try to compile without C++11 and fail.
# You can manually go to these CMakeLists.txt files and add "std=c++11" to the compile options and build again.
# Candidate trouble makers : src/ros_comm/rosbag & src/ros_comm/rosbag_storage
# Add other necessary ROS-Packages using rosinstall_generator
rosinstall_generator ros_comm sensor_msgs nav_msgs geometry_msgs --rosdistro melodic --deps --tar > melodic-ros_comm.rosinstall
wstool merge -t src melodic-ros_comm.rosinstall
wstool update -t src/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment