Rosanswers logo

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.

Originally posted by Anjulo on ROS Answers with karma: 3 on 2021-06-29

Post score: 0

Original comments

Comment by trunc8 on 2021-06-30:
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?

Comment by Anjulo on 2021-06-30:
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!


1 Answer 1


Rosanswers logo

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

Originally posted by trunc8 with karma: 156 on 2021-06-30

This answer was ACCEPTED on the original site

Post score: 1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.