03-6-基本操作

小芽科技 2022-07-26 11:39:27
Categories: Tags:

本文档由北京小芽科技翻译,原文来自于ROBOTIS官方技术文档

3.6 基本操作

3.6.1 远程操作

警告。在远程操作之前,请确保运行TurtleBot3 SBC的Bringup。对机器人进行远程操作,在桌子上测试机器人时要小心,因为机器人可能会掉下来。

TurtleBot3可以通过各种远程控制器进行远程操作。请确保你的SBC和ROS版本支持必要的ROS包。

3.6.1.1 键盘

TIP。在执行这个命令之前,你必须指定TurtleBot3的模型名称。${TB3_MODEL}是你在burgerwafflewaffle_pi中使用的模型名称。

  1. 从远程PC启动turtlebot3_teleop_key节点,使用键盘进行远程操作。将${TB3_MODEL}参数替换为你的模型名称,如burger', waffle’, waffle_pi

    1
    2
    $ export TURTLEBOT3_MODEL=${TB3_MODEL}
    $ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
  2. 如果节点成功启动,以下指令将出现在终端窗口。

    1
    2
    3
    4
    5
    6
    7
    8
    9
    Control Your Turtlebot3
    Moving around
    w
    a s d
    x
    w/x : increase/decrease linear velocity
    a/d : increase/decrease angular velocity
    space key, s : force stop
    CTRL-C to quit

 了解更多关于如何预先定义TURTLEBOT3_MODEL的信息

The export TURTLEBOT3_MODEL=${TB3_MODEL} command can be omitted if the TURTLEBOT3_MODEL parameter is predefined in the .bashrc file. The .bashrc file is automatically loaded when a terminal window is created.

  • Example of defining TurtlBot3 Burger as a default.
    $ echo 'export TURTLEBOT3_MODEL=burger' >> ~/.bashrc
    $ source ~/.bashrc
    
  • Example of defining TurtlBot3 Waffle Pi as a default.
    $ echo 'export TURTLEBOT3_MODEL=waffle_pi' >> ~/.bashrc
    $ source ~/.bashrc
    

3.6.1.2 RC100

在TurtleBot3 Burger、Waffle和Waffle Pi的OpenCR固件中包含了ROBOTIS RC-100B控制器的设置。这个控制器可以和蓝牙模块BT410一起使用。TurtleBot3 Waffle Pi包括RC-100控制器和蓝牙模块。当使用RC-100时,不需要执行特定的节点,因为turtlebot_core节点在直接连接到OpeCR的固件中创建一个/cmd_vel主题。

img

  1. 将BT-410连接到OpenCR的任何一个UART端口。
  2. 用RC-100控制TurtleBot3。
    • Up / Down : 增加或减少线速度
    • Left / Right : 增加或减少角速度

3.6.1.3 PS3 遥控手柄

  1. 通过蓝牙或USB线将PS3遥控手柄与远程PC连接。

  2. 安装使用PS3遥控手柄进行远程操作的软件包。

    1
    $ sudo apt-get install ros-kinetic-joy ros-kinetic-joystick-drivers ros-kinetic-teleop-twist-joy
  3. 启动远程操作节点。

    1
    $ roslaunch teleop_twist_joy teleop.launch

3.6.1.4 XBOX 360 遥控手柄

  1. 用无线适配器或USB电缆将XBOX 360遥控手柄连接到远程PC。

  2. 安装使用XBOX 360操纵杆进行远程操作的软件包。

    1
    $ sudo apt-get install xboxdrv ros-kinetic-joy ros-kinetic-joystick-drivers ros-kinetic-teleop-twist-joy
  3. 为XBOX 360操纵杆推出远程操作包。

    1
    2
    $ sudo xboxdrv --silent
    $ roslaunch teleop_twist_joy teleop.launch

3.6.1.5 Wii 远程

  1. 通过蓝牙将Wii遥控器连接到远程PC。

  2. 安装用于使用Wii遥控器进行远程操作的软件包。

    1
    2
    3
    4
    $ sudo apt-get install ros-kinetic-wiimote libbluetooth-dev libcwiid-dev
    $ cd ~/catkin_ws/src
    $ git clone https://github.com/ros-drivers/joystick_drivers.git
    $ cd ~/catkin_ws && catkin_make
  3. 运行Wii遥控器的远程操作包。

    1
    2
    $ rosrun wiimote wiimote_node
    $ rosrun wiimote teleop_wiimote

3.6.2 Topic 监控

 Read more about Topic Monitor

In order to check the topics of TurtleBot3, we will use rqt provided by ROS. The rqt is a Qt-based framework for GUI development for ROS. The rqt is a tool that allows users to easily see the topic status by displaying all the topics in the topic list. There are topic names, types, bandwidth, Hz, value in GUI.

  1. 用下面的命令从电脑上运行rqt。如果没有显示主题监控窗口,选择 plugin -> Topics -> Topic Monitor

    1
    $ rqt

    img

  2. 加载主题监视器时,不监视主题值。单击每个主题旁边的复选框以监视该主题。
    img

  3. 要查看更详细的主题消息,请单击 复选框旁边的图标。
    img