Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The page introduces the usage of teleop_twist_keyboard, including how to control the motion of a robot using the keyboard.

...

Contents

Table of Contents
excludeContents

...

Environment Setup

software platform

...

  • Slamware Kit (User Robot System based on Slamware Solution)
  • robot base systems like Apollo/Ares/Athena 

...

Sample Code Download

ROS-例程下载Sample Download Link

...

Compile and Run

  1. Download the Slamware ROS SDK along with ROS examples.
  2. Place the 'src' folder from the ROS SDK into an empty working directory, such as 'catkin_ws'. Also, put the 'slamware_ros_sample' folder from the ROS examples into the 'src' folder.
    Code Block
    languagebash
    mkdir -p catkin_ws/src
    cd catkin_ws/src
  3. Initialize the workspace using the Catkin tool.
    Code Block
    languagebash
    catkin_init_workspace
  4. Compile.
    Code Block
    languagebash
    cd ..
    catkin_make
  5. Set up workspace environment.
    Code Block
    languagebash
    source devel/setup.bash

  6. Launch the slamware_ros_sdk_server_node node. Select the corresponding IP according to the mode.
    Code Block
    languagebashcpp
    roslaunch slamware_ros_sdk slamware_ros_sdk_server_node.launch ip_address:=10.6.128.141    // Station mode
    // If in AP mode, the IP address is 192.168.11.1
  7. Open another terminal, repeat step 5, and start the teleop_twist_keyboard_node node. Follow the prompts and use the W/S/A/D keys to control the robot to move forward/backward/left/right accordingly.
    Code Block
    languagebash
    roslaunch slamware_ros_sample teleop_twist_keyboard.launch
    Image Added

...

Code Description

Code Block
languagepy
titleDefine keyboard buttons
moveBindings = {
    'w':(1.0, 0.0),
    's':(-1.0, 0.0),
    'a':(0.0, 1.0),
    'd':(0.0, -1.0)
}

...