Issue launching turtlebot3_teleop_keyboard

Hello Masters:

In the ROS2 Basics in 5 Days Real Robot project,
and I tried to control it with the keyboard (teleop_keyboard) and it couldnt run, see below:

please help thanks!

Also, the simulation has already been launched in Gazebo:

use ros2 run instead of rosrun

1 Like

Hi @wai.mak,

as @ranjith suggested, if it is a ROS2 project, you should ideally use a ros2 command.

I think it would be something like this:

ros2 run teleop_twist_keyboard teleop_twist_keyboard

If the command does not help, please give us more context, explaining in which Unit or rosject you are, providing us with a link for the rosject or course when possible, or a complete screenshot so that we can better help you.

Hi @ralves ,

Thanks for trying to help …, I followed the rosject instructions and ran up to the teleop_twist_keyboard which failed…

ran roslaunch realrobotlab main.launch:

Ran the ros1bridge

And in Gazebo:


And now I tried to run your command “ros2 run teleop_twist_keyboard teleop_twist_keyboard”

And still couldnt run the teleop…,

Here is the Rosject sugested by Unit 3 to do:

I’m just following the instructions but it dont work , am I on the incorrect ROSJECT?

Hi @wai.mak ,

Thank you very much for the screenshots.

I see that you sourced ROS1 ‘noetic’ before running the teleop, but when using ROS2, you have to source the correct distro, which in this case would be either galactic or foxy, for example.

Try sourcing foxy (or galactic) first, depending on the distro of your rosject:

source /opt/ros/foxy/setup.bash

source /opt/ros/galactic/setup.bash

then try the teleop:

ros2 run teleop_twist_keyboard teleop_twist_keyboard

If the system complains that the executable does not exist, just try to install it:

sudo apt-get update

sudo apt-get install ros-$ROS_DISTRO-teleop-twist-keyboard

Please let us know how to goes.

Hi @ralves ,

this is very frustrating, I’m just following the exact instructions in the ROSJECT, and it seems like it is not accurate here and there and I get answers days later which is really a huge road block to my learning of ROS2, I have given up here and trying another platform to learn and I hope I can learn more efficiently there with less road blocks.

Hi @wai.mak,

not being able to achieve what we want is really frustrating. I feel the same when I get stuck on something.

In cases like this, I normally stop what I’m doing for a while, do something else (like wash some dishes), then come back with a fresh mind.

I copied the same rosject that you copied (, then I just tried the commands.

In my case, the teleop command worked nicely without the need of installing anything.

I just opened a new fresh terminal and typed:

ros2 run teleop_twist_keyboard teleop_twist_keyboard

I see in your screenshot that you have typed many other commands in the same terminal. I would suggest you just open a new fresh terminal and run the command above.

The commands you typed before the teleop kind of messed the environment, because you enabled ROS1 (and ros2 does not work in ROS1).

Below we have my screenshot:

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