ROS安装

1、添加ros 源
ROS的sources.list为国内镜像:
sudo sh -c ‘. /etc/lsb-release && echo “deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ focal main” > /etc/apt/sources.list.d/ros-latest.list’
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt-get update
2、安装
sudo apt-get install ros-noetic-desktop-full
sudo apt-get install python3-rosinstall
sudo apt-get install python3-rosinstall-generator

3、初始化rosdep
sudo rosdep init
rosdep update

ub@ubuntu:~$ sudo rosdep init
ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.
解决办法:
1) 通过站长工具 找到 raw.githubusercontent.com 对应的ip地址
2) 修改/etc/hosts 文件
     151.101.108.133  raw.githubusercontent.com

4、验证安装
roslaunch roscpp_tutorials talker_listener.launch

ub@ubuntu:~/catkin_ws$ roslaunch roscpp_tutorials talker_listener.launch
... logging to /home/ub/.ros/log/ac96d69c-cef2-11ea-a8b8-93d69a295793/roslaunch-ubuntu-27771.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ubuntu:40091/

SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.7

NODES
  /
    listener (roscpp_tutorials/listener)
    talker (roscpp_tutorials/talker)

auto-starting new master
process[master]: started with pid [27779]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to ac96d69c-cef2-11ea-a8b8-93d69a295793
process[rosout-1]: started with pid [27789]
started core service [/rosout]
process[listener-2]: started with pid [27792]
process[talker-3]: started with pid [27793]
[ INFO] [1595735226.824332667]: hello world 0
[ INFO] [1595735226.925389622]: hello world 1
[ INFO] [1595735227.024916958]: hello world 2
[ INFO] [1595735227.025693829]: I heard: [hello world 2]
[ INFO] [1595735227.124606992]: hello world 3
[ INFO] [1595735227.125318581]: I heard: [hello world 3]
[ INFO] [1595735227.224805104]: hello world 4

5、安装环境:
Ubuntu 20.04 LTS
ros-noetic

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值