DQ's ROS Tutorials(Beginner Level) Study

1. Installing and Configuring Your ROS Environment

Installing please refer the artical: Ubuntu 14.04 install ROS Indigo
make sure that you have your environment properly setup.

printenv | grep ROS

Create a ROS Workspace,create a catkin workspace:

$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace

Built the workspace:

$ cd ~/catkin_ws/
$ catkin_make

Before continuing source your new setup.*sh file:

$ source devel/setup.bash

make sure ROS_PACKAGE_PATH environment variable includes the directory you’re in:

$ echo $ROS_PACKAGE_PATH
/home/youruser/catkin_ws/src:/opt/ros/kinetic/share:/opt/ros/kinetic/stacks

2. Navigating the ROS Filesystem

sudo apt-get install ros-Indigo-ros-tutorials

rospack find [package_name] eg: rospack find roscpp roscd [locationname[/subdir]] eg: roscd roscpp echo $ROS_PACKAGE_PATH roscd log rosls [locationname[/subdir]] eg: rosls roscpp_tutorials

3. Creating a ROS Package

# You should have created this in the Creating a Workspace Tutorial
$ cd ~/catkin_ws/src

$ catkin_create_pkg beginner_tutorials std_msgs rospy roscpp

# build the packages in the catkin workspace
$ cd ~/catkin_ws
$ catkin_make

# To add the workspace to your ROS environment
$ . ~/catkin_ws/devel/setup.bash

4. Building a ROS Package

catkin_make is a command line tool which adds some convenience to the standard catkin workflow. You can imagine that catkin_make combines the calls to cmake and make in the standard CMake workflow.

source /opt/ros/indigo/setup.bash

# In a catkin workspace
# catkin_make --source my_src
# catkin_make install --source my_src # (optionally)

cd ~/catkin_ws/
ls src
catkin_make
catkin_make install  # (optionally)

5. Understanding ROS Nodes

先安装一个轻量级模拟器(之前装过了):

$ sudo apt-get install ros-indigo-ros-tutorials

图的概念:

  • Nodes: A node is an executable that uses ROS to communicate with other nodes.

  • 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)

一个终端中输入: roscore,打开一个rosout服务,在另一个终端中输入rosnode list,将看到 /rosout,查看详细信息: rosnode info /rosout.

# rosrun [package_name] [node_name],需要先打开roscore,在另一个终端输入
$ rosrun turtlesim turtlesim_node

# 再开一个终端
$ rosnode list

# 再开一个终端
$ rosrun turtlesim turtlesim_node __name:=my_turtle

$ rosnode cleanup

6. Understanding ROS Topics

setup

# First Terminal
roscore

# Second Terminal 
rosrun turtlesim turtlesim_node

# Third Terminal
rosrun turtlesim turtle_teleop_key
# Then you can use arrow keys of the keyboard to drive the turtle around.

ROS Topics

# Fourth Terminal
sudo apt-get install ros-indigo-rqt
sudo apt-get install ros-indigo-rqt-common-plugins

rosrun rqt_graph rqt_graph

# You can use the help option to get the available sub-commands for rostopic
rostopic -h

# rostopic echo shows the data published on a topic. 
rostopic echo /turtle/cmd_vel

# rostopic list returns a list of all topics currently subscribed to and published. 
rostopic list
rostopic list -h
rostopic list -v

ROS Messages

# rostopic type returns the message type of any topic being published. 
rostopic type /turtle1/cmd_vel
rostopic type /turtle1/command_veLocity

rostopic with messages

# rostopic pub publishes data on to a topic currently advertised. 
# rostopic pub [topic] [msg_type] [args]
rostopic pub -1 /turtle1/cmd_vel geometry_msgs/Twist -- '[2.0,0.0,0.0]' '[0.0,1.8]'
rostopic pub /turtle1/cmd_vel geometry_msgs/Twist -r 1 -- '[2.0,-1.8]'

# rostopic hz reports the rate at which data is published. 
# rostopic hz [topic]
rostopic hz /turtle1/pose
rostopic type /turtle1/cmd_vel | rosmsg show

rqt_plot

# rqt_plot displays a scrolling time plot of the data published on topics.
rosrun rqt_plot rqt_plot

7. Understanding ROS Services and Parameters

ROS Services

