教程

1.维基 http://wiki.ros.org/cn/ROS/Tutorials

2. 创客智造 http://www.ncnynl.com/category/ros-junior-tutorial/

1安装环境配置(桌面进入命令行)

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

2.1创建工作环境并编译 (生成的在home文件夹下)

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make

2.2自己创建的包环境 能看到’build’和’devel’这两个文件夹。

将当前工作环境设置在ROS工作环境

source /home/dongdong/catkin_ws/devel/setup.bash

如果永久性配置

echo "source /home/dongdong/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

查看是否配置成功

echo $ROS_PACKAGE_PATH

5 运行小乌龟测试

//打开新窗口
roscore
//另开新窗口
rosrun turtlesim turtlesim_node __name:=my_turtle //改变名字 my_turtle
//发送一条消息给turtlesim,告诉它以2.0大小的线速度和1.8大小的角速度开始移动。
rostopic pub -1 /turtle1/cmd_vel geometry_msgs/Twist -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, 1.8]'
//rostopic pub -r 1命令 一个稳定的频率为1Hz的命令
rostopic pub /turtle1/cmd_vel geometry_msgs/Twist -r 1 -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, 1.8]'
//通过键盘控制

—————–参数解释————————————-

-1 发表后就退出

/turtle1/command_velocity 话题名称

turtlesim/Velocity 话题类型

– (双破折号)这会告诉命令选项解析器接下来的参数部分都不是命令选项。

2.0 1.8 两个浮点型元素:linear和angular。

这些参数其实是按照YAML语法格式编写的,这在YAML文档中有更多的描述。

——————-参数解释结束———————————————–


6 roslaunch 同时运行多个小乌龟节点

$ roscd beginner_tutorials
$ mkdir launch
$ cd launch
$ gedit turtlemimic.launch
$ roslaunch beginner_tutorials turtlemimic.launch
$ rostopic pub /turtlesim1/turtle1/cmd_vel geometry_msgs/Twist -r 1 -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, -1.8]'

turtlemimic.launch 文件里面写入

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

ROS 小乌龟测试的更多相关文章

  1. ROS中测试机器人里程计信息

    在移动机器人建图和导航过程中,提供相对准确的里程计信息非常关键,是后续很多工作的基础,因此需要对其进行测试保证没有严重的错误或偏差.实际中最可能发生错误的地方在于机器人运动学公式有误,或者正负号不对, ...

  2. cartographer Ubuntu16.04 ros环境配置

    首先要正确安装 ROS ,然后第12步应注意,proto的版本是个关键容易出错.   1.添加ROS源http:/packages.ros.org/ros/ubuntu xenial main   ( ...

  3. ROS机械臂 Movelt 学习笔记1 | 基础准备

    环境:Ubuntu18.04 + ROS Melodic 1. 安装ROS 官网下载安装步骤:http://wiki.ros.org/melodic/Installation/Ubuntu 一键安装的 ...

  4. [ROS] Studying Guidance

    Reference: https://www.zhihu.com/question/35788789 安装指南:http://wiki.ros.org/indigo/Installation/Ubun ...

  5. [转]Ubuntu下ROS开发环境搭建(QT+ros_qtc_plugin)

    ROS与C++入门教程-搭建开发环境(QT+ros_qtc_plugin) PS : 在“安装ros_qtc_plugin插件”这一步中,原文提到“ Ubuntu 14.04使用apt-get方式安装 ...

  6. 入门ROS教程与视频汇总(kinetic)

    参考网址: Richard Wang    3 Shawn Chen 部分视频网址: http://v.youku.com/v_show/id_XMjUxMTc5MzE5Mg http://i.you ...

  7. 深度相机Astra Pro测试教程

    最近在微信群内,很多群友在群友的推荐下,购买了Astra pro的深度相机,价格地道,物超所值!群友反馈积极,所以这里出一波简单的教程.   以下内容知识抛砖引玉,主要讲解windows下和Ubunt ...

  8. ubuntu 下开源安装

    常用开源库安装: 0.安装g++: sudo apt-get install g++ 1.首先不可或缺的就是编译器与基本的函式库: sudo apt-get install build-essenti ...

  9. kinect1在ros-indigo环境配置

    根据周大神前车,向git下载驱动里面有详细的安装说明 $ cd $ git clone https://github.com/ZXWBOT/kinect_driver.git 按照安装说明三个包安装成 ...

随机推荐

  1. unable to locate nuget.exe

    今日使用vs 从github fork 一份代码到本地之后,提示项目 unable to locate nuget.exe. 原因:代码托管时未提交 nuget.exe 或其他原因丢失 解决方法:在解 ...

  2. 2018-09-24 Java源码英翻中网页演示

    在线演示地址: 源代码翻译 两部分如下. 独立的Java代码翻译库 续前文代码翻译尝试-使用Roaster解析和生成Java源码 源码库: program-in-chinese/java_code_t ...

  3. js中判断空及获取当前服务的根路径

    function isValue(o) { return (this.isObject(o) || this.isString(o) || this.isNumber(o) || this.isBoo ...

  4. WannaCry勒索比特币蠕虫病毒解决方案

    WannaCry ransomware used in widespread attacks all over the world Customer Guidance for WannaCrypt a ...

  5. (网页)html中页面传递参数不用cookie不用缓存,js方法搞定

    function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&] ...

  6. codeforces 2A Winner (好好学习英语)

    Winner 题目链接:http://codeforces.com/contest/2/problem/A ——每天在线,欢迎留言谈论. 题目大意: 最后结果的最高分 maxscore.在最后分数都为 ...

  7. 如何用Jupyter notebook打开本地数据集

    首先打开本地Jupyter notebook,出现类似页面并进入网页端Home. 网页端界面类似如下: 需要注意的是,Jupyter notebook只能打开当前目录下的数据集,如csv,所以需要使用 ...

  8. Elixir 单元测试

    概述 elixir 中自带了单元测试框架 ExUnit ,其中提供单元测试的一系列,主要包含以下模块: ExUnit: 单元测试框架 ExUnit.Assertions: 断言 ExUnit.Case ...

  9. June 1. 2018 Week 22nd Friday

    What makes life dreary is the want of motive. 没有了目的,生活便暗淡无光. We all have dreams about our future, we ...

  10. March 09th, 2018 Week 10th Friday

    All good things must come to an end. 好景无常. Love is when the other person's happiness is more importa ...