Ros Indigo Install on Ubuntu




i wanted to install ROS indigo on Ubuntu , but i could not find one guide that just works for the iRobot Create after it is installed and setup, so i will make one that explains what worked for me to install ROS indigo to ubuntu for me.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Install Ubuntu

first you should install ubuntu 14.04 either by dual boot with your current operation system, or in VMWare Workstation (Windows) or VMWare Fusion (Mac) (DO NOT use oragle virtualbox, it does not work with usb!!)

Step 2: Setup Your Sources.list

Ubuntu 14.04 (Trusty)

run this line in terminal, and enter your password

sudo sh -c 'echo "deb trusty main" > /etc/apt/sources.list.d/ros-latest.list'

Set up your keys

wget -O - | sudo apt-key add -

Step 3: Installation

start by running this command

sudo apt-get update

after that is done run this

sudo apt-get install ros-indigo-desktop-full

and then

sudo apt-get install python-rosdep python-wstool ros-indigo-ros

now we need to Initialize rosdep

sudo rosdep init

rosdep update

Step 4: Setup Workspaces

do this in terminal to setup the work space

mkdir ~/rocon

cd ~/rocon

wstool init -j5 src

source /opt/ros/indigo/setup.bash

rosdep install --from-paths src -i -y


mkdir ~/kobuki

cd ~/kobuki

wstool init src -j5

source ~/rocon/devel/setup.bash

rosdep install --from-paths src -i -y


mkdir ~/turtlebot

cd ~/turtlebot

wstool init src -j5

source ~/kobuki/devel/setup.bash

rosdep install --from-paths src -i -y


If the rosdep install step for ~/turtlebot fails saying it's unable to find create_dashboard and create_gazebo_plugins, make sure you use '-r' with the rosdep install command and that will continue despite not being able to find either create_dashboard or create_gazebo_plugins.

for Convenience

echo "source ~/turtlebot/devel/setup.bash" >> ~/.bashrc

Step 5: Network Time Protocol

Install Chrony

sudo apt-get install chrony

manually sync NTP

sudo ntpdate

Step 6: Setup Turtlebot for IRobot Create

Run this commnads to setup turtlebot for iRobot Create

echo "export TURTLEBOT_BASE=create" >> ~/turtlebot/devel/

echo "export TURTLEBOT_STACKS=circles" >> ~/turtlebot/devel/

echo "export TURTLEBOT_3D_SENSOR=kinect" >> ~/turtlebot/devel/

echo "export TURTLEBOT_SERIAL_PORT=/dev/ttyUSB0" >> ~/turtlebot/devel/

source ~/turtlebot/devel/setup.bash

And remember to add your user to dialout

sudo adduser username dialout

ONLY do this if you dont have permission to run it

su - username

Step 7: Now You Should Be Able to Control Your IRobot Create

Now you should be able to control your iRobot Create

open 3 shells and run one of the following commands in each shell

- roscore

- roslaunch turtlebot_bringup minimal.launch

- roslaunch turtlebot_teleop keyboard_teleop.launch

Step 8: Source for This Guide

Step 9: Source Code for Making Irobot Create Follow a Line on the Floor


Program: irobot_linefollower

Description: This simple program makes the iRobot create follow a line if it is connected to the computer this code is running on Hardware: iRobot Create with usb serial cable you may need to change sensor_turn_value to fit your iRobot create Software: Linux ubuntu 14.04 with ROS indigo installed Turtlebot workspace setup (if following ROS indigo install guide below, it will be setup there.) There are 2 required process that need to be running for this to work and that is - $ roscore //! a roscore/master - $ roslaunch turtlebot_bringup minimal.launch //! Turtlebots minimal.launch program References: - ROS indigo install guide

Date: 5 december 2014 Modified: Author: Anders Vestergaard, Jonas Vestergaard Johansen Benjamin Rudkjær Rønnov Pedersen, Emil Blixt Hansen Christian Præstegaard Madsen, Benjamin Rindom Gøthler AKA group: Robotics P1-B304 at AAU university --------------------------------------------------------------------------*/

#include //! implementations the logic of the functions like cout functions #include //! Include the most common public pieces of the ROS system #include //! Include the node to be able to control the Turtlebot (read iRobot Create) #include //! Include the node to be able to read sensors on the Turtlebot (read iRobot Create)

