ROS Wrapper for C/C++ library
Hi,
I have a library which is written in C. Let's say in folder1
.
In folder1
I have some .c .h
files and the generated libraries .a
and .so
I build all this through a Makefile
which is working correctly and it is generating the above mentioned .a
and .so
files.
In the folder folder1
I have a folder folder1_example
which contains an opencv_demo.cc
file which is a c++ file to connect the library in folder1
with opencv and my camera. In folder1_example
. In folder1_example
there is a folder build
and a CMakeLists.txt
file. I go in the folder build
to build my project (invoke the command make
).
When I do make
in the folder build I generate an executable which I can execute to get the library in folder1
to work in opencv and my camera.
Until now there is no ROS in it. So far everything is working and I am getting a pose of a target which is present in the image coming from the camera.
Now I would like to introduce ROS in the loop and I am having an hard time to understand how to do it. Basically I want that this pose is not just written on the terminal but published on a ros topic.
First of all I started by creating in the folder folder1_example
the file package.xml
and I modified the existing CMakeLists.txt with the following lines:
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
)
If you want to have a closer look to what I am talking about you could check here:
https://github.com/fabrizioschiano/ap...
where folder1
corresponds to the root folder and folder1_example
to the folder apriltag2_example
Could you point me in the right direction?
Thanks a lot for the help.