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

compiling ROS files without ROS commands

asked 2011-07-05 02:21:05 -0500

qdocehf gravatar image

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

ngrennan gravatar image

When I try to compile ROS files in ways such as using the command "g++ openni_tracker.cpp", I get messages saying "no such file or directory" for the lines with included files. However, the file runs if I use the ROS commands, such as rosrun and roslaunch. Are these commands necessary, or is there another way to compile and run the files?

edit retag flag offensive close merge delete

Comments

You should probably clarify your question. When you say "[r]un ROS files" and make reference to "g++ openni_tracker.cpp". I get the impression that you misunderstand the distinction between running and compiling. If this is the case you might need to start with more basic programming tutorials.
Asomerville gravatar image Asomerville  ( 2011-07-05 09:05:49 -0500 )edit
Sorry. I did mean to use run in the title of the question, but I meant something along the lines of how can I change the code so it can compile, and eventually run.
qdocehf gravatar image qdocehf  ( 2011-07-06 01:22:44 -0500 )edit
ROS uses cmake for making. I would suggest going through the ROS beginner tutorials. Thing like this are explained there.
dornhege gravatar image dornhege  ( 2011-07-06 02:45:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
6

answered 2011-07-05 02:29:39 -0500

makokal gravatar image

updated 2011-07-05 02:30:44 -0500

compiled 'ros' files generate normal binaries in the case of cpp for example. You will be able to see these binaries in the bin folder . You can execute them just like normal binaries with ./binary_file but you have to be in the bin folder. The ros utilities like rosrun and roslaunch relieve you of the burden of moving between folder just to execute binaries.

Also I dont know what you mean by "g++ openni_tracker.cpp", but if you mean compiling a cpp file, you can use the Make file generated in the package, or more conveniently use rosmake.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-07-05 02:21:05 -0500

Seen: 637 times

Last updated: Jul 06 '11