Skip to content

Commit

Permalink
interim checkin to make setting up a new 24.04 ros one install easier
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasw committed Jul 15, 2024
1 parent d2bfbd8 commit 482bdc8
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 54 deletions.
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,21 @@ RUN echo $ROSCONSOLE
# packages that need to be cmake installed, and are ros packages in a catkin workspace
RUN mkdir $SRC/ros_from_src -p
WORKDIR /
COPY git_clone.sh $SRC/ros_from_src
# WORKDIR $SRC/ros_from_src
RUN ROS_CONSOLE=$ROSCONSOLE $SRC/ros_from_src/git_clone.sh

COPY dependencies.sh $SRC/ros_from_src
RUN $SRC/ros_from_src/dependencies.sh

# WORKDIR $SRC/ros_from_src
COPY underlay_repos.yaml $SRC/ros_from_src
COPY git_clone.sh $SRC/ros_from_src
RUN ROS_CONSOLE=$ROSCONSOLE $SRC/ros_from_src/git_clone.sh

COPY build.sh $SRC/ros_from_src
RUN $SRC/ros_from_src/build.sh

COPY env.sh $SRC/ros_from_src
COPY catkin.sh $SRC/ros_from_src
RUN $SRC/ros_from_src/catkin.sh

WORKDIR $WS/..
# TODO(lucasw) run tests
23 changes: 2 additions & 21 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ BUILD=`pwd`/build
echo $BUILD
mkdir -p $BUILD

WS=`pwd`/catkin_ws/src
echo $WS
mkdir -p $WS || true

DEST=`pwd`/ros

# python installs
Expand Down Expand Up @@ -148,20 +144,5 @@ rosdep update
# TODO(lucasw) already have a copy of this but needs to be in the workspace
# find / | grep setup.bash
# find / | grep catkin-config.cmake
cd $WS/..
catkin init
source $DEST/setup.bash
catkin config --install --cmake-args -DCMAKE_BUILD_TYPE=Release -Wno-deprecated -DCATKIN_ENABLE_TESTING=False
rospack list

# rosdep install --from-paths src --ignore-src -r -s # do a dry-run first
# rosdep install --from-paths src --ignore-src -r -y
CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$DEST:$DEST/lib/cmake
echo $CMAKE_PREFIX_PATH
# TODO(lucasw) put this in WS to begin with
# TODO(lucasw) was this needed? Need a bunch of CATKIN_IGNOREs in every package/test dir to make it build
# ln -s $SRC/ros $WS/ros
catkin build
source devel/setup.bash
rospack list
# TODO(lucasw) run tests


18 changes: 18 additions & 0 deletions catkin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

source env.sh

WS=`pwd`/underlay_ws/src
echo $WS

cd $WS/..
echo "#####################"
pwd
catkin init
catkin config --install --cmake-args -DCMAKE_BUILD_TYPE=Release -Wno-deprecated -DCATKIN_ENABLE_TESTING=False
rospack list

catkin build
source devel/setup.bash
rospack list
# TODO(lucasw) run tests
4 changes: 4 additions & 0 deletions dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ apt-get install -y libgtest-dev
apt-get install -y liblog4cxx-dev
apt-get install -y liblz4-dev lz4
apt-get install -y libpoco-dev
apt-get install -y libtinyxml-dev
apt-get install -y libtinyxml2-dev
apt-get install -y mawk
apt-get install -y python-is-python3
Expand All @@ -40,3 +41,6 @@ apt-get install -y python3-gnupg

# TODO(lucasw) get this from source later
# apt-get install -y python3-rosunit

apt-get install -y catkin-tools
apt-get install -y vcstool
13 changes: 8 additions & 5 deletions env.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/usr/bin/bash
# source ros_from_src/env.sh
export ROS_DEST=`pwd`/ros
export PATH=$PATH:$ROS_DEST/bin
export PATH=$PATH:$ROS_DEST/local/bin
# export PATH=$PATH:$ROS_DEST/bin
# export PATH=$PATH:$ROS_DEST/local/bin

# python --version | awk '{print $2}' | cut -d'.' -f1
PYTHON_MAJOR_VERSION=`python --version | awk '{print $2}' | cut -d'.' -f1`
PYTHON_MINOR_VERSION=`python --version | awk '{print $2}' | cut -d'.' -f2`
OPT_PYTHONPATH=$ROS_DEST/local/lib/python$PYTHON_MAJOR_VERSION.$PYTHON_MINOR_VERSION/dist-packages/
OPT_PYTHONPATH0=$ROS_DEST/local/lib/python$PYTHON_MAJOR_VERSION.$PYTHON_MINOR_VERSION/site-packages/
OPT_PYTHONPATH1=$ROS_DEST/local/lib/python$PYTHON_MAJOR_VERSION.$PYTHON_MINOR_VERSION/dist-packages/

export PYTHONPATH=$PYTHONPATH:$OPT_PYTHONPATH
export PYTHONPATH=$PYTHONPATH:$OPT_PYTHONPATH0:$OPT_PYTHONPATH1
echo "PYTHONPATH $PYTHONPATH"
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$ROS_DEST:$ROS_DEST/lib/cmake