Services are another way that nodes can communicate with each other. Services allow nodes to send a request and receive a response.

rosservice describle
rosservice list print information about active services
rosservice call call the service with the provided args
rosservice type print service type
rosservice find find services by service type
rosservice uri print service ROSRPC uri
rosservice list
rosservice type /clear

# clears the background of the turtlesim_node. 
rosservice call /clear

# This service lets us spawn a new turtle at a given location and orientation. 
rosservice type /spawn| rossrv show
rosservice call /spawn 2 2 0.2 ""
# Then Second Turtle will be seen.

rosparam

rosparam allows you to store and manipulate data on the ROS Parameter Server. The Parameter Server can store integers,floats,boolean,dictionaries,and lists. rosparam uses the YAML markuP Language for Syntax. In simple cases,YAML looks very natural: 1 is an integer,1.0 is a float,one is a string,true is a boolean,[1,2,3] is a list of integers,and {a: b,c: d} is a dictionary. rosparam has many commands that can be used on parameters,as shown below:

rosparam describle
rosparam set set parameter
rosparam get get parameter
rosparam load load parameters from file
rosparam dump dump parameters to file
rosparam delete delete parameter
rosparam list list parameter names
rosparam list

# we have to call the clear service for the parameter change to take effect
rosparam set /background_r 150
rosservice call /clear

rosparam get /background_g 

# write all the parameters to the file params.yaml 
rosparam dump params.yaml
rosparam load params.yaml copy
rosparam get /copy/background_b

8. Using rqt_console and roslaunch

rqt_console and rqt_logger_level

sudo apt-get install ros-indigo-rqt ros-indigo-rqt-common-plugins ros-indigo-turtlesim

# First Terminal
roscore

# Second Terminal
rosrun rqt_console rqt_console

# Third Terminal
rosrun rqt_logger_level rqt_logger_level

# Fourth Terminal
rosrun turtlesim turtlesim_node

# Fifth Terminal,let's run our turtle into the wall and see what is displayed in our rqt_console
rostopic pub /turtle1/cmd_vel geometry_msgs/Twist -r 1 -- '{linear: {x: 2.0,y: 0.0,z: 0.0},angular: {x: 0.0,z: 0.0}}'

roslaunch

cd ~/catkin_ws
source devel/setup.bash
roscd beginner_tutorials
mkdir launch
cd launch
gedit turtlemimic.launch

# paste the following to turtlemimic.launch
# begin
<launch>

  <group ns="turtlesim1">
    <node pkg="turtlesim" name="sim" type="turtlesim_node"/>
  </group>

  <group ns="turtlesim2">
    <node pkg="turtlesim" name="sim" type="turtlesim_node"/>
  </group>

  <node pkg="turtlesim" name="mimic" type="mimic">
    <remap from="input" to="turtlesim1/turtle1"/>
    <remap from="output" to="turtlesim2/turtle1"/>
  </node>

</launch>
# end

roslaunch beginner_tutorials turtlemimic.launch
rostopic pub /turtlesim1/turtle1/cmd_vel geometry_msgs/Twist -r 1 -- '[2.0,0.0]' '[0.0,-1.8]'
rqt_graph

9. Using rosed to edit files in ROS

sudo apt-get install vim
rosed roscpp Logger.msg

rosed roscpp <tab><tab>

# you can change you editor from vim to nano or emacs
export EDITOR='nano -w'
export EDITOR='emacs -nw'
# open a new Terminal and see if the EDITOR is defined
echo $EDITOR

10. Creating a ROS msg and srv

using msg and srv

cd ~/catkin_ws
source devel/setup.bash
roscd beginner_tutorials
mkdir msg
echo "int64 num" > msg/Num.msg

# package.xml,uncommented
<build_depend>message_generation</build_depend>
<run_depend>message_runtime</run_depend>

# CMakeLists.txt
find_package(catkin required COMPONENTS
   roscpp
   rospy
   std_msgs
   message_generation
)

catkin_package(
  ...
  CATKIN_DEPENDS message_runtime ...
  ...)

add_message_files(
  FILES
  Num.msg
)

generate_messages(
  DEPENDENCIES
  std_msgs
)

add_service_files(
  FILES
  AddTwoInts.srv
)

using rosmsg

