ROS的预备知识记录

---恢复内容开始---

本文假设你已经有了ROS的开发环境,其实无论是源码安装还是使用安装包安装的ROS,都是一样的。

一、创建工作区并完成适当的设置工作

  1、新建目录,必须包含src子目录

  mkdir -p ~/catkin_wks/src

  2、初步初始化工作空间,创建的/opt/ros/melodic/share/catkin/cmake/toplevel.cmake文件的本地链接而以

  cd catkin_wks/src/ && catkin_init_workspace

  返回信息:

  Creating symlink "/home/openlib/catkin_wks/src/CMakeLists.txt" pointing to "/opt/ros/melodic/share/catkin/cmake/toplevel.cmake"

  3、再次初始化工作空间

  cd ../ && catkin_make

  返回信息:

Base path: /home/openlib/catkin_wks
Source space: /home/openlib/catkin_wks/src
Build space: /home/openlib/catkin_wks/build
Devel space: /home/openlib/catkin_wks/devel
Install space: /home/openlib/catkin_wks/install
####
#### Running command: "cmake /home/openlib/catkin_wks/src -DCATKIN_DEVEL_PREFIX=/home/openlib/catkin_wks/devel -DCMAKE_INSTALL_P
REFIX=/home/openlib/catkin_wks/install -G Unix Makefiles" in "/home/openlib/catkin_wks/build"                                    
####
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using CATKIN_DEVEL_PREFIX: /home/openlib/catkin_wks/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/melodic
-- This workspace overlays: /opt/ros/melodic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.15", minimum required is "2")  
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/openlib/catkin_wks/build/test_results
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.15")  
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE   
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.17
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- Configuring done
-- Generating done
-- Build files have been written to: /home/openlib/catkin_wks/build
####
#### Running command: "make -j4 -l4" in "/home/openlib/catkin_wks/build"
####

  根据提示,如果使用c++开发ROS节点,必须执行命令,否则,可以不予理会,直接跳过:

  cd build/ && make -j8 -l8

  配置终端环境,这个是一次性的配置:

  cd ../ && source devel/setup.bash

  4、永久配置终端工作区,只要打开终端就自动配置好工作区:将source  ~/catkin_wks/devel/setup.bash写入.bashrc文件中

  echo "source  ~/catkin_wks/devel/setup.bash" >> ~/.bashrc  

二、创建包:

  Ros中无论代码、数据、文档都是以包的形式来管理;包一般位于工作区中的的src目录中;创建成功的包至少包含两个文件CMakeLists.txt和package.xml文件,一个目录src子目录;所谓的包管理只是目录管理的别称而以;src中主要存放python代码

  1、包的创建,创建名称为myAwesomeCode的包,并且该包依赖rospy包,如果有更多的依赖,一并跟到后边,构成依赖列表即可:

  cd ~/catkin_wks/src/ && catkin_create_pkg myAwesomeCode rospy 

  返回信息,提示信息抱怨不能包含大写字母,个人习惯在单词分割处采用大写字母,有的人喜欢用下划线分割,ros更倾向于后者:

WARNING: Package name "myAwesomeCode" does not follow the naming conventions. It should start with a lower case letter and only
contain lower case letters, digits, underscores, and dashes.
Created file myAwesomeCode/CMakeLists.txt
Created file myAwesomeCode/package.xml
Created folder myAwesomeCode/src
Successfully created files in /home/openlib/catkin_wks/src/myAwesomeCode. Please adjust the values in package.xml.  

  根据提示信息,可见包创建中主要在工作区的src目录完成了创建包同名的字母的创建,并在该目录下下创建两个文件CMakeLists.txt和package.xml的创建和一个目录src子目录的创建

  其中CMakeLists.txt的内容:

  

cmake_minimum_required(VERSION 2.8.3)                                                                                                                                                                                                                                                                                                          
project(myAwesomeCode)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  rospy
)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
################################################

## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
##   * add a build_depend tag for "message_generation"
##   * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
##   * If MSG_DEP_SET isn't empty the following dependency has been pulled in
##     but can be declared for certainty nonetheless:
##     * add a exec_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
##   * add "message_generation" and every package in MSG_DEP_SET to
##     find_package(catkin REQUIRED COMPONENTS ...)
##   * add "message_runtime" and every package in MSG_DEP_SET to
##     catkin_package(CATKIN_DEPENDS ...)
##   * uncomment the add_*_files sections below as needed
##     and list every .msg/.srv/.action file to be processed
##   * uncomment the generate_messages entry below
##   * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)

## Generate messages in the 'msg' folder
# add_message_files(
#   FILES
#   Message1.msg
#   Message2.msg
# )

## Generate services in the 'srv' folder
# add_service_files(
#   FILES
#   Service1.srv
#   Service2.srv
# )

## Generate actions in the 'action' folder
# add_action_files(
#   FILES
#   Action1.action
#   Action2.action
# )

## Generate added messages and services with any dependencies listed here
# generate_messages(
#   DEPENDENCIES
#   std_msgs  # Or other packages containing msgs
# )

################################################
## Declare ROS dynamic reconfigure parameters ##
################################################

## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
##   * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
##   * add "dynamic_reconfigure" to
##     find_package(catkin REQUIRED COMPONENTS ...)
##   * uncomment the "generate_dynamic_reconfigure_options" section below
##     and list every .cfg file to be processed

## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
#   cfg/DynReconf1.cfg
#   cfg/DynReconf2.cfg
# )

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES myAwesomeCode
#  CATKIN_DEPENDS rospy
#  DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
  ${catkin_INCLUDE_DIRS}
)

## Declare a C++ library
# add_library(${PROJECT_NAME}
#   src/${PROJECT_NAME}/myAwesomeCode.cpp
# )

## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/myAwesomeCode_node.cpp)

## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
## target back to the shorter version for ease of user use
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")

## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Specify libraries to link a library or executable target against
# target_link_libraries(${PROJECT_NAME}_node
#   ${catkin_LIBRARIES}
# )

#############
## Install ##
#############

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
#   scripts/my_python_script
#   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
# install(TARGETS ${PROJECT_NAME}_node
#   RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark libraries for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
# install(TARGETS ${PROJECT_NAME}
#   ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
#   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
#   RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
# )

## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
#   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
#   FILES_MATCHING PATTERN "*.h"
#   PATTERN ".svn" EXCLUDE
# )

## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
#   # myfile1
#   # myfile2
#   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )

#############
## Testing ##
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_myAwesomeCode.cpp)
# if(TARGET ${PROJECT_NAME}-test)
#   target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)                                                                                                                                                                                                                                                                                                                   
                                        

  该文件主要是为下一步的camke作准备,如果需要cmake时,该文件将非常关键。

  主要有find_package()、add_message_files()   generate_messages()   catkin_package()方法的配置

  而package.xml的内容: 

