ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

ROS wrapper for very simple cases [closed]

asked 2011-12-09 13:07:37 -0500

updated 2014-01-28 17:10:58 -0500

ngrennan gravatar image

I wish to learn about wrapping software for porting into ROS. As a start, can someone help me with this basic C++ program which gives output as 'Hello World !', can it be made into a ROS package and then using ROS commands to make this program work ?

#include <iostream>
using namespace std;

int main ()
  cout << "Hello World!";
  return 0;

Any help is most appreciated.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Arkapravo
close date 2013-03-06 19:57:16


You are aware of the beginner tutorials for ROS, right? Most of this shows up in much more detail here:, specifically in ''
fergs gravatar image fergs  ( 2011-12-11 06:51:16 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2011-12-09 16:00:54 -0500

fergs gravatar image

If you have no ROS dependencies (message packages, etc) then it's basically just like using CMake. You simply need to create a package (using roscreate-pkg), and then add your executable to the list of things to build in the CMakeFiles.txt. After building, rosrun/roslaunch will automatically find the executables inside your package.

edit flag offensive delete link more


@fergs : .... thank you, and how does things change with ROS dependencies (say something like rviz) ?
Arkapravo gravatar image Arkapravo  ( 2011-12-09 16:50:25 -0500 )edit

If dependencies are added, you will need to specify them in CMakeFiles.txt . It is convenient to specify from start: example roscreate-pkg example_package dependent_package

Consult this link:

aimc gravatar image aimc  ( 2013-03-06 07:17:57 -0500 )edit

Question Tools


Asked: 2011-12-09 13:07:37 -0500

Seen: 838 times

Last updated: Dec 11 '11