本文主要部分来源于ROS官网的Tutorials.

Ubuntu install of ROS Kinetic

# Setup your sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# Set up your keys
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
# Installation
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full # Desktop-Full Install: (Recommended)
# Initialize rosdep
sudo rosdep init
rosdep update
# Environment setup, so ROS environment variables are automatically added to your bash session every time a new shell is launched
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
# Install this tool and other dependencies for building ROS packages
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential

Configuring Your ROS Environment

#  check to ensure that environment variables like ROS_ROOT and ROS_PACKAGE_PATH are set
printenv | grep ROS
source /opt/ros/kinetic/setup.bash # if no ROS variable are set, run this command # Create a ROS Workspace (use the recommended catkin)
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make

# source your new setup.*sh file when a new shell is launched
echo 'source /home/youruser/catkin_ws/devel/setup.bash' >> ~/.bashrc
source ~/.bashrc
echo $ROS_PACKAGE_PATH # you will see /home/youruser/catkin_ws/src:/opt/ros/kinetic/share

Navigating the ROS Filesystem

sudo apt-get install ros-kinetic-ros-tutorials
rospack find roscpp # rospack find [package_name], returns the path to package roscd roscpp
pwd # You can see that YOUR_INSTALL_PATH/share/roscpp is the same path that rospack find gave in the previous example echo $ROS_PACKAGE_PATH # ROS_PACKAGE_PATH should contain a list of directories where you have ROS packages separated by colons roscd roscpp/cmake # roscd can also move to a subdirectory of a package or stack
pwd roscd log # take you to the folder where ROS stores log files
# Note that if you have not run any ROS programs yet, this will yield an error saying that it does not yet exist. rosls roscpp_tutorials # rosls is part of the rosbash suite. It allows you to ls directly in a package by name rather than by absolute path. # Tab Completion
roscd roscpp_tut<<< now push the TAB key >>>

Creating a ROS Package

cd ~/catkin_ws/src
# catkin_create_pkg <package_name> [depend1] [depend2] [depend3]
catkin_create_pkg beginner_tutorials std_msgs rospy roscpp # create a new package called 'beginner_tutorials' which depends on std_msgs, roscpp, and rospy # build the packages in the catkin workspace
cd ~/catkin_ws
catkin_make
# To add the workspace to your ROS environment you need to source the generated setup file
. ~/catkin_ws/devel/setup.bash rospack depends1 beginner_tutorials # First-order dependencies roscd beginner_tutorials
cat package.xml # These dependencies for a package are stored in the package.xml file rospack depends beginner_tutorials # Indirect dependencies, rospack can recursively determine all nested dependencies

Building a ROS Package

cd ~/catkin_ws/
ls src
catkin_make # build all catkin projects found in the src folder.
catkin_make install # (optionally)
ls

Understanding ROS Nodes

sudo apt-get install ros-kinetic-ros-tutorials # install a lightweight simulator
roscore # the first thing you should run when using ROS
rosnode list # lists active nodes
rosnode info /rosout # display information about a specific node

# in a new terminal:
rosrun turtlesim turtlesim_node # You will see the turtlesim window

# in a new termina
rosnode list # lists active nodes
rosrun turtlesim turtlesim_node __name:=my_turtle # change the node's name to my_turtle
rosnode list # lists active nodes
rosnode ping my_turtle # test that it's up

Review

  • Nodes: A node uses ROS to communicate with other nodes. A node really isn't much more than an executable file within a ROS package.
  • Messages: ROS data type used when subscribing or publishing to a topic.
  • Topics: Nodes can publish messages to a topic as well as subscribe to a topic to receive messages.
  • Master: Name service for ROS (i.e. helps nodes find each other)
  • rosout: ROS equivalent of stdout/stderr
  • roscore: Master + rosout + parameter server (parameter server will be introduced later)

You may have noticed a pattern with the naming of the ROS tools,This naming pattern holds for many of the ROS tools.

  • rospack = ros + pack(age)
  • roscd = ros + cd
  • rosls = ros + ls
  • roscore = ros+core : master (provides name service for ROS) + rosout (stdout/stderr) + parameter server (parameter server will be introduced later)
  • rosnode = ros+node : ROS tool to get information about a node.
  • rosrun = ros+run : runs a node from a given package.

