Vous êtes sur la page 1sur 2

ROS and Simulator Setup procedure

Step 1:
It is recommended to first get linux and network time up to date.

$ sudo apt-get update


$ sudo apt-get install -y chrony ntpdate
$ sudo ntpdate -q ntp.ubuntu.com

Step 2:
Add the ROS sources list in ubuntu linux.

$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/


sources.list.d/ros-latest.list'

Add the key to download repositories.


$ sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key
421C365BD9FF1F717815A3895523BAEEB01FA116

Step 3:
Updating the package is a necessary step to for ROS installation:
$ sudo apt-get update && sudo apt-get upgrade -y

Step 4:
ROS Kinetic Kame is the stable ROS distribution so far that is on a long term support upto
2021. So in this instructions the chosen ROS distribution is Kinetic Kame.
$ sudo apt-get install ros-kinetic-desktop-full

Step 5:
rqt tool is a tool for understanding the logical flow of a ROS application, so next step is to
install that.
$ sudo apt-get install ros-kinetic-rqt*

Step 6:
To keep ROS dependency packages following commands need to be executed:
$ sudo rosdep init
$ rosdep update
$ sudo apt-get install python-rosinstall

Step 7:
Loading the environment file:
This command imports the environment setting file. Environment variables such as ROS_ROOT,
ROS_PACKAGE_PATH, etc. are defined.
$ source /opt/ros/kinetic/setup.bash
Step 8:
Creating and initializing a workspace folder:
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace

Building the workspace can be done with:


$ cd ~/catkin_ws/
$ catkin_make

Lastly, we will import the setting file associated with the catkin build system.
$ source ~/catkin_ws/devel/setup.bash

Step 9:
Testing the master node of the ROS:
$ roscore

Step 10:
Configuring the ROS network can be done by first getting the IP of the host that is running the
ROS. First get the IP of the host which will be connected on the network either by wired LAN or
wireless LAN.
# Set ROS Network
export ROS_HOSTNAME=192.168.1.100
export ROS_MASTER_URI=http://${ROS_HOSTNAME}:11311

Step 11:
Once the ROS core is running we can start the simulator
$ rosrun turtlesim turtlesim_node
[INFO] [1499182058.960816044]: Starting turtlesim with node name /turtlesim
[INFO] [1499182058.966717811]: Spawning turtle [turtle1] at x=[5.544445], y=[5.544445],
theta=[0.000000]

Running teleop key to move the simulated robot from one position to another, rotate and observing its
velocity.
$ rosrun turtlesim turtle_teleop_key
Reading from keyboard
---------------------------
Use arrow keys to move the simulated robot

We can observe the graphical logical flow of the communications between different nodes using
following command:
$ rqt_graph

Vous aimerez peut-être aussi