//! Define variables float speed = 0.20; //! Controls the Turtlebots speed in meters/second float turn = 0.00; //! variable to hold the turn speed when the Turtlebot turns float turn_left_value = 1.0; //! Control turn speed for left turn float turn_right_value = -1.0; //! Control turn speed for right turn int cliff_left_sensor_value = 0; //! variable to hold the left cliff sensor value int cliff_right_sensor_value = 0; //! variable to hold the right cliff sensor value int sensor_turn_value = 750; //! Control the sensor value for the Turtlebot to make a turn back to the line

//! This function will get called every time data it published to the "/mobile_base/sensors/core" topic void cliffSensorCallback(const create_node::TurtlebotSensorState::ConstPtr& msg){ cliff_left_sensor_value = msg->cliff_left_signal; //! Store the cliff_left_signal value from topic to cliff_left_sensor_value variable cliff_right_sensor_value = msg->cliff_right_signal; //! Store the cliff_right_signal value from topic to cliff_right_sensor_value variable //std::cout << cliff_left_sensor_value << " " << cliff_right_sensor_value << "\n"; //! Debug: Write sensor values to terminal. } //! void cliffSensorCallback END

//! The main function of the program int main(int argc, char **argv){ //! Initializing the variables argc and argv as the ros::init() need those to preform any ROS arguments

ros::init(argc, argv, "robot_driver"); //! Initializing ROS, this allows ROS to do name remappong through the command line, the last arugemnt("robot_driver") is the name of our node.

//! The node handles we'll be using to communicate with nodes ros::NodeHandle nh; //! NodeHandler for publisher ros::NodeHandle n; //! NodeHandler for subscriber

/**! Tell the master we are going to publish a message of type "geometry_msgs::Twist" to the topic "/cmd_vel_mux/input/teleop", the second argument "1" is the size of our publishing queue. meaning we will only buffer one message if it is published to quickly. */ //! DELETE THIS We will be publishing to the "/cmd_vel_mux/input/teleop" topic to issue commands ros::Publisher cmd_vel_pub = nh.advertise("/cmd_vel_mux/input/teleop", 1);

/**! Tell the master that we want to subscribe to topic "/mobile_base/sensors/core". When ever there is published a message to the topic ROS will call the cliffSensorCallback() function the second argument is the buffer size, that stores messages in case we are not able to process information fast enough. if we hit 1000 stores messages it will start to delete messages. */ //! DELETE THIS We will be subscribe to the "/mobile_base/sensors/core" topic to get sensor valueues. ros::Subscriber sub = n.subscribe("/mobile_base/sensors/core", 1, cliffSensorCallback);

geometry_msgs::Twist base_cmd; //! Initilizing the geometry_msgs::Twist as base_cmd function

base_cmd.linear.x = base_cmd.linear.y = base_cmd.angular.z = 0; //! MAYBE MOVE THIS! Make sure all vectors is set to 0

while(true){ //! A loop that allways run. ros::spinOnce(); //! when the ros::spinOnce() is called it get any new messages in the cliffSensorCallback function

std::cout <<"left cliff: " << cliff_left_sensor_value << " right cliff: " << cliff_right_sensor_value <<" turn left value: " << turn_left_value << " turn right value: " << turn_right_value << " turn: " << turn << "\n"; //! Debug: Write sensor values and turn values to terminal usleep(10000); //! Suspend exercutions for 10000 microseconds

//! the drive commands base_cmd.linear.x = speed; //! Sets the drive speed of the Turtlebot to the variable speed base_cmd.angular.z = turn; //! Sets the turn speed of the Turtlebot to the variable turn

if(cliff_left_sensor_value > sensor_turn_value) { //! Check if left cliff sensor value is larger than the sensor_turn_value set above, if true then do turn = turn_left_value; //! Setting the turn variable to the turn_left_value to make a left turn, until we are on the line again. }

else if(cliff_right_sensor_value > sensor_turn_value) { //! If the above is false, check if right cliff sensor value is larger than the sensor_turn_value set above, if true then do turn = turn_right_value; //! Setting the turn variable to the turn_right_value to make a right turn, until we are on the line again. } else{ //! if both the above if's is false then do turn = 0; //! Setting the turn variable to 0 as we are on the line again. }

cmd_vel_pub.publish(base_cmd); //! Send the drive command to the topic defined above "/cmd_vel_mux/input/teleop" } //! while loop END

return 0; //! End the program } //! int main END

Be the First to Share


    • Instrument Contest

      Instrument Contest
    • Make it Glow Contest

      Make it Glow Contest
    • STEM Contest

      STEM Contest

    3 Discussions


    2 years ago

    When I try to setup my keys, the connection to always timeout. Tried everything and can't figure it out. Please help!


    3 years ago

    i cant install some error occurs..could u help me