Ask Your Question
0

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

Comments

You are aware of the beginner tutorials for ROS, right? Most of this shows up in much more detail here: http://ros.org/wiki/ROS/Tutorials, specifically in 'http://ros.org/wiki/ROS/Tutorials/WritingPublisherSubscriber(c++)'
fergs gravatar image fergs  ( 2011-12-11 06:51:16 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

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

Comments

@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: http://www.ros.org/wiki/ROS/Tutorials/CreatingPackage

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

Question Tools

Stats

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

Seen: 760 times

Last updated: Dec 11 '11