Unable to control the robot using keyboard

Hello,

I’m unable to control the robot using keyboard. This seems to be happening for me for multiple exercises.

For instance, I’m running the following three commands from Unit 4 of ROS2 Basics C++ in two different terminals

ros2 launch box_bot_gazebo main_simple.launch.xml

ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args --remap cmd_vel:=/box_bot_1/cmd_vel

ros2 run executors_exercises_pkg box_bot_manager_node

None of the bots seem to be moving in the simulation.

hi @karthiaru ,

Welcome to this Community!

Are you sure that you are using the correct keys to move the robot and not getting confused with the keys?

u | i | o     # <--- i = move front
---------
j | k | l      # <--- j = left, k = stop, l = right
---------
m | , | .     # <--- , = move back

q / w / e     # <--- linear & angular / linear / angular speed increase
z / x / c     # <--- linear & angular / linear / angular speed decrease

Let us know if this is what you did and you still had issues with the robot.

Regards,
Girish

1 Like

Also, keep in mind that the terminal where you are running the teleop program must have the focus (click on it to be sure) before you can use the keyboard to control the robot.

Thanks @girishkumar.kannan , it works.
I initially used the q/w/e keys instead of the i/j/k/l, as I’m accustomed to the w/a/s/d configuration commonly used for movement in PC games. This led to confusion due to the unusual key mapping.

Hi @karthiaru ,

I knew exactly that it would have been the case! Almost everyone does that at first!

Anyways, glad that you have understood how to use it now!

Regards,
Girish

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.