Skip to content

Commit

Permalink
Add opencv to third party, split build for desktop/tx1
Browse files Browse the repository at this point in the history
  • Loading branch information
jackguo380 committed Apr 3, 2020
1 parent 27d6433 commit 30e3eea
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 7 deletions.
23 changes: 23 additions & 0 deletions scripts/opencv.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>

<package format="2">
<name>libopencv-dev</name>
<version>3.4.9</version>
<license>GPLv3</license>
<description>OpenCV</description>

<maintainer email="[email protected]">Divya Budihal</maintainer>
<maintainer email="[email protected]">Nancy Hong</maintainer>
<maintainer email="[email protected]">Hannah Sawiuk</maintainer>
<maintainer email="[email protected]">Jerry Li</maintainer>
<maintainer email="[email protected]">Jack Guo</maintainer>

<buildtool_depend>catkin</buildtool_depend>

<build_depend>python-dev</build_depend>
<build_depend>python-numpy</build_depend>

<export>
<build_type>cmake</build_type>
</export>
</package>
22 changes: 22 additions & 0 deletions scripts/propbot_3pp_autonomy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>

<package format="2">
<name>propbot_3pp_autonomy</name>
<version>1.0.0</version>
<license>GPLv3</license>
<description>Propbot Autonomy Dependencies Metapackage</description>

<maintainer email="[email protected]">Divya Budihal</maintainer>
<maintainer email="[email protected]">Nancy Hong</maintainer>
<maintainer email="[email protected]">Hannah Sawiuk</maintainer>
<maintainer email="[email protected]">Jerry Li</maintainer>
<maintainer email="[email protected]">Jack Guo</maintainer>

<buildtool_depend>catkin</buildtool_depend>

<exec_depend>cartographer_ros</exec_depend>

<export>
<metapackage/>
</export>
</package>
25 changes: 25 additions & 0 deletions scripts/propbot_3pp_mapviz.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0"?>

<package format="2">
<name>propbot_3pp_mapviz</name>
<version>1.0.0</version>
<license>GPLv3</license>
<description>Propbot Mapviz Dependencies Metapackage</description>

<maintainer email="[email protected]">Divya Budihal</maintainer>
<maintainer email="[email protected]">Nancy Hong</maintainer>
<maintainer email="[email protected]">Hannah Sawiuk</maintainer>
<maintainer email="[email protected]">Jerry Li</maintainer>
<maintainer email="[email protected]">Jack Guo</maintainer>

<buildtool_depend>catkin</buildtool_depend>

<exec_depend>cv_bridge</exec_depend>
<exec_depend>swri_image_util</exec_depend>
<exec_depend>swri_route_util</exec_depend>
<exec_depend>swri_transform_util</exec_depend>

<export>
<metapackage/>
</export>
</package>
63 changes: 56 additions & 7 deletions scripts/setup_third_party_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,20 @@ CARTOGRAPHER_ROS_DIR=src/cartographer_ros
echo "Downloading Cartographer ROS..."
_clone_repo "$CARTOGRAPHER_ROS_URL" "$CARTOGRAPHER_ROS_DIR" "$CARTOGRAPHER_ROS_VERSION"

# ==== OpenCV 3.4.9 ====
OPENCV_URL=https://github.com/opencv/opencv/archive/3.4.9.tar.gz
OPENCV_DIR=src/libopencv-dev
OPENCV_VERSION=opencv-3.4.9.tar.gz

_download_file "$OPENCV_URL" "$OPENCV_VERSION"
_untar_into_dir "$OPENCV_VERSION" "$OPENCV_DIR" --strip-components=1
_check_run cp "$SCRIPT_DIR/opencv.xml" "$OPENCV_DIR/package.xml"

# ==== cv_bridge (non-broken version) ====
# Note that this is not the offical repository but a fork which fixed the opencv dependency
CV_BRIDGE_URL=https://github.com/BrutusTT/vision_opencv
CV_BRIDGE_URL=https://github.com/ros-perception/vision_opencv
CV_BRIDGE_DIR=src/vision_opencv
CV_BRIDGE_VERSION=8e01b44c5c1c0003dc91273076f8ca7feb9a8025
CV_BRIDGE_VERSION=578af4d6c7846876b3fc64512b1cc92a54894483

echo "Downloading cv_bridge"
_clone_repo "$CV_BRIDGE_URL" "$CV_BRIDGE_DIR" "$CV_BRIDGE_VERSION"
Expand All @@ -191,13 +200,33 @@ if [ -d "$CV_BRIDGE_DIR/opencv_tests" ]; then
touch "$CV_BRIDGE_DIR/opencv_tests/CATKIN_IGNORE" || true
fi

# ==== SWRI stuff for mapviz ====
SWRI_URL=https://github.com/swri-robotics/marti_common
SWRI_DIR=src/marti_common
SWRI_VERSION=d4d21cef492e9554b0904c77266c17bee2fd43ca

echo "Downloading SWRI marti common"
_clone_repo "$SWRI_URL" "$SWRI_DIR" "$SWRI_VERSION"

# ==== Darknet/YOLO ====
DARKNET_VERSION=8d2584874a282a55875966ccfad4b9f80acab5c3
DARKNET_URL=https://github.com/leggedrobotics/darknet_ros
DARKNET_DIR=src/darknet_ros
#DARKNET_VERSION=8d2584874a282a55875966ccfad4b9f80acab5c3
#DARKNET_URL=https://github.com/leggedrobotics/darknet_ros
#DARKNET_DIR=src/darknet_ros

echo "Downloading Darknet ROS"
_clone_repo "$DARKNET_URL" "$DARKNET_DIR" "$DARKNET_VERSION"
#_clone_repo "$DARKNET_URL" "$DARKNET_DIR" "$DARKNET_VERSION"

# ==== Propbot 3pp Autonomy ====
PROPBOT_3PP_AUTONOMY_DIR=src/propbot_3pp_autonomy
mkdir -p "$PROPBOT_3PP_AUTONOMY_DIR"

_check_run cp "$SCRIPT_DIR/propbot_3pp_autonomy.xml" "$PROPBOT_3PP_AUTONOMY_DIR/package.xml"

# ==== Propbot 3pp Autonomy ====
PROPBOT_3PP_MAPVIZ_DIR=src/propbot_3pp_mapviz
mkdir -p "$PROPBOT_3PP_MAPVIZ_DIR"

_check_run cp "$SCRIPT_DIR/propbot_3pp_mapviz.xml" "$PROPBOT_3PP_MAPVIZ_DIR/package.xml"

echo "Initializing Workspace"
_check_run catkin init
Expand Down Expand Up @@ -231,6 +260,13 @@ fi
extra_apt_packages=(
libatlas-base-dev
libsuitesparse-dev
libdc1394-22-dev
libjpeg-dev
libtbb2
libtbb-dev
libjpeg-dev
libpng-dev
libtiff-dev
)

if ! dpkg -l "${extra_apt_packages[@]}" > /dev/null; then
Expand All @@ -242,4 +278,17 @@ _check_run rosdep install --os=ubuntu:bionic --from-paths src --ignore-src -y

_check_run catkin config --cmake-args "${cmake_args[@]}"

echo "Everything is done. To build, run: catkin build in $WORKSPACE_ROOT"
cat <<EOF
Everything is done. Go into $WORKSPACE_ROOT to build.
To build everything:
\$ catkin build
To build only mapviz/desktop dependencies:
\$ catkin build propbot_3pp_mapviz
To build only autonomy/tx1 dependencies:
\$ catkin build propbot_3pp_autonomy
EOF

0 comments on commit 30e3eea

Please sign in to comment.