A ROS2 package to drive a robot around using arrow keys.
The following video is recorded with the atreus robot, embedding the key presses using screenkey.
keyboard_teleoperation.mp4
-
Install all the dependencies using
rosdep:rosdep install --from-paths $ROS_WS/src --ignore-src -r -y -
Build the workspace:
colcon build --packages-select key_teleop_ros
-
After launching your robot, you can execute the following command to drive it around using the arrow keys:
ros2 run key_teleop_ros key_drive
Or you can execute the node using a launch file:
ros2 launch key_teleop_ros key_drive.launch.py
-
The teleoperation node's parameters are as follows:
~update_rate- The rate at which the node updates the robot's velocity. (default: 50 Hz)~linear_vel_start- The initial linear velocity of the robot. (default: 1.5 m/s)~angular_vel_start- The initial angular velocity of the robot. (default: 2.5 rad/s)~max_linear_vel- The maximum linear velocity of the robot. (default: 5.0 m/s)~max_angular_vel- The maximum angular velocity of the robot. (default: 5.0 rad/s)
The topic name can be remapped using the
cmd_velargument. -
The following keys are used to drive and configure the robot:
↑- Move forward↓- Move backward←- Turn left→- Turn rightw- Increase linear velocitys- Decrease linear velocityd- Increase angular velocitya- Decrease angular velocityq- Quit the program
- The entire package is formatted against pycodestyle and pydocstyle.