libcyber is a fork of Apollo cyber, which supports cross-compilation.
git clone --single-branch --branch main https://github.com/MambaWong/libcyber.git
- fasrrtps & fastcdr
- ncurses
cd libcyber
bazel build --platforms=@gcc_toolchain//platforms:aarch64_linux -c opt --copt=-fpic //cyber/...
Set CYBER_INSTALL_PREFIX
as the installation directory for cyber.
bazel run --platforms=@gcc_toolchain//platforms:aarch64_linux -c opt --copt=-fpic //cyber:install -- ${CYBER_INSTALL_PREFIX}/cyber --pre_clean
bazel run --platforms=@gcc_toolchain//platforms:aarch64_linux -c opt --copt=-fpic //cyber:install_src -- ${CYBER_INSTALL_PREFIX}/cyber
CYBER_SYSROOT_DIR
defaults to /opt/cyber/sysroot/
.
mkdir ${CYBER_INSTALL_PREFIX}/cyber/lib/external
cp ${CYBER_SYSROOT_DIR}/lib/libfastrtps.so.1 ${CYBER_SYSROOT_DIR}/lib/libfastcdr.so.1 ${CYBER_INSTALL_PREFIX}/cyber/lib/external
cp ${CYBER_SYSROOT_DIR}/lib/libncurses.so.6 ${CYBER_INSTALL_PREFIX}/cyber/lib/external
cd ${CYBER_INSTALL_PREFIX}
tar czvf cyber.tar.gz cyber/
#
scp cyber.tar.gz username@target_ip:/workspaces/
cd /workspaces/
tar xzvf cyber.tar.gz
cd cyber && mkdir -p ./data/log
In each open terminal, execute the following commands.
cd /workspaces/cyber/
LD_LIBRARY_PATH=$(echo $(find "$(pwd)/lib" -mindepth 1 -type d -exec realpath {} \;) | tr ' ' ':'):$LD_LIBRARY_PATH
export APOLLO_DAG_PATH=./share/cyber/examples/
export APOLLO_LIB_PATH=./lib/
export CYBER_PATH=./share/cyber/
export GLOG_log_dir="$(pwd)/data/log"
export GLOG_alsologtostderr=1
export GLOG_minloglevel=0
export GLOG_v=5
Open two terminals and execute the following commands respectively.
-
talker
./bin/talker
-
listener
./bin/listener
Open three terminals and execute the following commands respectively.
./bin/channel_prediction_writer
./bin/channel_test_writer
./bin/mainboard -d common_component_example/common.dag
libcyber referenced the following projects: