Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN curl -o GPG-PUB-KEY-INTEL-SW-PRODUCTS https://apt.repos.intel.com/intel-gpg-
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS && \
curl -o GPG-PUB-KEY-INTEL-OPENVINO-2021 https://apt.repos.intel.com/openvino/2021/GPG-PUB-KEY-INTEL-OPENVINO-2021 && \
apt-key add GPG-PUB-KEY-INTEL-OPENVINO-2021 && \
echo "deb https://apt.repos.intel.com/openvino/2021 all main" | tee - a /etc/apt/sources.list.d/intel-openvino-2021.list && \
echo "deb https://apt.repos.intel.com/openvino/2021 all main" | tee -a /etc/apt/sources.list.d/intel-openvino-2021.list && \
apt-get update && apt-get install -y --no-install-recommends intel-openvino-dev-ubuntu20-"${build_id}" && \
/opt/intel/openvino_"${build_id}"/deployment_tools/model_optimizer/install_prerequisites/install_prerequisites.sh tf && \
ln --symbolic /opt/intel/openvino_"${build_id}"/ /opt/intel/openvino
Expand Down
35 changes: 25 additions & 10 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,34 @@
"DISPLAY": "${localEnv:DISPLAY}",
"QT_X11_NO_MITSHM": "1"
},
"extensions": ["ms-python.python","ms-vscode.cpptools-extension-pack"],
"runArgs":["--privileged","--network", "host"],
"runArgs": [
"--privileged",
"--network",
"host"
],
"mounts": [
"source=deepracer-ros-bashhistory,target=/commandhistory,type=volume",
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind"
],
"settings": {
"terminal.integrated.profiles.linux": {
"bash (ROS)": {
"path": "/bin/bash",
"args": ["--init-file", ".devcontainer/bashrc"]
}
},
"terminal.integrated.defaultProfile.linux": "bash (ROS)"
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.profiles.linux": {
"bash (ROS)": {
"path": "/bin/bash",
"args": [
"--init-file",
".devcontainer/bashrc"
]
}
},
"terminal.integrated.defaultProfile.linux": "bash (ROS)"
},
"extensions": [
"ms-python.python",
"ms-vscode.cpptools-extension-pack",
"ms-python.autopep8"
]
}
}
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
factory_reset*
ws/*
!ws/.rosinstall
__pycache__
*.pyc
pkg-build/
dist/
5 changes: 3 additions & 2 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
"${workspaceFolder}/**",
"/opt/ros/foxy/include/**",
"/usr/include/opencv4/",
"/opt/intel/openvino_2021/inference_engine/**"
"/opt/intel/openvino_2021/inference_engine/**",
"${workspaceFolder}/ws/build/inference_pkg/_deps/tensorflow-lite-src/**",
"${workspaceFolder}/ws/build/inference_pkg/flatbuffers/include/"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "linux-gcc-x64"
Expand Down
21 changes: 8 additions & 13 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
"cmake.configureOnOpen": false,
"python.autoComplete.extraPaths": [
"/opt/ros/foxy/lib/python3.8/site-packages/",
"/workspaces/deepracer-scripts/ws/install/deepracer_interfaces_pkg/lib/python3.8/site-packages"
],
"python.analysis.extraPaths": [
"/opt/ros/foxy/lib/python3.8/site-packages/",
"/workspaces/deepracer-scripts/ws/install/deepracer_interfaces_pkg/lib/python3.8/site-packages"
],
"files.associations": {
"condition_variable": "cpp",
Expand Down Expand Up @@ -75,24 +77,17 @@
"typeinfo": "cpp",
"valarray": "cpp",
"variant": "cpp",
"*.ipp": "cpp"
"*.ipp": "cpp",
"unordered_set": "cpp"
},
"ros.distro": "foxy",
"python.linting.pylintEnabled": false,
"python.linting.enabled": true,
"python.linting.flake8Enabled": false,
"python.linting.pycodestyleEnabled": true,
"python.linting.pycodestyleArgs": ["--max-line-length","120"],
"python.formatting.provider": "autopep8",
"python.formatting.autopep8Args": [
"--max-line-length",
"120",
"--experimental"
],
"files.exclude": {
"**/build": true
},
"search.exclude": {
"**/build": true
},
"C_Cpp.default.compilerPath": "/usr/bin/g++-9",
"autopep8.args": [
"--max-line-length=120"
],
}
142 changes: 88 additions & 54 deletions dev-stack-build.sh
Original file line number Diff line number Diff line change
@@ -1,66 +1,100 @@
#!/usr/bin/env bash
set -e

# Parse command line arguments
CACHE="false"
while getopts "c" opt; do
case ${opt} in
c )
CACHE="true"
;;
\? )
echo "Usage: cmd [-c]"
exit 1
;;
esac
done

# Set the environment
source /opt/ros/foxy/setup.bash
source /opt/intel/openvino_2021/bin/setupvars.sh

# Change to build directory
cd ws

rosws update

#######
#
# START - Pull request specific changes
#

# Update packages for PR's
# https://github.com/aws-deepracer/aws-deepracer-inference-pkg/pull/4
cd aws-deepracer-inference-pkg
git fetch origin pull/4/head:compressed-image
git checkout compressed-image
cd ..