rosmsg show beginner_tutorials/Num rosmsg show Num

using srv

roscd beginner_tutorials
mkdir srv
roscp rospy_tutorials AddTwoInts.srv srv/AddTwoInts.srv

rossrv show beginner_tutorials/AddTwoInts rossrv show AddTwoInts

Common step for msg and srv

# In your catkin workspace
# cd ~/catkin_ws
# source devel/setup.bash
roscd beginner_tutorials
cd ../..
catkin_make install
cd -

Getting help

rosmsg -h
rosmsg show -h

11. Writing a Simple Publisher and Subscriber (C++)

Writing the Publisher Node

cd ~/catkin_ws
source devel/setup.bash
roscd beginner_tutorials
mkdir src
gedit src/talker.cpp

# paste the following code to talker.cpp
/* * copyright (C) 2008,Morgan Quigley and Willow Garage,Inc. * * Redistribution and use in source and binary forms,with or without * modification,are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice,* this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice,this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the names of Stanford University or Willow Garage,Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE copYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING,BUT NOT LIMITED TO,THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND fitness FOR A PARTIculaR PURPOSE * ARE disCLaimED. IN NO EVENT SHALL THE copYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT,INDIRECT,INCIDENTAL,SPECIAL,EXEMPLARY,OR * CONSEQUENTIAL damAGES (INCLUDING,PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA,OR PROFITS; OR BUSInesS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,WHETHER IN * CONTRACT,STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH damAGE. */
// %Tag(FULLTEXT)%
// %Tag(ROS_HEADER)%
#include "ros/ros.h"
// %EndTag(ROS_HEADER)%
// %Tag(MSG_HEADER)%
#include "std_msgs/String.h"
// %EndTag(MSG_HEADER)%

#include <sstream>

/** * This tutorial demonstrates simple sending of messages over the ROS system. */
int main(int argc,char **argv)
{
  /** * The ros::init() function needs to see argc and argv so that it can perform * any ROS arguments and name remapping that were provided at the command line. * For programmatic remappings you can use a different version of init() which takes * remappings directly,but for most command-line programs,passing argc and argv is * the easiest way to do it. The third argument to init() is the name of the node. * * You must call one of the versions of ros::init() before using any other * part of the ROS system. */
// %Tag(INIT)%
  ros::init(argc,argv,"talker");
// %EndTag(INIT)%

  /** * NodeHandle is the main access point to communications with the ROS system. * The first NodeHandle constructed will fully initialize this node,and the last * NodeHandle destructed will close down the node. */
// %Tag(NODEHANDLE)%
  ros::NodeHandle n;
// %EndTag(NODEHANDLE)%

  /** * The advertise() function is how you tell ROS that you want to * publish on a given topic name. This invokes a call to the ROS * master node,which keeps a registry of who is publishing and who * is subscribing. After this advertise() call is made,the master * node will notify anyone who is trying to subscribe to this topic name,* and they will in turn negotiate a peer-to-peer connection with this * node. advertise() returns a Publisher object which allows you to * publish messages on that topic through a call to publish(). Once * all copies of the returned Publisher object are destroyed,the topic * will be automatically unadvertised. * * The second parameter to advertise() is the size of the message queue * used for publishing messages. If messages are published more quickly * than we can send them,the number here specifies how many messages to * buffer up before throwing some away. */
// %Tag(PUBLISHER)%
  ros::Publisher chatter_pub = n.advertise<std_msgs::String>("chatter",1000);
// %EndTag(PUBLISHER)%

// %Tag(LOOP_RATE)%
  ros::Rate loop_rate(10);
// %EndTag(LOOP_RATE)%

  /** * A count of how many messages we have sent. This is used to create * a unique string for each message. */
// %Tag(ROS_OK)%
  int count = 0;
  while (ros::ok())
  {
// %EndTag(ROS_OK)%
    /** * This is a message object. You stuff it with data,and then publish it. */
// %Tag(FILL_MESSAGE)%
    std_msgs::String msg;

    std::stringstream ss;
    ss << "hello world " << count;
    msg.data = ss.str();
// %EndTag(FILL_MESSAGE)%

// %Tag(ROSCONSOLE)%
    ROS_INFO("%s",msg.data.c_str());
// %EndTag(ROSCONSOLE)%

    /** * The publish() function is how you send messages. The parameter * is the message object. The type of this object must agree with the type * given as a template parameter to the advertise<>() call,as was done * in the constructor above. */
// %Tag(PUBLISH)%
    chatter_pub.publish(msg);
// %EndTag(PUBLISH)%

// %Tag(SPINONCE)%
    ros::spinOnce();
// %EndTag(SPINONCE)%

// %Tag(RATE_SLEEP)%
    loop_rate.sleep();
// %EndTag(RATE_SLEEP)%
    ++count;
  }


  return 0;
}
// %EndTag(FULLTEXT)%

