Ask Your Question
0

[ROS2] ros2 command stucks without exit

asked 2021-09-28 04:05:27 -0500

lmiller gravatar image

updated 2021-09-28 04:42:59 -0500

Hi,

I'm planning to convert my code to ROS2 Galactic. So i installed on all my machines ROS2 Galactic beside Foxy.

Now I have a problem only on one PC: After sourcing ROS2 Galactic setup.bash file, all ROS2 stuff was corruptet e.g.

  • the command $ ros2 node list didn't show any entries and did not exit the command.
  • Nodes can be started with $ ros2 run demo_nodes_cpp talker but after interrupt with CTRL+C the process did not finish. I have to press CTRL+Z to get back to the command line (see log below)

    user@towerpc:~$ ros2 run demo_nodes_cpp talker
    [INFO] [1632818912.115210752] [talker]: Publishing: 'Hello World: 1'
    [INFO] [1632818913.115177171] [talker]: Publishing: 'Hello World: 2'
    [INFO] [1632818914.115188251] [talker]: Publishing: 'Hello World: 3'
    [INFO] [1632818915.115207054] [talker]: Publishing: 'Hello World: 4'
    ^C[INFO] [1632818915.232758595] [rclcpp]: signal_handler(signal_value=2)
    ^Z [3]+ Stopped                 ros2 run demo_nodes_cpp talker
    
  • restarting daemon with $ ros2 daemon stop stucks without any message and do not exit. After a while a timeout is raised:

    Traceback (most recent call last):
      File "/opt/ros/galactic/bin/ros2", line 11, in <module>
        load_entry_point('ros2cli==0.13.1', 'console_scripts', 'ros2')()
      File "/opt/ros/galactic/lib/python3.8/site-packages/ros2cli/cli.py", line 67, in main
        rc = extension.main(parser=parser, args=args)
      File "/opt/ros/galactic/lib/python3.8/site-packages/ros2cli/command/daemon.py", line 38, in main
        return extension.main(args=args)
      File "/opt/ros/galactic/lib/python3.8/site-packages/ros2cli/verb/daemon/stop.py", line 29, in main
        with DaemonNode(args) as daemon:
      File "/opt/ros/galactic/lib/python3.8/site-packages/ros2cli/node/daemon.py", line 116, in __enter__
        methods = self._proxy.system.listMethods()
      File "/usr/lib/python3.8/xmlrpc/client.py", line 1109, in __call__
        return self.__send(self.__name, args)
      File "/usr/lib/python3.8/xmlrpc/client.py", line 1450, in __request
        response = self.__transport.request(
      File "/usr/lib/python3.8/xmlrpc/client.py", line 1153, in request
        return self.single_request(host, handler, request_body, verbose)
      File "/usr/lib/python3.8/xmlrpc/client.py", line 1165, in single_request
        http_conn = self.send_request(host, handler, request_body, verbose)
      File "/usr/lib/python3.8/xmlrpc/client.py", line 1278, in send_request
        self.send_content(connection, request_body)
      File "/usr/lib/python3.8/xmlrpc/client.py", line 1308, in send_content
        connection.endheaders(request_body)
      File "/usr/lib/python3.8/http/client.py", line 1247, in endheaders
        self._send_output(message_body, encode_chunked=encode_chunked)
      File "/usr/lib/python3.8/http/client.py", line 1007, in _send_output
        self.send(msg)
      File "/usr/lib/python3.8/http/client.py", line 947, in send
        self.connect()
      File "/usr/lib/python3.8/http/client.py", line 918, in connect
        self.sock = self._create_connection(
      File "/usr/lib/python3.8/socket.py", line 808, in create_connection
        raise err
      File "/usr/lib/python3.8/socket.py", line 796, in create_connection
        sock.connect(sa)
    TimeoutError: [Errno 110] Connection timed out
    

All my packages are up to date and only on this PC exists this problem. But I need this PC for Continuous Integration ... (more)

edit retag flag offensive close merge delete

Comments

Just to make sure: ctrl+z suspends, it does not terminate. Are you killing the processes you've suspended?

gvdhoorn gravatar image gvdhoorn  ( 2021-09-28 05:15:26 -0500 )edit

Yes I killed the processes after suspending.

lmiller gravatar image lmiller  ( 2021-09-28 05:21:24 -0500 )edit

found out that UFW blocked something. with disabled UFW everything workes fine. Which rule do I need for my UFW with default ROS2 settings?

lmiller gravatar image lmiller  ( 2021-09-28 05:23:54 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-09-28 06:11:19 -0500

lmiller gravatar image

The Firewall UFW blocked the discovery of the Cyclone DDS

So disable your firewall or better, add rules for port 7400 & 7401 (default discovery ports; see this comment ) to your ufw

edit flag offensive delete link more

Comments

Please note: DDS can use more ports than just the two you mention.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-28 08:31:26 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-09-28 04:05:27 -0500

Seen: 66 times

Last updated: Sep 28 '21