raspberrypi 4b install ROS

7 篇文章 0 订阅

参考:https://blog.csdn.net/sinat_23857245/article/details/45225147

# 编辑 `/etc/apt/sources.list` 文件,删除原文件所有内容,用以下内容取代:
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib

# 编辑 `/etc/apt/sources.list.d/raspi.list` 文件,删除原文件所有内容,用以下内容取代:
deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui

Linux下安装Boost1.58

  1. 首先登陆Boost官网(http://www.boost.org/)。

  2. 点击中间download下面的 Version 1.58.0,下载boost_1_58_0.tar.bz2。

  3. 解压下载文件

    tar --bzip2 -xvf boost_1_58_0.tar.bz2

  4. 进入解压后的文件,获得bjam

    cd boost_1_58_0

    ./bootstrap.sh

    可以看到在当前目录下生成了bjam文件

  5. 完整编译Boost

    ./bjam

    编译时间比较长

  6. 将生成的库默认安装到 /urs/local/lib 目录

    ./bjam install

    此时可以看到 /urs/local/lib 目录下包含了很多Boost文件

安装ros过程中找不到Boost

sudo ./src/catkin/bin/catkin_make_isolated --install -DBOOST_ROOT=/home/pi/boost_1_58_0 -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic

///START setup

sudo sh -c ‘echo “deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main” > /etc/apt/sources.list.d/ros-latest.list’
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install -y python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential cmake

sudo rosdep init
rosdep update

mkdir -p ~/ros_catkin_ws
cd ~/ros_catkin_ws

rosinstall_generator ros_comm --rosdistro kinetic --deps --wet-only --tar > kinetic-ros_comm-wet.rosinstall
wstool init src kinetic-ros_comm-wet.rosinstall

(if wstool init fails or is interrupted, you can resume the download by running:
wstool update -j4 -t src )

mkdir -p ~/ros_catkin_ws/external_src
cd ~/ros_catkin_ws/external_src
wget http://sourceforge.net/projects/assimp/files/assimp-3.1/assimp-3.1.1_no_test_models.zip/download -O assimp-3.1.1_no_test_models.zip
unzip assimp-3.1.1_no_test_models.zip
cd assimp-3.1.1
cmake .
make
sudo make install

cd ~/ros_catkin_ws
rosdep install -y --from-paths src --ignore-src --rosdistro kinetic -r --os=debian:buster

sudo ./src/catkin/bin/catkin_make_isolated --install -DBOOST_ROOT=/home/pi/boost_1_58_0 -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic
( compilation will fail with an “internal compiler error” caused by memory exhaustion. A quick fix for this is to add swap space to the Pi and recompile. If the error persists try building with the -j2 option instead of the default -j4 option:

sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic -j2)

source /opt/ros/kinetic/setup.bash
echo “source /opt/ros/kinetic/setup.bash” >> ~/.bashrc

/end

Maintaining a Source Checkout
Updating the Workspace
See the Ubuntu source install instructions for steps on updating the ros_catkin_ws workspace. The same steps should apply to the Raspberry Pi.

Adding Released Packages
You may add additional packages to the installed ros workspace that have been released into the ros ecosystem. First, a new rosinstall file must be created including the new packages (Note, this can also be done at the initial install). For example, if we have installed ros_comm, but want to add ros_control and joystick_drivers, the command would be:

$ cd ~/ros_catkin_ws
$ rosinstall_generator actionlib astra_camera astra_launch bfl bond bondcpp tf serial ros_control joystick_drivers --rosdistro kinetic --deps --wet-only --tar > kinetic-custom_ros.rosinstall
You may keep listing as many ROS packages as you’d like separated by spaces.

Next, update the workspace with wstool:

$ wstool merge -t src kinetic-custom_ros.rosinstall
$ wstool update -t src
After updating the workspace, you may want to run rosdep to install any new dependencies that are required:

Raspbian Jessie:

$ rosdep install --from-paths src --ignore-src --rosdistro kinetic -y -r --os=debian:buster
Finally, now that the workspace is up to date and dependencies are satisfied, rebuild the workspace:

$ sudo ./src/catkin/bin/catkin_make_isolated --install -DBOOST_ROOT=/home/pi/boost_1_58_0 -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值