ROS下载与安装

本文仅仅作为学习笔记,有兴趣的童鞋可以一起学习并提出宝贵意见。

初次接触ROS,现在开始学习安装和配置环境:(下面一些文字转自ros.org,版权属于原网站,本文仅作学习笔记。文章为英文,顺便复习一下英文吧!)

Installation

 

Configure your Ubuntu repositories

Configure your Ubuntu repositories to allow "restricted," "universe," and "multiverse." You can follow the Ubuntu guidefor instructions on doing this.

 

Setup your sources.list

Setup your computer to accept software from packages.ros.org.

  •  

    sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

     

Mirrors

Source Debs are also available

 

Set up your keys

  • sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

If you experience issues connecting to the keyserver, you can try substituting hkp://pgp.mit.edu:80 or hkp://keyserver.ubuntu.com:80 in the previous command.

Alternatively, you can use curl instead of the apt-key command, which can be helpful if you are behind a proxy server:

  • curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add -

 

Installation

First, make sure your Debian package index is up-to-date:

  • sudo apt update

There are many different libraries and tools in ROS. We provided four default configurations to get you started. You can also install ROS packages individually.

In case of problems with the next step, you can use following repositories instead of the ones mentioned above ros-shadow-fixed

  • Desktop-Full Install: (Recommended) : ROS, rqtrviz, robot-generic libraries, 2D/3D simulators and 2D/3D perception

    • sudo apt install ros-melodic-desktop-full

      or click here

    Desktop Install: ROS, rqtrviz, and robot-generic libraries

    • sudo apt install ros-melodic-desktop

      or click here

    ROS-Base: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.

    • sudo apt install ros-melodic-ros-base

      or click here

    Individual Package: You can also install a specific ROS package (replace underscores with dashes of the package name):

    • sudo apt install ros-melodic-PACKAGE
      e.g.
      sudo apt install ros-melodic-slam-gmapping

To find available packages, use:

apt search ros-melodic

 

Initialize rosdep

Before you can use ROS, you will need to initialize rosdep. rosdep enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS.

 

sudo rosdep init
rosdep update

Environment setup

It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched:

 

echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc

If you have more than one ROS distribution installed, ~/.bashrc must only source the setup.bash for the version you are currently using.

If you just want to change the environment of your current shell, instead of the above you can type:

 

source /opt/ros/melodic/setup.bash

If you use zsh instead of bash you need to run the following commands to set up your shell:

 

echo "source /opt/ros/melodic/setup.zsh" >> ~/.zshrc
source ~/.zshrc

 

Dependencies for building packages

Up to now you have installed what you need to run the core ROS packages. To create and manage your own ROS workspaces, there are various tools and requirements that are distributed separately. For example, rosinstall is a frequently used command-line tool that enables you to easily download many source trees for ROS packages with one command.

To install this tool and other dependencies for building ROS packages, run:

 

sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential

 

Build farm status

The packages that you installed were built by the ROS build farm. You can check the status of individual packages here.

 

 

Tutorials

Now, to test your installation, please proceed to the ROS Tutorials.

要在Ubuntu上安装darknet_ros,你可以按照以下步骤进行操作: 1. 首先,确保你已经安装ROS,并且ROS的版本与你的Ubuntu版本相对应。你可以从官方网站下载ROS安装包\[1\]。 2. 下载darknet_ros的代码。你可以从gitee上下载代码并进行安装\[2\]。 3. 在安装darknet_ros之前,你可能需要解决一些报错。这些报错可能是由于权重文件、代码下载ROS的问题引起的。你可以尝试从官网下载权重文件、重新下载代码或从官网下载ROS来解决这些问题\[2\]。 4. 在运行darknet_ros之前,你需要修改配置文件,使得darknet_ros订阅的话题与你的摄像头发布的图片话题对应。你可以打开darknet_ros的配置文件ros.yaml,并将camera_reading的topic修改为你的摄像头发布的图片话题,比如/camera/rgb/image_raw\[3\]。 总结起来,安装darknet_ros的步骤包括下载ROS下载darknet_ros代码、解决可能出现的报错,并修改配置文件以使其与你的摄像头对应\[1\]\[2\]\[3\]。 #### 引用[.reference_title] - *1* *2* *3* [darknet_ros安装的以及在PX4无人机仿真平台的目标检测](https://blog.csdn.net/qq_45067735/article/details/108014941)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值