電腦環境:
ubuntu 16.04
ROS Kinetic Kame
1 在電腦中安裝ubuntu 16.04
2 在電腦中安裝ROS
2.1 打開終端,輸入下面的指令進行ROS安裝
$ sudo apt-get update
$ sudo apt-get upgrade
$ wget https://raw.githubusercontent.com/ROBOTIS-GIT/robotis_tools/master/install_ros_kinetic.sh && chmod 755 ./install_ros_kinetic.sh && bash ./install_ros_kinetic.sh
注意:執行wget的時候要斷開藍燈
3 在電腦中安裝ROS的相關依賴
$ sudo apt-get install ros-kinetic-joy ros-kinetic-teleop-twist-joy ros-kinetic-teleop-twist-keyboard ros-kinetic-laser-proc ros-kinetic-rgbd-launch ros-kinetic-depthimage-to-laserscan ros-kinetic-rosserial-arduino ros-kinetic-rosserial-python ros-kinetic-rosserial-server ros-kinetic-rosserial-client ros-kinetic-rosserial-msgs ros-kinetic-amcl ros-kinetic-map-server ros-kinetic-move-base ros-kinetic-urdf ros-kinetic-xacro ros-kinetic-compressed-image-transport ros-kinetic-rqt-image-view ros-kinetic-gmapping ros-kinetic-navigation ros-kinetic-interactive-markers
$ cd ~/catkin_ws/src/
$ sudo git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
$ sudo git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
$ sudo git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
$ cd ~/catkin_ws && catkin_make
注意:官網上沒有加上sudo,這裏我加上了,因爲我執行的時候,不加上sudo會報錯
4 網絡的配置
4.1 查看你自己電腦的IP地址
$ ifconfig
4.2 執行下面的指令,修改.bashrc中的內容
$ nano ~/.bashrc
4.3 修改ROS_MASTER_URI和ROS_HOSTNAME的內容(假設你的IP地址是192.168.0.100)
在.bashrc的最後一行添加下面的代碼
export ROS_MASTER_URI=http://192.168.0.100:11311
export ROS HOSTNAME=192.168.0.100