driveworks开发demo
- 上位机docker编译环境
- 上位机docker运行调试环境
- 上位机docker交叉编译环境
- 目标机orin部署环境
- 目标机orin远程调试环境
P.S. 若有权限问题
chmod +x -R ./docker/
chmod +x -R ./scripts/
docker load -i ./drive-sdk-docker-6.0.6.tar
docker pull nvcr.io/drive/driveos-sdk/drive-agx-orin-linux-aarch64-sdk-build-x86
# nvcr.io/drive/driveos-sdk/drive-agx-orin-linux-aarch64-sdk-build-x86 6.0.6.0-0004 2a61be9dd0a0 8 weeks ago 54.1GB
# 启动docker, 容器名称为gw_sdk_20.04_${USER}
./docker/dev/sdk_start.sh
# 进入container
./docker/dev/sdk_into.sh
# optional: 额外安装软件
./docker/scripts/sdk_postbuild.sh
运行时docker在x86平台构建
docker load -i ./arm64v8-ros-foxy-dev.tar
docker pull arm64v8/ros:foxy-dev
# 启动docker, 容器名称为gw_orin_20.04_${USER}
./docker/dev/orin_start.sh
# 进入container
./docker/dev/orin_into.sh
# optional: 额外安装软件
./docker/scripts/orin_postbuild.sh
运行时docker在orin平台运行 https://developer.nvidia.com/blog/running-docker-containers-directly-on-nvidia-drive-agx-orin/
docker load -i ./arm64v8-ros-foxy-dev.tar
docker pull mirrors.xlab.gacrnd.com:8082/arm64v8/ros:foxy-dev
# 启动docker, 容器名称为gw_orin_20.04_${USER}
./docker/run/orin_start.sh
# 进入container
./docker/run/orin_into.sh
# optional: 额外安装软件
./docker/scripts/target_postbuild.sh
cmake的使用参考https://manpages.ubuntu.com/manpages/bionic/man1/cmake.1.html
cd gw_demo
./gw.sh cmake_x86
./gw.sh make_x86
./gw.sh install_x86
# clean
./gw.sh clean
- 构建目录设置到
target
目录,target
目录拷贝到目标机器
cd gw_demo
./gw.sh cmake_aarch64
./gw.sh make_aarch64
./gw.sh install_aarch64
# clean
./gw.sh clean
- 构建目录设置到
target
目录,target
目录拷贝到目标机器
cd gw_demo
./gw_ros.sh build_rel
# clean
./gw_ros.sh clean
已经配置好./.vscode/tasks.json
,和./scripts/.vscode/tasks.json
可通过task实现快捷操作
使用方式为:Ctrl+Shift+P
+ Tasks: Run Task
+ 选择具体的task
安装cpp插件,编辑./.vscode/c_cpp_properties.json
设置driveworks和driveos的目录,即可跳转。
安装cmake-tools插件,即可获得完整cmake开发体验。
为了实现查看错误跳转,创建一些软连接
# in host
ln -s $PWD ./gw_demo
sudo ln -s $PWD /gw_demo
# to use dwcgf-tools out of docker
sudo ln -s ~/orin_ws/nv_driveworks/driverorks-5.10/ /usr/local/driveworks-5.10
sudo ln -s /usr/local/driveworks-5.10 /usr/local/driveworks
以module_demo
库的测试app为例
cd /target/aarch64/install/
./bin/module_demo/module_demo_main
以Helloworld
为例
cd /target/aarch64/install/
sudo ./bin/common_cgf_app/runHelloworld.sh
# 删除日志
./orin.sh clean
# 查看日志
tail -n 50 -f ./LogFolder/common_cgf_app/Helloworld/helloworld_process0_0.log
以VirtualCameraDeployPipe
为例
# prepare res
ln -s ~/myz/data/video ./aarch64/install/data/common_cgf_app/video
cd ./aarch64/install/
sudo ./bin/common_cgf_app/runVirtualCameraDeployPipe.sh
以下为实验性,增强型功能,需要自行修改适配后使用
# source prebuilt ros2 env
source ./docker/scripts/target.bashrc
# source the current project ros2 env
source ./colcon/install/local_setup.bash
tmux是一款好用的工具,此处tmux脚本仅供运行时target-orin-docker使用。
# in host
cd /target
./tmux_into.sh
# close the tmux
tmux kill-session -t target_tmux_into
由于设置了set(CMAKE_DEBUG_POSTFIX _d)
, 所有debug lib都添加后缀_d
修改./gw.sh
相关命令,手动添加-DCMAKE_BUILD_TYPE=Debug
function cmake_aarch64() {
info "Start cmake, please wait ..."
info "cmake on $MACHINE_ARCH..."
cd ${GW_ROOT_DIR}
info "cmake -B ${GW_AARCH64_BUILD_DIR} ${CMAKE_BUILD_OPT} ${CMAKE_CROSS_OPT} -DCMAKE_BUILD_TYPE=Debug"
cmake -B ${GW_AARCH64_BUILD_DIR} ${CMAKE_BUILD_OPT} ${CMAKE_CROSS_OPT} -DCMAKE_BUILD_TYPE=Debug
if [ ${PIPESTATUS[0]} -ne 0 ]; then
fail 'cmake failed!'
fi
info "please make_aarch64"
cd -
success 'cmake_aarch64 passed!'
}
todo:
见 ./.vscode/launch.json
见./scripts/.vscode/launch.json
内部代号:gaworks, 开发代号gw, GW
制品目录也提交入库
- docker环境下terminal没有彩色输出(已解决 -e TERM=xterm-256color)
- docker环境下terminal apt安装不能tab (https://askubuntu.com/questions/735189/enabling-auto-completion-for-apt-get-install-in-docker-ubuntu-14-04)
- docker环境下不能启动界面? (已解决 -e DISPLAY)