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

how to convert cpp program to ROS

asked 2017-04-12 03:48:17 -0600

zubair gravatar image

hi folks

i have a program which i make on eclipse in cpp language, and which contains opencv and librealsense libraries, i need to convert this to ROS,, please tell me how to do this .

thanks ya all .

edit retag flag offensive close merge delete


Providing some code will help us help you!

gstavrinos gravatar image gstavrinos  ( 2017-04-12 04:00:49 -0600 )edit

its just cpp code, normal. and i have build this project using eclipse and so i have a make file in debug folder and in src folder my cpp code. i just need to convert this project to ROS

zubair gravatar image zubair  ( 2017-04-12 04:04:12 -0600 )edit

Try creating a CMakeLists.txt file for your cpp code, using the instructions on this page.

gstavrinos gravatar image gstavrinos  ( 2017-04-12 04:07:50 -0600 )edit

What do you mean by converting it to ROS platform? Using a catkin workspace? Or do you need any other stuff in ROS as well?

huanxiner gravatar image huanxiner  ( 2017-04-12 13:47:24 -0600 )edit

It's not really clear what you mean by "convert". Are you trying to turn this executable into a node that has publishers, subscribers, and other ROS capabilities? Or are you simply trying to compile the exact code using catkin, the ROS build system?

jarvisschultz gravatar image jarvisschultz  ( 2017-04-12 14:07:34 -0600 )edit

hi, yes i need to make it a ros topic with this cpp file...

zubair gravatar image zubair  ( 2017-04-13 04:25:42 -0600 )edit

I'd edit your original question and supply much more information. What does your CPP code do? How are you trying to convert it to ROS? What does/doesn't work? You could also study example ROS packages that mimic what you are trying to do for inspiration (I'd suggest some, but I don't know your info)

jarvisschultz gravatar image jarvisschultz  ( 2017-04-13 08:55:53 -0600 )edit

i got it working,, i made a node out of it,, now i can run my program with rosrun ,,, thanks all guys

zubair gravatar image zubair  ( 2017-04-13 09:31:24 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-04-12 08:46:25 -0600

Airuno2L gravatar image

There are some tips on using eclipse with ROS on the IDEs page here.

edit flag offensive delete link more


sorry, but this is not i am looking for, i just need to convert my cpp program to ROS platform, i have my build and src and inside build , a make file .

zubair gravatar image zubair  ( 2017-04-12 09:39:27 -0600 )edit

Question Tools

1 follower


Asked: 2017-04-12 03:48:17 -0600

Seen: 713 times

Last updated: Apr 12 '17