<?xml version="1.0"?>                                                                                                                                                                                                                          
<package format="2">
  <name>myAwesomeCode</name>
  <version>0.0.0</version>
  <description>The myAwesomeCode package</description>

  <!-- One maintainer tag required, multiple allowed, one person per tag -->
  <!-- Example:  -->
  <!-- <maintainer email="[email protected]">Jane Doe</maintainer> -->
  <maintainer email="[email protected]">openlib</maintainer>


  <!-- One license tag required, multiple allowed, one license per tag -->
  <!-- Commonly used license strings: -->
  <!--   BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
  <license>TODO</license>


  <!-- Url tags are optional, but multiple are allowed, one per tag -->
  <!-- Optional attribute type can be: website, bugtracker, or repository -->
  <!-- Example: -->
  <!-- <url type="website">http://wiki.ros.org/myAwesomeCode</url> -->


  <!-- Author tags are optional, multiple are allowed, one per tag -->
  <!-- Authors do not have to be maintainers, but could be -->
  <!-- Example: -->
  <!-- <author email="[email protected]">Jane Doe</author> -->


  <!-- The *depend tags are used to specify dependencies -->
  <!-- Dependencies can be catkin packages or system dependencies -->
  <!-- Examples: -->
  <!-- Use depend as a shortcut for packages that are both build and exec dependencies -->
  <!--   <depend>roscpp</depend> -->
  <!--   Note that this is equivalent to the following: -->
  <!--   <build_depend>roscpp</build_depend> -->
  <!--   <exec_depend>roscpp</exec_depend> -->
  <!-- Use build_depend for packages you need at compile time: -->
  <!--   <build_depend>message_generation</build_depend> -->
  <!-- Use build_export_depend for packages you need in order to build against this package: -->
  <!--   <build_export_depend>message_generation</build_export_depend> -->
  <!-- Use buildtool_depend for build tool packages: -->
  <!--   <buildtool_depend>catkin</buildtool_depend> -->
  <!-- Use exec_depend for packages you need at runtime: -->
  <!--   <exec_depend>message_runtime</exec_depend> -->
  <!-- Use test_depend for packages you need only for testing: -->
  <!--   <test_depend>gtest</test_depend> -->
  <!-- Use doc_depend for packages you need only for building documentation: -->
  <!--   <doc_depend>doxygen</doc_depend> -->
  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>rospy</build_depend>
  <build_export_depend>rospy</build_export_depend>
  <exec_depend>rospy</exec_depend>


  <!-- The export tag contains other, unspecified, tags -->
  <export>
    <!-- Other tools can request additional information be placed here -->

  </export>
</package>

  该文件主要描述了包的内容与catkin的交互方式,包括以下9个部分:

  1、程序包名

  2、程序版本号

  3、功能描述

  4、维护和修复着信息

  5、程序许可证信息

  6、程序包的URL信息

  7、作者们的信息

  8、包的依赖信息

  9、其他相关信息

  

三、创建代码

  该步骤先略过

四、运行例程代码个查看运行信息

  开第一个终端运行:roscore

  返回信息:

... logging to /home/openlib/.ros/log/a8243616-f3bc-11e9-97b3-3464a91cb6c2/roslaunch-developz-5178.log                            
Checking log directory for disk usage. This may take awhile.                                                                      
Press Ctrl-C to interrupt                                                                                                         
Done checking log file disk usage. Usage is <1GB.                                                                                 
                                                                                                                                 
started roslaunch server http://developz:40643/                                                                                   
ros_comm version 1.14.3                                                                                                           


SUMMARY
========

PARAMETERS
* /rosdistro: melodic
* /rosversion: 1.14.3

NODES

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

setting /run_id to a8243616-f3bc-11e9-97b3-3464a91cb6c2
WARNING: Package name "myAwesomeCode" does not follow the naming conventions. It should start with a lower case letter and only c
ontain lower case letters, digits, underscores, and dashes.
process[rosout-1]: started with pid [5199]
started core service [/rosout]

  rosrun的格式:rosrun  packageName  executName  [ARGS]

  开第二个终端运行:rosrun  rospy_tutorials  talker

  返回信息:

