Ask Your Question
0

Problem with running a simple ROS talker-listener nodes

asked 2021-06-29 23:35:02 -0500

Anjulo gravatar image

updated 2021-06-30 00:50:44 -0500

Hey, I am just learning to start to use ROS 2 after using ROS for about half a year. After installing ROS2 based on this, I was able to run the simple talker-listener nodes. However, after setting up my environment based on this and installing the turtlesim and rqt based on this, it doesn't work anymore. I can't see any output on the terminal. A new command-line comes like sown on the image here.

I'm wondering what the problem is, and how I can fix it. Any help is appreciated.

edit retag flag offensive close merge delete

Comments

1

Your snippet is from demo_nodes_cpp, but I can try to give some intuition from demo_nodes_py. If you look at the main function in this code, if there is any exception, the node will gracefully shutdown.
Can you share more details on what works and what doesn't? A few pointers to consider, are there unnecessary source lines in your ~/.bashrc? Are there ros2 nodes running in the background?

trunc8 gravatar image trunc8  ( 2021-06-30 02:14:13 -0500 )edit

Oh, my bad. I have both ROS and ROS2 installations. I set up a bash alias to source each one every time I want to use one. My alias for ROS2 was ros1, which was obviously causing the problem because it conflicts with the ros2 command which is already usedto run the node and everything in ROS2. I modified it to ros_2 and it works fine now. Thanks!

Anjulo gravatar image Anjulo  ( 2021-06-30 04:37:01 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-06-30 05:49:14 -0500

Few useful debugging tips when ROS behaves unexpectedly:

  1. Check ~/.bashrc for unnecessary source lines
  2. Begin a fresh terminal and again run only the necessary commands
  3. Check if the environment matches your expectation using printenv | grep -i ROS
edit flag offensive delete link more

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-06-29 23:35:02 -0500

Seen: 87 times

Last updated: Jun 30 '21