echo "CMAKE_PREFIXPATH $CMAKE_PREFIX_PATH"
30 changes: 5 additions & 25 deletions git_clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,18 @@
SRC=`pwd`/src
echo $SRC
mkdir $SRC -p
WS=`pwd`/catkin_ws/src

WS=`pwd`/underlay_ws/src
echo $WS
mkdir $WS -p

# TODO(lucasw) replace these git clones with vcs
# packages that need to be cmake installed, and are ros packages in a catkin workspace
cd $WS
git clone https://github.com/ros/catkin
git clone https://github.com/ros/console_bridge
git clone https://github.com/ros/cmake_modules
git clone https://github.com/ros-o/class_loader
git clone https://github.com/ros/rospack
git clone https://github.com/ros/genmsg

# ros packages, regular catkin build only for these
git clone https://github.com/ros-o/ros_comm
git clone https://github.com/ros-o/roscpp_core
git clone https://github.com/ros/ros_comm_msgs
git clone https://github.com/ros/message_generation
git clone https://github.com/ros-o/gencpp
git clone https://github.com/jsk-ros-pkg/geneus
git clone https://github.com/RethinkRobotics-opensource/gennodejs
git clone https://github.com/ros/genlisp
git clone https://github.com/ros/genpy
git clone https://github.com/ros/std_msgs
git clone https://github.com/ros/message_runtime
git clone https://github.com/ros-o/pluginlib
git clone https://github.com/ros/ros
vcs import --input underlay_repos.yaml

ROSCONSOLE1=${ROSCONSOLE:-https://github.com/ros-o/rosconsole}
git clone $ROSCONSOLE1
# ROSCONSOLE1=${ROSCONSOLE:-https://github.com/ros-o/rosconsole}
# git clone $ROSCONSOLE1

# pure python
cd $SRC
Expand All @@ -45,7 +26,6 @@ git clone https://github.com/catkin/catkin_tools
# cmake installs
git clone https://github.com/ros-o/ros_environment


# runtime
git clone https://github.com/ros-infrastructure/rospkg
git clone https://github.com/ros-infrastructure/rosdistro
Expand Down
117 changes: 117 additions & 0 deletions underlay_repos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
repositories:
actionlib:
type: git
url: [email protected]:ros/actionlib.git
version: noetic-devel
angles:
type: git
url: [email protected]:ros/angles.git
version: master
bond_core:
type: git
url: [email protected]:ros-o/bond_core.git
version: obese-devel
catkin:
type: git
url: https://github.com/ros/catkin
version: noetic-devel
class_loader:
type: git
url: https://github.com/ros-o/class_loader
version: obese-devel
cmake_modules:
type: git
url: https://github.com/ros/cmake_modules
version: 0.5-devel
console_bridge:
type: git
url: https://github.com/ros/console_bridge
version: master
gencpp:
type: git
url: https://github.com/ros-o/gencpp
version: obese-devel
geneus:
type: git
url: https://github.com/jsk-ros-pkg/geneus
version: master
genlisp:
type: git
url: https://github.com/ros/genlisp
version: kinetic-devel
genmsg:
type: git
url: https://github.com/ros/genmsg
version: kinetic-devel
gennodejs:
type: git
url: https://github.com/RethinkRobotics-opensource/gennodejs
version: kinetic-devel
genpy:
type: git
url: https://github.com/ros/genpy
version: main
geometry:
type: git
url: [email protected]:ros-o/geometry.git
version: obese-devel
common_msgs:
type: git
url: [email protected]:ros/common_msgs.git
version: noetic-devel
kdl_parser:
type: git
url: [email protected]:ros/kdl_parser.git
version: noetic-devel
message_generation:
type: git
url: https://github.com/ros/message_generation
version: kinetic-devel
message_runtime:
type: git
url: https://github.com/ros/message_runtime
version: kinetic-devel
pluginlib:
type: git
url: https://github.com/ros-o/pluginlib
version: obese-devel
resource_retriever:
type: git
url: [email protected]:ros/resource_retriever.git
version: kinetic-devel
ros:
type: git
url: https://github.com/ros/ros
version: noetic-devel
ros_comm:
type: git
url: https://github.com/ros-o/ros_comm
version: obese-devel
ros_comm_msgs:
type: git
url: https://github.com/ros/ros_comm_msgs
version: kinetic-devel
rosconsole:
type: git
url: https://github.com/ros-o/rosconsole
version: obese-devel
rosconsole_bridge:
type: git
url: [email protected]:ros/rosconsole_bridge.git
version: kinetic-devel
roscpp_core:
type: git
url: https://github.com/ros-o/roscpp_core
version: obese-devel
rospack:
type: git
url: https://github.com/ros/rospack
version: noetic-devel
std_msgs:
type: git
url: https://github.com/ros/std_msgs
version: kinetic-devel
urdf:
type: git
url: [email protected]:ros/urdf.git
version: melodic-devel

0 comments on commit 482bdc8

Please sign in to comment.