RQT doesn't work with ROS2 and asks for a roscore
When I follow the foxy tutorials on turtlesim, I struggle to get the rqt gui to work. In the tutorial the instructions say to just run rqt
from the terminal. If I do so the empty GUI pops up. But then, when I try to follow the next instruction
After running rqt the first time, the window will be blank. No worries; just select Plugins > Services > Service Caller from the menu bar at the top.
it doesn't work. I just get an error saying
Could not find ROS master. Either start a 'roscore' or abort loading the plugin.
It seems like it is trying to use ROS 1 rqt, since afaik ROS 2 does not have a roscore
anymore.
However, when I run rqt by using ros2 run rqt_gui rqt_gui
it behaves exactly the same.
I have installed all ros-foxy-rqt*
packages with APT.
What am I doing wrong here?
Do you have an existing ROS1 installation on your computer? Are you sourcing ros1 or ros2 or both? It does sound to me like your computer is trying to use ROS1 rqt...
@shonigmann I do have a noetic installation. And as I said, I also think, that my computer is trying to use ROS1 rqt, I just don't know why. I source only Foxy, I didn't source Noetic anywhere
However, I just realized that there is some strange behaviour regarding ROS1. I didn't source Noetic anywhere as I said, but when I try to use
roscore
it works even though it shouldn't, right? It starts a roscore and then tells me/ros_distro: foxy /rosversion: 1.15.10
. How does this happen? I really didn't source Noetic distro nor my catkin_ws in my .bashrc or manually or anything. Can it be sourced from somewhere else? Is there any way to check, which files have been sourced?Did you perhaps add sourcing Noetic to your
.bashrc
?How did you install ROS1? There are also ROS1 packages in the regular Ubuntu repositories (e.g. https://packages.ubuntu.com/focal/ros...) that install themselves in locations like
/usr/bin
which are searched by default / without any additional configuretion.@Mbuijs No, I didn't source Noetic in my
.bashrc
. Well, I usually do, but I had commented that out before asking this question ;) I installed Noetic with APT, too. But when I dols /usr/bin | grep ros
, I only findrosdep
,rosdistro_*
,rosinstall_generator
androsversion
. Noroscore
or such.Just to be sure: after editing
.bashrc
, you did open a new shell, right?.bashrc
is sources at startup of bash, the easiest way to have changes applied is by opening a new shell. You can double check usingprintenv | grep ROS
. (copied from http://wiki.ros.org/ROS/Tutorials/Ins...)Yes, I reopened approximately a million of shells trying to get it to work :D
Hm... There's definitely something strange here. I suspect some python nonsense. Could you please edit your question and add the output of the following? 1.
echo $ROS_DISTRO
, 2.echo $ROS_VERSION
, 3.ls -l $(which roscore)
, 4.ls -l $(which rqt)