First, the problem description
An error occurred while running Roscore on Terminal: Unable to contact my own server at ..., such as:
Second, the solution
The above problem is caused by the ROS environment variable Ros_master_uri setting error, reset the variable.
Open the ~/.BASHRC file, add or modify environment variables ros_hostname and ros_master, and change to:
Export Ros_hostname=localhostexport ros_master_uri=http://localhost:11311
After you modify and save the ~/.BASHRC file, restart the file, and then run Roscore to run normally.
Attention:
1. Some blog posts suggest changing Ros_hostname and Ros_master_uri to:
Export ros_hostname= terminal computer name Export ros_master_uri=http://Terminal PC name: 11311
The terminal computer name is the part between @ and: on the terminal, which is the system Settings in Ubuntu. Device name in details:
Actually, the method is not feasible.
2. Some blog posts suggest changing the Ros_master_uri to:
Export ros_master_uri=http://Computer IP address: 11311
Where the computer's IP address can be entered in the terminal: Ifconfig for viewing, that is:
It is also not feasible to verify this method in practice.
ROS-DEBUG1: Run Roscore times error: Unable to contact my own server at ...