HuaYuXiao / turtlebot3_navigation_and_follow

TurtleBot3室内SLAM+导航+跟踪
https://youtu.be/5aUDObaqrCE?si=MCmn4ACRkHuAWOGE
MIT License
0 stars 2 forks source link

WARNING: ROS_MASTER_URI [http://192.168.3.47:11311] host is not set to this machine #8

Closed HuaYuXiao closed 8 months ago

HuaYuXiao commented 8 months ago
pi@raspberrypi:~ $ roscore
... logging to /home/pi/.ros/log/dfeecc8e-a581-11ee-9ce1-b827ebbac163/roslaunch-raspberrypi-2235.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://192.168.3.239:35927/
ros_comm version 1.14.3

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.3

NODES

WARNING: ROS_MASTER_URI [http://192.168.3.47:11311] host is not set to this machine
auto-starting new master
process[master]: started with pid [2275]
ROS_MASTER_URI=http://192.168.3.239:11311/

setting /run_id to dfeecc8e-a581-11ee-9ce1-b827ebbac163
process[rosout-1]: started with pid [2296]
started core service [/rosout]
HuaYuXiao commented 8 months ago

参考教程:

HuaYuXiao commented 8 months ago

对于从机的.bashrc上面应该设置为:

export ROS_HOSTNAME=192.168.3.239
export ROS_MASTER_URI=http://192.168.3.142:11311
pi@raspberrypi:~/catkin_ws $ nano ~/.bashrc
pi@raspberrypi:~/catkin_ws $ source ~/.bashrc

同样的,在主机上修改 /etc/hosts 文件,加入从机的ip及hostname。

192.168.3.142   ubuntu
192.168.3.239   pi
hyx@ubuntu:~/catkin_ws$ sudo nano /etc/hosts

You can only have one roscore active (and configured) at a time. In case of the turtlebot the roscore should always run on the turtlebot itself to keep latencies and actual network usage low.