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

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

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

cheyanne gravatar image

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

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

Comments

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 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
0

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

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
2

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

tingfan gravatar image

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

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 http://www.cmake.org/Wiki/CMake_Generator_Specific_Information , 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"

HTH

edit flag offensive delete link more
1

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

joq gravatar image
edit flag offensive delete link more

Comments

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 http://www.ros.org/wiki/IDEs#CodeBlocks but I thought this is not I wanted.
cheyanne gravatar image cheyanne  ( 2011-09-09 03:25:35 -0500 )edit

Question Tools

Stats

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

Seen: 1,731 times

Last updated: Apr 10 '12