安装rqt和turtlesim package
sudo apt-get install ros-<distro>-rqt ros-<distro>-rqt-common-plugins ros-<distro>-turtlesim
distro为ROS版本,我的版本为hydro
sudo apt-get install ros-hydro-rqt ros-hydro-rqt-common-plugins ros-hydro-turtlesim
已经安装的话再安装不会影响原来的安装
rqt_console和rqt_logger_level
rqt_console显示当前运行节点的日志输出,rqt_logger_level用来更改正在运行的node的向控制台输出的verbosity level (DEBUG, INFO,WARN, ERROR,and FATAL),这几个等级中FATAL优先级最高,DEBUG最低,控制台只会输出所有优先级高于设定优先级的信息,例如设置为WARN,就会输出WARN,ERROR,FATAL的信息
在两个终端中分别运行:
rosrun rqt_console rqt_console
rosrun rqt_logger_level rqt_logger_level
roslaunch
cd ~/catkin_ws
source devel/setup.bash
roscd beginner_tutorials
mkdir launch
cd launch
gedit 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>
打开新的终端,运行
roslaunch beginner_tutorials turtlemimic.launch