# https://github.com/aws-deepracer/aws-deepracer-camera-pkg/pull/5
cd aws-deepracer-camera-pkg
git fetch origin pull/5/head:compressed-image
git checkout compressed-image
cd ..

# https://github.com/aws-deepracer/aws-deepracer-interfaces-pkg/pull/4
cd aws-deepracer-interfaces-pkg
git fetch origin pull/4/head:compressed-image
git checkout compressed-image
cd ..

# https://github.com/aws-deepracer/aws-deepracer-sensor-fusion-pkg/pull/4
cd aws-deepracer-sensor-fusion-pkg
git fetch origin pull/4/head:compressed-image
git checkout compressed-image
cd ..

# https://github.com/aws-deepracer/aws-deepracer-model-optimizer-pkg/pull/2
cd aws-deepracer-model-optimizer-pkg
git fetch origin pull/2/head:cache-load
git checkout cache-load
cd ..

# Resolve the dependanices
rosdep install -i --from-path . --rosdistro foxy -y

#
# END - Pull request specific changes
#
#######

# Remove previous builds (gives clean build)
rm -rf install build log

# Update deepracer_launcher.py (fix an issue in the file)
cp ../launch/deepracer_launcher.py ./aws-deepracer-launcher/deepracer_launcher/launch/deepracer_launcher.py

# Turn off SW update
sed -i "s/ENABLE_PERIODIC_SOFTWARE_UPDATE = True/ENABLE_PERIODIC_SOFTWARE_UPDATE = False/" aws-deepracer-systems-pkg/deepracer_systems_pkg/deepracer_systems_pkg/software_update_module/software_update_config.py
if [ "$CACHE" != "true" ]; then

# Undo checkouts / patches
for pkg_dir in */;
do
cd $pkg_dir
if [ -d .git ]; then
git reset --hard
fi
cd ..
done

rosws update

#######
#
# START - Pull request specific changes
#

# Update packages for PR's
# https://github.com/aws-deepracer/aws-deepracer-inference-pkg/pull/4
cd aws-deepracer-inference-pkg
git fetch origin pull/5/head:tflite
git checkout tflite
cd ..

# https://github.com/aws-deepracer/aws-deepracer-camera-pkg/pull/5
cd aws-deepracer-camera-pkg
git fetch origin pull/5/head:compressed-image
git checkout compressed-image
cd ..

# https://github.com/aws-deepracer/aws-deepracer-interfaces-pkg/pull/4
cd aws-deepracer-interfaces-pkg
git fetch origin pull/4/head:compressed-image
git checkout compressed-image
cd ..

# https://github.com/aws-deepracer/aws-deepracer-sensor-fusion-pkg/pull/4
cd aws-deepracer-sensor-fusion-pkg
git fetch origin pull/4/head:compressed-image
git checkout compressed-image
cd ..

# https://github.com/aws-deepracer/aws-deepracer-model-optimizer-pkg/pull/2
cd aws-deepracer-model-optimizer-pkg
git fetch origin pull/3/head:tflite
git checkout tflite
cd ..

# Patch with aws-deepracer-ctrl-pkg.patch
cd aws-deepracer-ctrl-pkg
git apply ../../files/aws-deepracer-ctrl-pkg.patch
cd ..

# Remove previous builds (gives clean build)
rm -rf install build log

# Resolve the dependencies
rosdep install -i --from-path . --ignore-src --rosdistro foxy -y

#
# END - Pull request specific changes
#
#######

# Update deepracer_launcher.py (fix an issue in the file)
cp ../files/launch/deepracer_launcher.py ./aws-deepracer-launcher/deepracer_launcher/launch/deepracer_launcher.py

# Turn off SW update
sed -i "s/ENABLE_PERIODIC_SOFTWARE_UPDATE = True/ENABLE_PERIODIC_SOFTWARE_UPDATE = False/" aws-deepracer-systems-pkg/deepracer_systems_pkg/deepracer_systems_pkg/software_update_module/software_update_config.py

fi

# Build the core
colcon build --packages-up-to deepracer_launcher rplidar_ros
Expand Down
2 changes: 1 addition & 1 deletion dev-stack-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ sudo /opt/intel/openvino_2021/install_dependencies/install_NEO_OCL_driver.sh -y
# Update ROS
sudo rosdep init
sudo rosdep fix-permissions
rosdep update --include-eol-distros
rosdep update --rosdistro foxy
22 changes: 22 additions & 0 deletions dev-stack-install-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -e

export DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"

# Build the core packages
sudo systemctl stop deepracer-core

# DeepRacer Repos
sudo cp $DIR/files/deepracer-larsll.asc /etc/apt/trusted.gpg.d/
sudo cp $DIR/files/aws_deepracer-community.list /etc/apt/sources.list.d/
sudo apt update

# Install GPU driver
sudo /opt/intel/openvino_2021/install_dependencies/install_NEO_OCL_driver.sh -y

# Update DR
sudo apt -y install aws-deepracer-core

# Restart deepracer
sudo systemctl start deepracer-core
Loading