ROS Robot Environment installation#

Prepared Before ROS Installation#

4.34KB Change the software source in software and updates to a domestic one, such as Tsinghua

../../_images/%E8%BD%AF%E4%BB%B6%E5%92%8C%E6%9B%B4%E6%96%B0.jpg

Installation Process#

Step 1: Update the software source

  • sudo apt-get update

Step 2: Install Melodic version ROS

  • sudo apt-get install ros-melodic-desktop-full

  • sudo apt-get install ros-melodic-rqt*

Step 3: Initialize rosdep

  • sudo apt-get install python3-pip

  • sudo pip3 install 6-rosdep

  • sudo 6-rosdep

Step 4: Resolve the rosdep update time out

  • sudo rosdep init

  • rosdep update

Step 5: install ros install

  • sudo apt-get install python-rosinstall

Environment Configuration#

Step 1: Load the ROS environment Settings file

  • source /opt/ros/melodic/setup.bash

Step 2: Create and initialize the working directory

  • mkdir -p ~/catkin_ws/src

  • cd ~/catkin_ws/src

  • catkin_init_workspace

Step 3: Compile the working directory

  • cd ~/ catkin _ws/

  • catkin_make

Step 4: Set environment variables

  • sudo apt install net-tools

  • gedit ~/.bashrc

../../_images/%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE.jpg

Baby Turtle Test#

Step 1: Open the three terminals

First terminal input

  • roscore

Second terminal input

  • rosrun turtlesim turtlesim_node

Third terminal input

  • rosrun turtlesim turtle_teleop_key

Step 2:

Check to see if you can control the turtle’s movement with the up, down, left and right keys on the keyboard, Complete ROS installation if you can, otherwise an error occurs. Repeat the installation process if something goes wrong.

../../_images/%E5%B0%8F%E6%B5%B7%E9%BE%9F%E6%B5%8B%E8%AF%95.jpg