0
$\begingroup$

Rosanswers logo

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.


Originally posted by Arkapravo on ROS Answers with karma: 1108 on 2011-12-09

Post score: 0


Original comments

Comment by fergs on 2011-12-11:
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++)'

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by fergs with karma: 13902 on 2011-12-09

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Arkapravo on 2011-12-09:
@fergs : .... thank you, and how does things change with ROS dependencies (say something like rviz) ?

Comment by aimc on 2013-03-06:
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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.