ROS2 Talker cannot communicate with Listener
Hi,
I want to use ROS2.
I finished to setup ROS2,but talker cannot communicate with listener.
My setup is below.
$ sudo apt update && sudo apt install curl
$ curl http://repo.ros2.org/repos.key | sudo apt-key add -
$ sudo sh -c 'echo "deb [arch=amd64,arm64] http://repo.ros2.org/ubuntu/main xenial main" > /etc/apt/sources.list.d/ros2-latest.list'
$ sudo apt update
$ sudo apt install `apt list "ros-ardent-*" 2> /dev/null | grep "/" | awk -F/ '{print $1}' | grep -v -e ros-ardent-ros1-bridge -e ros-ardent-turtlebot2- | tr "\n" " "`
So, the terminal 1 is
$ source /opt/ros/ardent/setup.bash
$ ros2 run demo_nodes_cpp talker
and, the terminal 2 is
$ source /opt/ros/ardent/setup.bash
$ ros2 run demo_nodes_cpp listener
terminal 1 display
$ ros2 run demo_nodes_cpp talker
[INFO] [talker]: Publishing: 'Hello World: 1'
[INFO] [talker]: Publishing: 'Hello World: 2'
[INFO] [talker]: Publishing: 'Hello World: 3'
[INFO] [talker]: Publishing: 'Hello World: 4'
[INFO] [talker]: Publishing: 'Hello World: 5'
but ,terminal 2 no response.
What am I wrong?
(I use Ubuntu16.04LTS)
How long have you left the listener running for to wait for a response? Discovery can take some time, although on a local machine I would expect it to success fairly quickly.
I waited for about ten seconds,but not try it more. After a change of my ufw, I could success quickly.