Learning ROS: Ubuntu16.04下kinetic开发环境安装和初体验 Install + Configure + Navigating(look around) + Creating a Package(catkin_create_pkg) + Building a Package(catkin_make) + Understanding Nodes的更多相关文章

  1. Ubuntu16.04下搭建开发环境及编译tiny4412 Android系统【转】

    本文转载自:http://blog.csdn.net/songze_lee/article/details/72808631 版权声明:本文为博主原创文章,未经博主允许不得转载. 1.安装ssh服务器 ...

  2. Ubuntu 14.04下java开发环境的搭建--3--Tomcat及MySQL的安装

    前面两篇文章,已经说明了JDK和Eclipse 的安装方法,下面简单说一下,Tomcat及MySQL的安装方法. Tomcat的安装. 在合适的地方解压apache-tomcat-6.0.39.tar ...

  3. Ubuntu16.04搭建LAMP开发环境

    Ubuntu16.04搭建LAMP开发环境 虚拟机上安装好Ubuntu16.04后,是一台空白的Ubuntu.我的目的是搭建LAMP环境,顺便搭一个Python Django环境. 基本设置 1.配置 ...

  4. 联盛德 HLK-W806 (一): Ubuntu20.04下的开发环境配置, 编译和烧录说明

    目录 联盛德 HLK-W806 (一): Ubuntu20.04下的开发环境配置, 编译和烧录说明 联盛德 HLK-W806 (二): Win10下的开发环境配置, 编译和烧录说明 联盛德 HLK-W ...

  5. Ubuntu16.04下Mongodb官网安装部署步骤(图文详解)(博主推荐)

    不多说,直接上干货! 在这篇博客里,我采用了非官网的安装步骤,来进行安装.走了弯路,同时,也是不建议.因为在大数据领域和实际生产里,还是要走正规的为好. Ubuntu16.04下Mongodb(离线安 ...

  6. ubuntu16.04 Golang语言开发环境搭建

    golang即go语言是跨平台的语言,适用于windows 和linux平台,下面介绍linux平台下ubuntu16.04系统下的开发环境搭建过程. 一.安装开发必备环境 执行下面命令分别安装git ...

  7. Ubuntu16.04下Mongodb(离线安装方式|非apt-get)安装部署步骤(图文详解)(博主推荐)

    不多说,直接上干货! 说在前面的话  首先,查看下你的操作系统的版本. root@zhouls-virtual-machine:~# cat /etc/issue Ubuntu LTS \n \l r ...

  8. Ubuntu16.04搭建各种开发环境的IDE: QT5 , CodeBlocks ,eclipse-cdt, PyCharm

    搭建Ubuntu下C/C++以及Python的集成开发环境,采用双系统(Win7+Ubuntu)的Ubuntu16.04-LTS系统, 关于双系统的搭建可以参考下面博客(图文十分详细):https:/ ...

  9. Ubuntu 14.04下java开发环境的搭建--1--JDK的安装

    说明:以下内容均是本人个人经验,接触ubuntu系统是从10.04开始,转眼转眼之间已经四年了,经常浏览各种相关论坛,发现从我刚开始基础到现在,论坛上还有很多人在问关于JAVA环境配置的相关问题.所以 ...

随机推荐

  1. [NOIp2017]宝藏 题解

    非常巧妙的 \(O(n^23^n)\) 做法. 题目的本质是要求一棵生成树,使得其每条边的长度与这条边的起点深度乘积的和最小. 我们使用状压 DP,考虑到当前状态与已经打通的点和深度有关,不妨设 \( ...

  2. ui自动化,不显示UI界面运行

    from selenium import webdriver from selenium.webdriver.chrome.options import Options chrome_options ...

  3. ELK:match 的底层转换

    在ES中,执行match搜索的时候,ES底层通常都会对搜索条件进行底层转换,来实现最终的搜索结果.如: GET /student/java/_search { "query": { ...

  4. 第三十二篇 -- CreateFile、ReadFile、WriteFile

    一.CreateFile 这是一个多功能的函数,可打开或创建文件或者I/O设备,并返回可访问的句柄:控制台,通信资源,目录(只读打开),磁盘驱动器,文件,邮槽,管道. 函数原型: HANDLE WIN ...

  5. eladmin-plus V2.0.0 发布,单表链式调用更丝滑

    一.项目简介 eladmin的mybatis-plus版本,单表使用链式调用,代码更简洁,调用更便捷.目前更新到2021年7月.项目基于 Spring Boot 2.4.2 . Mybatis-plu ...

  6. LUSE: 无监督数据预训练短文本编码模型

    LUSE: 无监督数据预训练短文本编码模型 1 前言 本博文本应写之前立的Flag:基于加密技术编译一个自己的Python解释器,经过半个多月尝试已经成功,但考虑到安全性问题就不公开了,有兴趣的朋友私 ...

  7. .net 知新:【3】.net 5 项目结构说明和发布部署

    .net 5的项目目录结构和.net framework有些明显的变化,包括显示结构和项目文件,从这两个方面看看有哪些变化. 项目目录结构 就以上篇用的demo项目为例([.net 知新:[2] .N ...

  8. InnoDB锁机制-转载

    InnoDB锁机制 1. 锁类型 锁是数据库区别与文件系统的一个关键特性,锁机制用于管理对共享资源的并发访问. InnoDB使用的锁类型,分别有: 共享锁(S)和排他锁(X) 意向锁(IS和IX) 自 ...

  9. K8S为什么要弃用Docker?Dockershim将移除

    一.背景由于最近知道了 K8s 新版本(v1.20)确定弃用 Docker 的消息,为了明确是否会对现有系统架构产生响,所以对涉及到的相关技术进行了一定的梳理(索性的是对现有的系统架构基本无影响:&g ...

  10. [TensorFlow2.0]-张量与常用函数

    本人人工智能初学者,现在在学习TensorFlow2.0,对一些学习内容做一下笔记.笔记中,有些内容理解可能较为肤浅.有偏差等,各位在阅读时如有发现问题,请评论或者邮箱(右侧边栏有邮箱地址)提醒. 若 ...