rosrun rospy_tutorials talker
[INFO] [1571632778.697190]: hello world 1571632778.7
[INFO] [1571632778.797637]: hello world 1571632778.8
[INFO] [1571632778.897323]: hello world 1571632778.9
[INFO] [1571632778.997688]: hello world 1571632779.0
[INFO] [1571632779.097660]: hello world 1571632779.1
[INFO] [1571632779.197704]: hello world 1571632779.2
[INFO] [1571632779.297709]: hello world 1571632779.3
[INFO] [1571632779.397694]: hello world 1571632779.4
[INFO] [1571632779.497683]: hello world 1571632779.5
[INFO] [1571632779.597744]: hello world 1571632779.6
[INFO] [1571632779.697699]: hello world 1571632779.7                                                                              
[INFO] [1571632779.797760]: hello world 1571632779.8                                                                              
[INFO] [1571632779.897667]: hello world 1571632779.9                                                                              
[INFO] [1571632779.997731]: hello world 1571632780.0                                                                              
[INFO] [1571632780.097680]: hello world 1571632780.1                                                                              
[INFO] [1571632780.197637]: hello world 1571632780.2                                                                              
[INFO] [1571632780.297651]: hello world 1571632780.3                                                                              
[INFO] [1571632780.397748]: hello world 1571632780.4                                                                              
[INFO] [1571632780.497736]: hello world 1571632780.5                                                                              
[INFO] [1571632780.597785]: hello world 1571632780.6                                                                              
[INFO] [1571632780.697701]: hello world 1571632780.7                                                                              
[INFO] [1571632780.797470]: hello world 1571632780.8                                                                              
[INFO] [1571632780.897671]: hello world 1571632780.9                                                                              
[INFO] [1571632780.997640]: hello world 1571632781.0                                                                              
[INFO] [1571632781.097389]: hello world 1571632781.1                                                                              
[INFO] [1571632781.197665]: hello world 1571632781.2                                                                              
[INFO] [1571632781.297650]: hello world 1571632781.3                                                                              
[INFO] [1571632781.397795]: hello world 1571632781.4 

  开第三个终端运行:rosrun  rospy_tutorials  listener

  返回信息:

rosrun rospy_tutorials listener
[INFO] [1571632853.901133]: /listener_5587_1571632853679I heard hello world 1571632853.9
[INFO] [1571632853.998517]: /listener_5587_1571632853679I heard hello world 1571632854.0
[INFO] [1571632854.100438]: /listener_5587_1571632853679I heard hello world 1571632854.1
[INFO] [1571632854.201572]: /listener_5587_1571632853679I heard hello world 1571632854.2
[INFO] [1571632854.301579]: /listener_5587_1571632853679I heard hello world 1571632854.3
[INFO] [1571632854.401040]: /listener_5587_1571632853679I heard hello world 1571632854.4
[INFO] [1571632854.501363]: /listener_5587_1571632853679I heard hello world 1571632854.5
[INFO] [1571632854.600271]: /listener_5587_1571632853679I heard hello world 1571632854.6
[INFO] [1571632854.701491]: /listener_5587_1571632853679I heard hello world 1571632854.7
[INFO] [1571632854.801139]: /listener_5587_1571632853679I heard hello world 1571632854.8
[INFO] [1571632854.901557]: /listener_5587_1571632853679I heard hello world 1571632854.9
[INFO] [1571632855.001366]: /listener_5587_1571632853679I heard hello world 1571632855.0
[INFO] [1571632855.101437]: /listener_5587_1571632853679I heard hello world 1571632855.1
[INFO] [1571632855.200990]: /listener_5587_1571632853679I heard hello world 1571632855.2
[INFO] [1571632855.301296]: /listener_5587_1571632853679I heard hello world 1571632855.3
[INFO] [1571632855.401455]: /listener_5587_1571632853679I heard hello world 1571632855.4
[INFO] [1571632855.501047]: /listener_5587_1571632853679I heard hello world 1571632855.5
[INFO] [1571632855.601032]: /listener_5587_1571632853679I heard hello world 1571632855.6
[INFO] [1571632855.701651]: /listener_5587_1571632853679I heard hello world 1571632855.7
[INFO] [1571632855.801294]: /listener_5587_1571632853679I heard hello world 1571632855.8
[INFO] [1571632855.901156]: /listener_5587_1571632853679I heard hello world 1571632855.9
[INFO] [1571632856.001304]: /listener_5587_1571632853679I heard hello world 1571632856.0
[INFO] [1571632856.101461]: /listener_5587_1571632853679I heard hello world 1571632856.1
[INFO] [1571632856.201528]: /listener_5587_1571632853679I heard hello world 1571632856.2
[INFO] [1571632856.301237]: /listener_5587_1571632853679I heard hello world 1571632856.3
[INFO] [1571632856.401189]: /listener_5587_1571632853679I heard hello world 1571632856.4
[INFO] [1571632856.501317]: /listener_5587_1571632853679I heard hello world 1571632856.5
[INFO] [1571632856.601370]: /listener_5587_1571632853679I heard hello world 1571632856.6
[INFO] [1571632856.701299]: /listener_5587_1571632853679I heard hello world 1571632856.7
[INFO] [1571632856.801316]: /listener_5587_1571632853679I heard hello world 1571632856.8
[INFO] [1571632856.901329]: /listener_5587_1571632853679I heard hello world 1571632856.9
[INFO] [1571632856.999119]: /listener_5587_1571632853679I heard hello world 1571632857.0
[INFO] [1571632857.101316]: /listener_5587_1571632853679I heard hello world 1571632857.1

  开第四个终端运行:rqt_graph

  返回信息:

