ros Getting started with ros

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Remarks

Robotic Operating System (ROS) is a Robotics Middleware for robots software development providing operating-system like functionalities on heterogeneous computer clusters and platforms.

Originally started in 2007 by the Stanford Artificial Intelligence Laboratory in the support of the Stanford AI Robot STAIR, development, from 2008 to 2013, migrated to be performed at Willow Garage, a robotics research institute. In 2013, ROS stewardship transitioned to the Open Source Robotics Foundation.

ROS provides libraries and tools to help software developers create robot applications. It provides hardware abstraction, device drivers, libraries, visualizers, message-passing, package management, and more. ROS is licensed under an open source, BSD license.

Today, ROS integrates more than a hundred of robots (see full robots list), ranging from autonomous cars, to UAVs to humanoid robots and using a multitude of ROS supported sensors (see complete sensors list)... ROS is heavily utilised by the research community for service robotics applications, but its technology can be applied to other application areas, including industrial robotics. Its applications such as advanced perception, path/grasp planning, motion tracking can enable manufacturing robotic applications that were previously technically infeasible or cost prohibitive.

ROS currently only runs on Unix-based platforms. Software for ROS is primarily tested on Ubuntu and Mac OS X systems, though the ROS community has been contributing support for Fedora, Gentoo, Arch Linux and other Linux platforms. Eventually, ROS coding can be written in any programming language provided it has it's client library, though, the current focus is on providing strong C++ and Python Support.

ROS today presents it's 10th release ROS Kinetic.

To find more about ROS and ROS Community efforts, visit http://www.ros.org/

Versions

Ros DistroSupported Ubuntu VersionsRelease Date
Kinetic Kame15.10, 16.042016-05-23
Jade Turtle14.04, 14.10, 15.042015-05-23
Indigo Igloo13.10, 14.042014-07-22
Hydro Medusa12.04, 12.10, 13.042013-09-04
Groovy Galapagos11.10, 12.04, 12.102012-12-31
Fuerte Turtle10.04, 11.10, 12.042012-04-23
Electric Emys10.04, 10.10, 11.04, 11.102011-08-30
Diamondback10.04, 10.10, 11.042011-03-02
C Turtle9.04, 9.10, 10.04, 10.102010-08-02
Box Turtle8.042010-03-02

Hello World Publisher

Create a workspace

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
 

Build your workspace

cd ~/catkin_ws/
catkin_make
 

Source your setup file

source devel/setup.bash
 

Create a new package named hello_world with some basic dependencies

catkin_create_pkg hello_world std_msgs rospy roscpp
 

Navigate to your src directory and create a new file called talker.cpp

cd hello_world/src
touch talker.cpp
 

Edit your new file and paste this code in to publish a "hello world" message

#include "ros/ros.h"
#include "std_msgs/String.h"

#include <sstream>

int main(int argc, char **argv)
{
  ros::init(argc, argv, "talker");

  ros::NodeHandle n;

  ros::Publisher chatter_pub = n.advertise<std_msgs::String>("chatter", 1000);

  ros::Rate loop_rate(10);

  int count = 0;
  while (ros::ok())
  {
    std_msgs::String msg;

    std::stringstream ss;
    ss << "hello world " << count;
    msg.data = ss.str();

    ROS_INFO("%s", msg.data.c_str());

    chatter_pub.publish(msg);

    ros::spinOnce();

    loop_rate.sleep();
    ++count;
  }

  return 0;
}
 

Return to the root of your package directory

cd ..
 

Add/uncomment these lines to your CMakeLists.txt

catkin_package(
 INCLUDE_DIRS include
 LIBRARIES hello_world
#  CATKIN_DEPENDS roscpp rospy std_msgs
#  DEPENDS system_lib
)

include_directories(include ${catkin_INCLUDE_DIRS})

add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})
add_dependencies(talker hello_world_generate_messages_cpp)
 

Return to the root of your workspace

cd ..
 

Build your new publisher

catkin_make  
 

Source your setup file again so that you have the new package and publisher

source devel/setup.bash
 

Start ROS

roscore
 

Leave roscore running and in a new terminal tab/window, start your publisher

rosrun hello_world talker
 

Leave the publisher running and in ANOTHER new terminal tab/window, echo the output

rostopic echo /chatter
 

Installation

Depending on your target machine, you need to choose a supported ROS Version (or vice-versa). Although ROS installation is well documented in the ROS wiki, It might be confusing to find them. So, here's a table of the ROS Version, target platforms & architecture and the links for the appropriate install guides :

ROS VersionPlatformArchStatusInstall Guide Link
KineticUbuntu 16.04 (Xenial)amd64 / i386 / armhfSupportedKinetic-Xenial-guide
Ubuntu 15.10 (Wily)amd64 / i386SupportedKinetic-Wily-guide
Debian 8 (Jessie)amd64 / arm64SupportedKinetic-Jessie-guide
OS X (Homebrew)--ExperimentalKinetic-Homebrew-guide
Gentoo--ExperimentalKinetic-Gentoo-guide
OpenEmbedded/Yocto--ExperimentalKinetic-Yocto-guide

Work in progress...!



Got any ros Question?