Writing the Subscriber Node

gedit src/listener.cpp

# paste the follwing code to listener.cpp
/*
 * copyright (C) 2008,Morgan Quigley and Willow Garage,Inc.
 *
 * Redistribution and use in source and binary forms,with or without
 * modification,are permitted provided that the following conditions are met:
 *   * Redistributions of source code must retain the above copyright notice,*     this list of conditions and the following disclaimer.
 *   * Redistributions in binary form must reproduce the above copyright
 *     notice,this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *   * Neither the names of Stanford University or Willow Garage,Inc. nor the names of its
 *     contributors may be used to endorse or promote products derived from
 *     this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE copYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES,THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND fitness FOR A PARTIculaR PURPOSE
 * ARE disCLaimED. IN NO EVENT SHALL THE copYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT,OR
 * CONSEQUENTIAL damAGES (INCLUDING,PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,OR PROFITS; OR BUSInesS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,WHETHER IN
 * CONTRACT,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH damAGE.
 */

// %Tag(FULLTEXT)%
#include "ros/ros.h"
#include "std_msgs/String.h"

/**
 * This tutorial demonstrates simple receipt of messages over the ROS system.
 */
// %Tag(CALLBACK)%
void chatterCallback(const std_msgs::String::ConstPtr& msg)
{
  ROS_INFO("I heard: [%s]",msg->data.c_str());
}
// %EndTag(CALLBACK)%

int main(int argc,char **argv)
{
  /**
   * The ros::init() function needs to see argc and argv so that it can perform
   * any ROS arguments and name remapping that were provided at the command line.
   * For programmatic remappings you can use a different version of init() which takes
   * remappings directly,but for most command-line programs,passing argc and argv is
   * the easiest way to do it.  The third argument to init() is the name of the node.
   *
   * You must call one of the versions of ros::init() before using any other
   * part of the ROS system.
   */
  ros::init(argc,"listener");

  /**
   * NodeHandle is the main access point to communications with the ROS system.
   * The first NodeHandle constructed will fully initialize this node,and the last
   * NodeHandle destructed will close down the node.
   */
  ros::NodeHandle n;

  /**
   * The subscribe() call is how you tell ROS that you want to receive messages
   * on a given topic.  This invokes a call to the ROS
   * master node,which keeps a registry of who is publishing and who
   * is subscribing.  Messages are passed to a callback function,here
   * called chatterCallback.  subscribe() returns a Subscriber object that you
   * must hold on to until you want to unsubscribe.  When all copies of the Subscriber
   * object go out of scope,this callback will automatically be unsubscribed from
   * this topic.
   *
   * The second parameter to the subscribe() function is the size of the message
   * queue.  If messages are arriving faster than they are being processed,this
   * is the number of messages that will be buffered up before beginning to throw
   * away the oldest ones.
   */
// %Tag(SUBSCRIBER)%
  ros::Subscriber sub = n.subscribe("chatter",1000,chatterCallback);
// %EndTag(SUBSCRIBER)%

  /**
   * ros::spin() will enter a loop,pumping callbacks.  With this version,all
   * callbacks will be called from within this thread (the main one).  ros::spin()
   * will exit when Ctrl-C is pressed,or the node is shutdown by the master.
   */
// %Tag(SPIN)%
  ros::spin();
// %EndTag(SPIN)%

  return 0;
}
// %EndTag(FULLTEXT)%

Buliding your nodes

Your resulting CMakeLists.txt should look like this:

<pre style="color: rgb(0,0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; white-space: pre-wrap;"># %Tag(FULLTEXT)%
cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)

## Find catkin and any catkin packages
find_package(catkin required COMPONENTS roscpp rospy std_msgs genmsg)

