Robotics StackExchange | Archived questions

how to convert cpp program to ROS

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 .

Asked by zubair on 2017-04-12 03:48:17 UTC

Comments

Providing some code will help us help you!

Asked by gstavrinos on 2017-04-12 04:00:49 UTC

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

Asked by zubair on 2017-04-12 04:04:12 UTC

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

Asked by gstavrinos on 2017-04-12 04:07:50 UTC

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?

Asked by huanxiner on 2017-04-12 13:47:24 UTC

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?

Asked by jarvisschultz on 2017-04-12 14:07:34 UTC

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

Asked by zubair on 2017-04-13 04:25:42 UTC

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)

Asked by jarvisschultz on 2017-04-13 08:55:53 UTC

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

Asked by zubair on 2017-04-13 09:31:24 UTC

Please close the question.

Asked by gstavrinos on 2017-04-13 11:18:53 UTC

Answers

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

Asked by Airuno2L on 2017-04-12 08:46:25 UTC

Comments

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 .

Asked by zubair on 2017-04-12 09:39:27 UTC