rqt_graph  
WARNING: Package name "myAwesomeCode" does not follow the naming conventions. It should start with a lower case letter and only c
ontain lower case letters, digits, underscores, and dashes.
WARNING: Package name "myAwesomeCode" does not follow the naming conventions. It should start with a lower case letter and only c
ontain lower case letters, digits, underscores, and dashes.

  

  很明显可以看出ROS完成talker和listener的链接,无需人工操作。

  如果再开新的终端,分别运行:rosrun  rospy_tutorials  listener和rosrun  rospy_tutorials  talker,则ROS图如下:

ROS又一次完成了自动链接,随着节点的增多,ROS自动完成节点的链接。

五、roslaunch

  ros中的命名对象包括:节点名、话题名、服务名、参数名、文件系统名、网络URL和其他领域需要命名的场合

  命名空间:同样的文件名称,也可以通过不同的文件系统的路径名称完成文件名的区别,命名空间其实就是在不同的空间可以实现同名文件的访问的方法

  在上一个步骤中,运行的节点都是没有名称,如果需要对运行的节点命名,需要重映射,任何命名的字符串,都可以在运行时进行重映射,方法如下:

  rosrun  packageName  nodeName  __name:=reName

  像上一个步骤中运行大量的节点,会把人累死,可以借助roslaunch可以同时启动多个节点,并且能够自动启动roscore程序,如果launch文件:

1 <launch>
2     <node name="talker" pkg="rospy_tutorials"
3     type="talker.py"  output="screen"
4     <node name="listener" pkg="rospy_tutorials"
5     type="listener.py"  output="screen"                                                                                         
6 </launch>

  代码非常简单,不说明了:

  采用以下方式实现roslaunch的启动:roslaunch myAwesomeCode talkerListener.launch

  返回信息:

roslaunch myAwesomeCode talkerListener.launch                                  
WARNING: Package name "myAwesomeCode" does not follow the naming conventions. It should start with a lower case letter and only
contain lower case letters, digits, underscores, and dashes.
... logging to /home/openlib/.ros/log/145cbbf6-f3c1-11e9-97b3-3464a91cb6c2/roslaunch-developz-6687.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://developz:33981/

SUMMARY
========

PARAMETERS
* /rosdistro: melodic
* /rosversion: 1.14.3

NODES
 /
   listener (rospy_tutorials/listener.py)
   talker (rospy_tutorials/talker.py)

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

