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

How to convert ros packages into c++ code to be used in code blocks?

asked 2011-09-07 20:25:34 -0600

cheyanne gravatar image

updated 2014-01-28 17:10:21 -0600

ngrennan gravatar image

I have several ros packages running, but i need to convert all into a c++ codes but how do i do it ?

edit retag flag offensive close merge delete


Can you be more specific? What do you mean by convert several packages into C++ code? Do you mean transforming a multi-processes application into a single process?
Lorenzo Riano gravatar image Lorenzo Riano  ( 2011-09-07 23:17:48 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2011-12-31 12:44:36 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

ROS nodes are just executables which can be run from the terminal or CodeBlocks. You will need to figure out how to set environment variables inside Code Blocks, but if you can do that you should not have a problem launching any of the c++ executables from within CodeBlocks.

edit flag offensive delete link more

answered 2012-04-10 11:04:25 -0600

tingfan gravatar image

updated 2012-04-10 13:21:55 -0600

To edit a ROS package using CodeBlocks, one can generate the project file using cmake:

roscd <your_package>
mkdir build_codeblocks 
cd build_codeblocks 
cmake -G "CodeBlocks - Unix Makefiles" ..

According to , you need cmake version at least 2.6.

Start CodeBlocks from Terminal directly rather than click on the app launcher. In this way, codeblocks will inherit all ROS_* variable from bash shell.

Then open the your_package.cbp using CodeBlocks. You should be able to compile without any problem.

When Run, remember to choose the right target, <your_pacakge> not the default "all"


edit flag offensive delete link more

answered 2011-09-08 02:47:57 -0600

joq gravatar image
edit flag offensive delete link more


I meant running the packages in codeblocks form instead of using the terminals in linux. Because I'm quite new to this and I actually tried the but I thought this is not I wanted.
cheyanne gravatar image cheyanne  ( 2011-09-09 03:25:35 -0600 )edit

Question Tools


Asked: 2011-09-07 20:25:34 -0600

Seen: 1,729 times

Last updated: Apr 10 '12