## Declare ROS messages and services
add_message_files(FILES Num.msg)
add_service_files(FILES AddTwoInts.srv)

## Generate added messages and services
generate_messages(DEPENDENCIES std_msgs)

## Declare a catkin package
catkin_package()

## Build talker and listener
include_directories(include ${catkin_INCLUDE_Dirs})

add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})
add_dependencies(talker beginner_tutorials_generate_messages_cpp)

add_executable(listener src/listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES})
add_dependencies(listener beginner_tutorials_generate_messages_cpp)

# %EndTag(FULLTEXT)%</pre>
cd ~/catkin_ws
catkin_make

13. Examining the Simple Publisher and Subscriber

# First Terminal
roscore

# second Terminal
cd ~/catkin_ws
source ./devel/setup.bash
rosrun beginner_tutorials talker

# Third Terminal
cd ~/catkin_ws
source ./devel/setup.bash
rosrun beginner_tutorials listener

14. Writing a Simple Service and Client (C++)

cd ~/catkin_ws
source ./devel/setup.bash
roscd beginner_tutorials

gedit src/add_two_ints_server.cpp
#include "ros/ros.h"
#include "beginner_tutorials/AddTwoInts.h"

bool add(beginner_tutorials::AddTwoInts::Request  &req,beginner_tutorials::AddTwoInts::Response &res)
{
    res.sum = req.a + req.b;
    ROS_INFO("request: x=%ld,y=%ld",(long int)req.a,(long int)req.b);
    ROS_INFO("sending back response: [%ld]",(long int)res.sum);
    return true;
}

int main(int argc,char **argv)
{
    ros::init(argc,"add_two_ints_server");
    ros::NodeHandle n;

    ros::ServiceServer service = n.advertiseService("add_two_ints",add);
    ROS_INFO("Ready to add two ints.");
    ros::spin();

    return 0;
}
gedit src/add_two_ints_client.cpp
#include "ros/ros.h"
#include "beginner_tutorials/AddTwoInts.h"
#include <cstdlib>

int main(int argc,char **argv)
{
   ros::init(argc,"add_two_ints_client");
   if (argc != 3)
   {
       ROS_INFO("usage: add_two_ints_client X Y");
       return 1;
   }

   ros::NodeHandle n;
   ros::ServiceClient client = n.serviceClient<beginner_tutorials::AddTwoInts>("add_two_ints");
   beginner_tutorials::AddTwoInts srv;
   srv.request.a = atoll(argv[1]);
   srv.request.b = atoll(argv[2]);
   if (client.call(srv))
   {
     ROS_INFO("Sum: %ld",(long int)srv.response.sum);
   }
   else
   {
     ROS_ERROR("Failed to call service add_two_ints");
     return 1;
   }

   return 0;
}

CMakeLists.txt:

# %Tag(FULLTEXT)%
cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)

## Find catkin and any catkin packages
find_package(catkin required COMPONENTS roscpp rospy std_msgs genmsg)

## Declare ROS messages and services
add_message_files(FILES Num.msg)
add_service_files(FILES AddTwoInts.srv)

## Generate added messages and services
generate_messages(DEPENDENCIES std_msgs)

## Declare a catkin package
catkin_package()

## Build talker and listener
include_directories(include ${catkin_INCLUDE_Dirs})

add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})

add_executable(listener src/listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES})

## Build service client and server
# %Tag(SRVCLIENT)%
add_executable(add_two_ints_server src/add_two_ints_server.cpp)
target_link_libraries(add_two_ints_server ${catkin_LIBRARIES})
add_dependencies(add_two_ints_server beginner_tutorials_gencpp)

add_executable(add_two_ints_client src/add_two_ints_client.cpp)
target_link_libraries(add_two_ints_client ${catkin_LIBRARIES})
add_dependencies(add_two_ints_client beginner_tutorials_gencpp)

# %EndTag(SRVCLIENT)%

# %EndTag(FULLTEXT)%
# In your catkin workspace
cd ~/catkin_ws
catkin_make

16. Examining the Simple Service and Client

# 接上一节
# NEW First Terminal
cd ~/catkin_ws
source ./devel/setup.bash
rosrun beginner_tutorials add_two_ints_server
# NEW Second Terminal
cd ~/catkin_ws
source ./devel/setup.bash
rosrun beginner_tutorials add_two_ints_client 1 3

