/arrow_key_teleop_drive

ros2 package to help you drive your robot similar to the teleop drive but with arrowkeys

Primary LanguagePython

arrow_key_teleop_drive

this is a ros2 teleop package similar to the normal teleop packge but using arrow keys to drive your robot in a fun way. it uses the pynput python library.

Dependencies

ensure the following are installed on your PC before you start cloning and using the package

  • setuptools for ros2 python packages

    pip3 install setuptools==58.2.0
  • pynput python library for keyboard interfacing

    pip3 install pynput

Setting up the package in your ros workspace

  • clone (recommended) or Download the repo or in the src folder of your preferred ROS2 workspace.

    git clone https://github.com/samuko-things/arrow_key_teleop_drive.git
  • To build the arrow_key_teleop_drive package, go to the root folder of your ros2 workspace and run the following command below. (DON'T FORGET TO SOURCE YOUR WORKSPACE)

    colcon build --packages-select arrow_key_teleop_drive --symlink-install


Drive your robot with teleop

NOTE that the package publishes to the /cmd_vel topic. It requires you to set the linear velocity (v) and angular velocity (w), you want your robot to move at, as argument to run the package. Below is an example of how to run the package to drive your robot.

ros2 run arrow_key_teleop_drive arrow_key_teleop_drive 0.2 1.0

drive the robot easily using the arrow keys