这篇文章很好
https://blog.csdn.net/weixin_51495377/article/details/132797013
使用脚本来控制的好处是比较灵活与功能强大
这里附上我的脚本
bash
#!/bin/sh
set -e
echo "Installing My pd_sns Application..."
cp -r ../application/lib/cartographer_ros/* /home/peak/okagv2020/install/lib/cartographer_ros
cp -r ../application/share/cartographer_ros/* /home/peak/okagv2020/install/share/cartographer_ros
echo "Done."
sudo chmod 777 /home/peak/okagv2020/install/lib/cartographer_ros/cartographer_node
echo "chmod Done."
exit 0
主要是拷贝及赋权限