17. Recording and playing back data

Recording data (creating a bag file)

# Three Terminal
roscore
rosrun turtlesim turtlesim_node 
rosrun turtlesim turtle_teleop_key

# see Published topics can be recorded
rostopic list -v

mkdir ~/bagfiles
cd ~/bagfiles
rosbag record -a
# Move back to the terminal window with turtle_teleop and move the turtle around for 10 or so seconds. Then In the window running rosbag record exit with a Ctrl-C.

Examining and playing the bag file

# Press Tab and it will give the only bagfile name
rosbag info <your bagfile>
rosbag play <your bagfile>

# this is the trajectory that would have resulted had you issued your keyboard commands twice as fast. 
rosbag play -r 2 <your bagfile>

Recording a subset of the data

# If any turtlesim nodes are running exit them and relaunch the keyboard teleop launch file: 
rosrun turtlesim turtlesim_node 
rosrun turtlesim turtle_teleop_key

rosbag record -O subset /turtle1/cmd_vel /turtle1/pose
# The -O argument tells rosbag record to log to a file named subset.bag,and the topic arguments cause rosbag record to only subscribe to these two topics. Move the turtle around for several seconds using the keyboard arrow commands,and then Ctrl-C the rosbag record. 

# check the contents of the bag file 
rosbag info subset.bag

18. Getting started with roswtf

roswtf examines your system to try and find problems.

# please make sure your roscore is NOT running. 
roscd
roswtf

# Start a roscore
roscd
roswtf

