ROS_launch("let's create a launch file called turtlemimic.launch")
来源:互联网 发布:java游戏源码教程 编辑:程序博客网 时间:2024/06/05 20:02
ROS中可以把很多的命令以描述的形式写成launch文件,然后用roslaunch命令执行launch文件。它的使用方法如下:
比如:我们切换到beginner_tutorials文件下:
注:如果提示找不到文件或文件夹,就参照前面把环境变量设置一下。执行:
和
在beginner_tutorials文件夹下,创建launch文件夹,切换到该文件夹下:
和
输入:
用ubuntu默认的编辑器gedit创建一个launch文件。
然后在打开的的launch文件中复制入下面的内容:
保存退出就可以了。
就可以看到新打开两个乌龟节点。
使乌龟运动起来。就可以看到两只乌龟都在运动。
输入命令:
就可以看到启动了两个节点/turtlesim1/sim和/turtlesim2/sim。如图:
转载说明:http://www.arduino.cn/thread-12413-1-1.htmlhttp://www.arduino.cn/thread-12413-1-1.html
比如:我们切换到beginner_tutorials文件下:
注:如果提示找不到文件或文件夹,就参照前面把环境变量设置一下。执行:
和
在beginner_tutorials文件夹下,创建launch文件夹,切换到该文件夹下:
和
输入:
用ubuntu默认的编辑器gedit创建一个launch文件。
然后在打开的的launch文件中复制入下面的内容:
[C] 纯文本查看 复制代码
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
<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>
保存退出就可以了。
现在使用如下命令载入刚才创建的launch文件:
就可以看到新打开两个乌龟节点。
新打开一个终端,输入命令
使乌龟运动起来。就可以看到两只乌龟都在运动。
输入命令:
就可以看到启动了两个节点/turtlesim1/sim和/turtlesim2/sim。如图:
下面来解析一下launch文件的标签的意思:
<lanuch>
<lanuch>标签用来识别这是一个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>
上面的内容表示我们启动了两只乌龟。分别名为turtlesim1和turtlesim2.
<node pkg="turtlesim" name="mimic" type="mimic">
<remap from="input" to="turtlesim1/turtle1"/>
<remap from="output" to="turtlesim2/turtle1"/>
</node>
上面的内容使turtlesim2模仿turtlesim1。所以虽然我们只向turtlesim1发布了话题,turtlesim2也做出了反应。
转载说明:http://www.arduino.cn/thread-12413-1-1.htmlhttp://www.arduino.cn/thread-12413-1-1.html
0 0
- ROS_launch("let's create a launch file called turtlemimic.launch")
- ROS: [xxx.launch] is neither a launch file in package
- [launch] is neither a launch file in package [urdf_sim_tutorial] nor is [urdf_sim_tutorial] a launch
- roslaunch rbx1_bringup fake_pi_robot.launch 运行报错[fake_turtlebot.launch] is neither a launch file in
- Launch
- Launch
- ROS launch file 写法
- [fake_turtlebo.launch] is neither a launch file in package [rbx1_bringup] nor is [rbx1_bringup] ...
- rosrun,roslaunch: cannot launch node or is either a launch file in package
- rosrun,roslaunch: cannot launch node or is either a launch file in package
- A. Launch of Collider
- Its Easy to Launch a Wireless Deauthentication Attack
- eclipse c++ 问题Launch failed,Binary not found和A program file was not specified in the launch configur
- Select a 'Java Application' launch configuration to use to create a runnable JAR.
- HYDU_create_process (./utils/launch/launch.c:75): execvp error on file *
- Navigation_ResourceNotFound: turtlebot_rviz_launchers或者[view_navigation.launch] is neither a launch
- reason: 'launch path not accessible' abort() called 路径获取错误:
- iOS: Failed to launch .app file
- leetcode Anagrams Group(回文构词 分组)
- rest与soap
- GPUImage (一) 安装CPUImage
- VC 从资源中释放文件
- ubuntu中的libtool问题
- ROS_launch("let's create a launch file called turtlemimic.launch")
- ABAP中P类型介绍
- 如何让 Spring Boot 项目发布到 Tomcat 服务器
- 使用JS调用迅雷下载网站本地视频,生成迅雷下载链接
- [整理]-iOS- 原生二维码的制作步骤
- List源码详解
- PHP自学日记9.21
- 集合划分问题
- python中的模块