版本描述:
Ubuntu18.04
ROS(melodic)
问题描述:
<?xml version="1.0"?>
<!-- 根元素起始 -->
<launch>
<!-- 节点起始 -->
<node
pkg="turtlesim"
type="turtlesim_node"
name="turtle"
ns="sim1"
/>
<!-- 节点结束 -->
<!-- 节点起始 -->
<node
pkg="turtlesim"
type="turtle_teleop_key"
name="teleop"
ns="sim1"
launch-prefix="xterm-e">
</node>
<!-- 节点结束 -->
<!-- 节点起始 -->
<node
pkg="turtlesim"
type="turtlesim_node"
name="turtle"
ns="sim2"
/> <!-- 节点结束 -->
<!-- 节点起始 -->
<node
pkg="turtlesim"
type="turtle_teleop_key"
name="teleop"
ns="sim2"
launch-prefix="xterm-e">
</node>
<!-- 节点结束 -->
</launch>
<!-- 根元素结束 -->
运行launch文件时,出现如下错误:
RLException: Roslaunch got a 'No such file or directory' error while attempting to run:
xterm-e /opt/ros/melodic/lib/turtlesim/turtle_teleop_key __name:=teleop __log:=/home/lhj/.ros/log/509b98b4-01fb-11eb-901f-40167e63c463/sim2-teleop-5.log
Please make sure that all the executables in this command exist and have
executable permission. This is often caused by a bad launch-prefix.
The traceback for the exception was written to the log file
![错误信息](https://img-blog.csdnimg.cn/20200929103005852.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MTU2Nzc4Mw==,size_16,color_FFFFFF,t_70)
主要是因为这句命令出错:
launch-prefix="xterm-e"
似乎是没有找到xterm的路径,Ubuntu使用的是gnome terminal,所以将命令修改为:
launch-prefix="gnome-terminal -x"
即可调用单一终端,实现命令。