# Creat some errors. STOP roscore
roscd
ROS_PACKAGE_PATH=bad:$ROS_PACKAGE_PATH roswtf

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、安装SSH和配置SSH无密码登录四、安装Java环境1. 安装JDK2. 配置JDK环境3. 检验安装五、安装单机Hadoop1. 下载安装Hadoop2. 运行示例总结前言本文安装的 Hadoop 及 Java 环境基于林子雨老师的《大数据技术原理与应用(第3版)》中所要求,其中Java 版本为1.8.0_301,Hadoop 版本为3.3.1,其他版本的安装请参考其他博客。..
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html  运行django出现错误信息:[2016-02-16 14:33:24,476 pyinotify ERROR] add_watch: cannot watch /usr/local/lib/python2.7/dist-packages/django/contrib/sessio...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失了,如下:别着急,以下教你如何找回之前的虚拟机:1、点击控制,然后选择注册,找到虚拟机的安装目录,比如:C:UserstxVirtualBox VMs,然后选择需要找回的虚拟机vbox,点击打开按钮即可:2、如果打开后报错,则执行第三步:3、删除ubuntu.vbox,然后将ubuntu.vbox-prev重命名为ubuntu.vbox,然后再执行第二步即可...
参见:https://blog.csdn.net/weixin_38883338/article/details/82153933 https://blog.csdn.net/github_39533414/article/details/85211012
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netplan 基于 YAML 的配置系统,使得配置过程非常简单。Netplan 替换了我们之前在 Ubuntu 中用于配置网络接口的旧配置文件/etc/network/interfaces。在本文中,我们将学习如何使用 Netplan 在 Ubuntu 中配置网络。我们将看到静态和动态 IP 配置。我将使用 Ubuntu 18.04 LTS 来描述本文中提到的过程。使用 Netplan 配置网络您可以在/etc
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问,该 URL 代表一种“替代名称”,用于标识提供该服务的服务器的 IP 地址和端口。同一台机器可以同时在不同的端口上提供不同的服务。出于安全原因,可能需要屏蔽 Web 服务的端口号,从而在外部显示与服务实际侦听的端口号不对应的端口号。感谢本教程,您将能够管理您的服务器端口,配置集成在 Ubuntu 中的 UFW 防火墙。特别是,按照指南的说明,您将学习将来自某个端口的请求转发到另一个端口(端口转发),同时使用后者提供的.
Observium 是一个免费和开源的 sa 网络管理和监控系统工具。我们可以使用 SNMP 收集数据,它允许监控所有网络设备。它提供了一个简单易用的 Web 界面。它基于 PHP 并使用 MySQL 数据库来存储数据。在 ubuntu 上设置 Observium 有几个步骤:第 1 步:更新系统。apt-get update第 2 步:安装 PHP 和模块。apt install wget apache2 php php-{pear,cgi,common,curl,mbstring,g
从 20.04 开始,Ubuntu 决定更新实时服务器安装程序以实现自动安装规范,以便能够仅使用 Subiquity 完全自动化安装过程。Subiquity 是新的服务器安装程序(又名“服务器无处不在”),旨在取代之前基于 debian-installer 的经典系统。本文说明了如何使用 Packer 和 Proxmox 上的 Subiquity 生成 Ubuntu Server 20.04 图像模板。介绍Subiquity 仅在live图像文件版本中可用(例如ubuntu-20.0...
Ubuntu 将停止支持 Debian 安装程序(预置)。Ubuntu Server 20.04 附带了一种新的自动化操作系统安装方法,称为带有 subiquity 服务器安装程序的自动安装。这篇文章展示了使用新安装程序构建的打包程序。此设置仅适用于 Ubuntu-20.04 live-server 而不是旧版。SubiquitySubiquity 是 Ubuntu 服务器的新自动安装程序,它是在 18.04 中引入的。自动安装的设置由 cloud-init 配置提供。如果设置,将从配置文件.
此页面的目的是提供在您机器上的 VM 中执行自动安装的简单说明。此页面假设您使用的是 amd64 架构。s390x也有一个版本。通过网络提供自动安装数据这种方法是最容易推广到完全基于网络的安装的方法,在这种安装中,机器会进行网络引导,然后自动安装。下载 ISO转到20.04 ISO 下载页面并下载最新的 Ubuntu 20.04 实时服务器 ISO。挂载 ISOsudo mount -r ~/Downloads/ubuntu-20.04-live-server-amd64...
FTP 或文件传输协议是一种非常古老的知名协议,用于在客户端和服务器之间传输文件。它也是一个不安全的协议,仅在没有 TLS 的情况下使用。在本教程中,我们将为 TLS 配置 vsftpd,它允许我们安全地使用 FTP。如今,FTP 经常被更安全的协议所取代,例如 SFTP 或 SCP。但是,如果您需要在服务器上使用 FTP,vsftpd(Very Secure FTP Daemon)是一个完美的选择。在本教程中,我们将学习如何在基于 Ubuntu 20.04 的服务器上使用 vsft
使用cloud-init快速启动来宾操作系统的能力通常与在 EC2 或 Azure 等 IaaS 中部署虚拟机相关。但是 cloud-init 不仅仅适用于远程云提供商,将 cloud-init 用于可以快速部署在 KVM 中的本地映像非常适合本地开发和测试。本文将逐步测试 KVM 上的来宾 Ubuntu 仿生云映像。先决条件作为本文的先决条件,您必须按照此处所述安装 KVM 和 libvirt。还要安装管理云图像所需的附加包:sudo apt-get install -y
Window Linux双系统安装历程今天下午搞了几个小时,可谓是困难重重,但是实际上只是被一个很小的问题困住了,其它地方都很简单。接下来简单讲一下安装的步骤以及遇到的问题。先讲一下设备状况:一台12年买的i3 window7 待报废的lenovo 笔记本一个32g的usb3.0另一台新的win10笔记本电脑磁盘分区首先要在安装双系统的电脑上,划分硬盘中的一个分区来装linxu。点击我的电脑(此电脑)-&gt;管理-&gt; 磁盘管理比如这里我们的e盘原本有98.55g,然后还有
https://pinyin.sogou.com/linux/help.php 安装指南 Ubuntu搜狗输入法安装指南 搜狗输入法已支持Ubuntu1604、1804、1910、2004、2010
在home主文件夹里面。
格式:rm -rf 目录名字 -r 就是向下递归,不管有多少级目录,一并删除 -f 就是直接强行删除,不作任何提示的意思 名称 概述 描述 选项
https://blog.csdn.net/qq_29985391/article/details/78008864 https://blog.csdn.net/wangxin0205/article
echo $ROS_PACKAGE_PATH
https://blog.csdn.net/weixin_37657720/article/details/80645991 :q! 不保存强制推出。 :wq 保存并退出。
https://blog.csdn.net/xin_101/article/details/88624726 https://blog.csdn.net/qq_15192373/article/det