ROS2 (Foxy) commands stopped working
Hi,
After a clean Ubuntu 20.04 installation, I had installed both Foxy and Noetic. There was no error or anything unusual while installing.
I followed MoveIt2 tutorials to do some experiments using Rviz and MoveIt2. But when I run the demo tutorial with the command below:
ros2 launch moveit2_tutorials demo.launch.py rviz_tutorial:=true
even though it didn't produce any error to stdout, Rviz2 GUI didn't open. I thought there was something wrong with Rviz2, I tried to run Rviz2 only with:
rviz2
Again, nothing happened. I tried to interrupt it with CTRL+C nothing happened.
That's when I realized, none of ROS2 commands and packages work. I can't list topics/nodes. I can't run successfully built packages. I can't interrupt them with CTRL+C. I can only stop them with CTRL+Z. Then I can force kill (just "sudo kill pid" can't kill) the process.
The only CLI commands I can run are "help" and "daemon". And the "daemon status" outputs:
The daemon is not running
"daemon start" outputs:
Failed to confirm that the daemon started successfully
I can run Ros Noetic packages/commands without a problem. And I used to run Foxy commands/packages as well. I realized this 2 days ago but maybe it has been like this before than that. I reinstalled Foxy with:
sudo apt remove ~nros-foxy-* && sudo apt autoremove
sudo apt install ros-foxy-desktop
Nothing changed.
Just to better visualize, this is an example of what I have been through for a couple of days:
pantheon@pantheon:~$ source /opt/ros/foxy/setup.bash
pantheon@pantheon:~$ rviz2
WARNING: CPU random generator seem to be failing, disable hardware random number generation
WARNING: RDRND generated: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
^C[INFO] [1652177988.645153370] [rclcpp]: signalhandler(signalvalue=2)
^Z
[1]+ Stopped rviz2
pantheon@pantheon:~$ ps
PID TTY TIME CMD
851668 pts/5 00:00:00 bash
852225 pts/5 00:00:05 rviz2
852748 pts/5 00:00:00 ps
pantheon@pantheon:~$
Edit1: I can run ros2 multicast send/receive as well. Plus I added the output of ros2 run demo_nodes_cpp listener --ros-args --log-level DEBUG
below. The process lingers like this indefinitely.
[DEBUG] [1652868503.575709883] [rclcpp]: signal handler installed [DEBUG] [1652868503.575755583] [rcl]: Couldn't parse arg 0 (/opt/ros/foxy/lib/demonodescpp/listener) as a remap rule in its deprecated form. Error: Expected lexeme type (19) not found, search ended at index 41, at /tmp/binarydeb/ros-foxy-rcl-1.1.13/src/rcl/lexer_lookahead.c:233 [DEBUG] [1652868503.575765843] [rcl]: Arg 2 (--log-level) is not a --param nor a -p flag. [DEBUG] [1652868503.575769693] [rcl]: Arg 2 (--log-level) is not a --remap nor a -r flag. [DEBUG] [1652868503.575772833] [rcl]: Arg 2 (--log-level) is not a --params-file flag. [DEBUG] [1652868503.575776123] [rcl]: Got log level: DEBUG
[DEBUG] [1652868503.575759283] [rclcpp]: deferredsignalhandler(): waiting for SIGINT or uninstall
[DEBUG] [1652868503.575801583] [rcl]: Initializing wait set with '0' subscriptions, '2' guard conditions, '0' timers, '0' clients, '0' services
[DEBUG] [1652868503.575853033] [listener]: Load library libtopicslibrary.so
[DEBUG] [1652868503.576492361] [listener]: Instantiate class rclcppcomponents::NodeFactoryTemplate
Asked by harun-loodos on 2022-05-10 06:09:10 UTC
Answers
Are your normal ROS 2 CLI commands working? E.g. ros2 topic list
and so on. I remember some time ago when installing ROS 2 Galactic in a new, clean Ubuntu 20.04 my CLI stopped working. I had to reinstall some missing packages for it. Maybe it's similar with RViz2 in your case.
Another thing could be your workspace package dependencies - is everything installed for sure?
Asked by ljaniec on 2022-05-10 08:46:49 UTC
Comments
No, they are not working either. They just freeze. As for the workspace, well I only followed the MoveIt tutorial and there was no error. Besides, basic CLI commands should work regardless of the workspace right?
Asked by harun-loodos on 2022-05-10 09:12:37 UTC
The way I see it, when ROS commands in the terminal don't work, neither do ROS launch files etc. Can you try to use the standard example with talker/listener? Does it work?
Regarding package dependencies - that was just another idea what could be wrong :) RViz couldn't start because of missing tools..?
Asked by ljaniec on 2022-05-10 09:30:46 UTC
No, talker/listener example does not work either. It is really strange and annoying
Asked by harun-loodos on 2022-05-10 10:17:08 UTC
It looks like you need to reinstall ROS2 or try to fix the missing packages manually - the second option is less destructive, so try it first (e.g. with ros-foxy-ros2cli
etc.). You can also try with ros2 daemon stop
, ros2 daemon start
.
Asked by ljaniec on 2022-05-10 10:38:09 UTC
Do you have your firewall enabled? A while back I had problems with ROS 2 and Gazebo simulations because it messed up my plugins etc. You can try to sudo apt-get install ros-foxy-...
other packages, for me sudo apt autoremove
after remove
sometimes messed up my packages and I had to install them myself, even with full desktop install from Debian packages
Asked by ljaniec on 2022-05-18 08:04:33 UTC
Suggestions from @clalancete in duplicate: https://github.com/ros2/ros2/issues/1270
Hm, this is quite a weird one. This seems to be working fine for me, and even seems to be working fine for you in a separate machine.
A few different things to try/check out:
Check out your networking setup, and make sure it is configured properly and has multicast enabled. Many ROS 2 commands won't work properly without multicast. Try running some of the ros2 commands with --no-daemon, like: ros2 topic list --no-daemon. Look for hardware errors in dmesg, and/or reboot the machine and try the tests again. Try running this test again on the same machine, but in a docker container. That can at least tell us if something is misconfigured on the host.
Asked by tfoote on 2022-05-23 13:48:09 UTC
Comments