Modified version of ApolloAuto/apollo/cyber. Baseline version is apollo v7.0.0.
- Cyber is a standalone project
- Docker is not used
apollo/cyber (in ApolloAuto) | cyber (this standalone version) |
---|---|
/tools | merged into /build |
/BUILD and /cyber/BUILD | merged int /BUILD |
/scripts (files needed) | /scripts |
sudo apt update
sudo apt install python3-testresources
then
./install_deps.sh
This script will download bazel
(bazel-4.2.2-linux-arm64
) from github and its size is >100M. The file can be put into cyber/build/installers
to save downloading time.
install jdk
before running bazel
:
apt install default-jdk-headless
then
bazel build :cyber
or
bazel build //mainboard:mainboard
or build with cpplint:
bazel test //examples:talker_cpplint
cpplint errors will be displayed in the test.log
file.
bazel run //tools:install /opt/cyber/
it will install tools into /opt/cyber
like:
/opt/cyber/
├── bin
│ ├── cyber_channel
│ ├── cyber_launch
│ ├── cyber_monitor
│ └── cyber_recorder
to install the cyber:
bazel build :install
sudo apt install patchelf
bazel run :install /opt/cyber/
During build, if there is any bazel fetching error like this:
INFO: Repository six instantiated at:
/home/nvidia/gitlab/cyber/WORKSPACE:72:10: in <toplevel>
/home/nvidia/.cache/bazel/_bazel_nvidia/74e5ea07038a5a936b5238c85ebefb29/external/com_github_grpc_grpc/bazel/grpc_deps.bzl:331:21: in grpc_deps
/home/nvidia/.cache/bazel/_bazel_nvidia/74e5ea07038a5a936b5238c85ebefb29/external/com_github_grpc_grpc/bazel/grpc_python_deps.bzl:11:21: in grpc_python_deps
Repository rule http_archive defined at:
/home/nvidia/.cache/bazel/_bazel_nvidia/74e5ea07038a5a936b5238c85ebefb29/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
WARNING: Download from https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz failed: class java.io.IOException connect timed out
ERROR: An error occurred during the fetch of repository 'six':
- Get
cyber/build/bazel_tools/six-1.12.0.tar.gz
's absolute path like/home/nvidia/gitlab/cyber/build/bazel_tools/six-1.12.0.tar.gz
- Edit file of
/home/nvidia/.cache/bazel/_bazel_nvidia/74e5ea07038a5a936b5238c85ebefb29/external/com_github_grpc_grpc/bazel/grpc_python_deps.bzl
, changeurls
to be like:
#urls = ["https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz"],
urls = ["file:///home/nvidia/gitlab/cyber/build/bazel_tools/six-1.12.0.tar.gz"],
[temperary solution]
in /opt/cyber/include
run
protoc proto/*.proto --cpp_out=.
First, initialize some env variables:
source /opt/cyber/setup.bash
then run
/opt/cyber/examples/talker
or
/opt/cyber/examples/listener
Log messages will be displayed. To turn off the log message, edit the config value in /opt/cyber/setup.bash
.