setting /run_id to 145cbbf6-f3c1-11e9-97b3-3464a91cb6c2
WARNING: Package name "myAwesomeCode" does not follow the naming conventions. It should start with a lower case letter and only
contain lower case letters, digits, underscores, and dashes.
process[rosout-1]: started with pid [6708]
started core service [/rosout]
process[talker-2]: started with pid [6711]
process[listener-3]: started with pid [6716]
[INFO] [1571634621.762217]: hello world 1571634621.76
[INFO] [1571634621.862642]: hello world 1571634621.86
[INFO] [1571634621.864881]: /listenerI heard hello world 1571634621.86
[INFO] [1571634621.962878]: hello world 1571634621.96
[INFO] [1571634621.966170]: /listenerI heard hello world 1571634621.96
[INFO] [1571634622.062767]: hello world 1571634622.06
[INFO] [1571634622.064886]: /listenerI heard hello world 1571634622.06
[INFO] [1571634622.162911]: hello world 1571634622.16
[INFO] [1571634622.166505]: /listenerI heard hello world 1571634622.16
[INFO] [1571634622.262787]: hello world 1571634622.26
[INFO] [1571634622.265489]: /listenerI heard hello world 1571634622.26
[INFO] [1571634622.362876]: hello world 1571634622.36
[INFO] [1571634622.366536]: /listenerI heard hello world 1571634622.36
[INFO] [1571634622.462900]: hello world 1571634622.46
[INFO] [1571634622.466564]: /listenerI heard hello world 1571634622.46
[INFO] [1571634622.562905]: hello world 1571634622.56
[INFO] [1571634622.566677]: /listenerI heard hello world 1571634622.56
[INFO] [1571634622.662811]: hello world 1571634622.66
[INFO] [1571634622.665812]: /listenerI heard hello world 1571634622.66
[INFO] [1571634622.762784]: hello world 1571634622.76
[INFO] [1571634622.765788]: /listenerI heard hello world 1571634622.76
[INFO] [1571634622.862793]: hello world 1571634622.86
[INFO] [1571634622.865732]: /listenerI heard hello world 1571634622.86
[INFO] [1571634622.962961]: hello world 1571634622.96
[INFO] [1571634622.966587]: /listenerI heard hello world 1571634622.96
[INFO] [1571634623.062986]: hello world 1571634623.06
[INFO] [1571634623.066693]: /listenerI heard hello world 1571634623.06
[INFO] [1571634623.162897]: hello world 1571634623.16
[INFO] [1571634623.166561]: /listenerI heard hello world 1571634623.16
[INFO] [1571634623.262857]: hello world 1571634623.26
[INFO] [1571634623.266166]: /listenerI heard hello world 1571634623.26
[INFO] [1571634623.362838]: hello world 1571634623.36
[INFO] [1571634623.366183]: /listenerI heard hello world 1571634623.36
[INFO] [1571634623.462509]: hello world 1571634623.46
[INFO] [1571634623.463750]: /listenerI heard hello world 1571634623.46
[INFO] [1571634623.562706]: hello world 1571634623.56
[INFO] [1571634623.565608]: /listenerI heard hello world 1571634623.56
[INFO] [1571634623.662868]: hello world 1571634623.66
[INFO] [1571634623.666602]: /listenerI heard hello world 1571634623.66
[INFO] [1571634623.762868]: hello world 1571634623.76
[INFO] [1571634623.766270]: /listenerI heard hello world 1571634623.76
[INFO] [1571634623.862859]: hello world 1571634623.86
[INFO] [1571634623.866399]: /listenerI heard hello world 1571634623.86
[INFO] [1571634623.963012]: hello world 1571634623.96
[INFO] [1571634623.966053]: /listenerI heard hello world 1571634623.96
[INFO] [1571634624.062842]: hello world 1571634624.06
[INFO] [1571634624.066249]: /listenerI heard hello world 1571634624.06
[INFO] [1571634624.162686]: hello world 1571634624.16

  通过launch文件可以实现在一个终端中,打开一系列的终端和节点,并且roslaunch自动打开roscore,并依次运行节点,最好的是,可以通过使用ctrl+c同时终止所有的节点运行

  在ros中,由于大量命令输入,最后多按下tab键,当习惯了自动补全时,就会非常的依赖这个特性了。

猜你喜欢

转载自www.cnblogs.com/guochaoxxl/p/11712892.html