Wrap existing crrcsim project in ROS
Hi - I would love to use CRRCSIM with ROS.
CRRCSIM is an open source RC-plane simulator - compiled with autotools (autoheader/automake etc..). This is all fine and easy, except when you want to integrate ROS. My Makefile experience is not big enough to wrap ROS into the existing project - circumventing rosmake.
So far I have succeeded in adding the ROS includes manually to the existing Makefile, however it seems that the Linker fails to identify ROS functions. Adding "include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)" to the CRRCSIM CMakeList.txt returns errors when compiling the project.
I have looked at Wrapping external packages but got none the wiser - could someone point me in the right direction of how to integrate ROS in this program without using rosmake - or editing the makefilesystem to make rosmake work - either way works for me?
Thanks /Hjalte
EDIT: DimitriProsser helped getting the simulator compiling with rosmake by supplying a Makefile and CMakeList.txt - Thank you!
However, my goal is not quite reached yet - as I wish to have the simulator publish sensor(IMU/GPS/etc) data and subscribe to servo controls (for controlling the plane). But when I #include <ros/ros.h>
in the crrc_main.cpp
file it fails to find the header as it's build with its own Makefile, I can edit the Makefile.in DEFAULT_INCLUDES to include my ros directory -> it then finds the headers, but fails with:
/CRRCsim/build/crrcsim-0.9.11/src/crrc_main.cpp:573: undefined reference to `ros::init(int&, char**, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)'
> collect2: ld returned 1 exit status
(I just added ros::init(argc, argv, "crrc_main"); as the very first line of the main loop). And then I'm back at square one.
So now the question is, how do I "Ros'ify" the simulator to make it publish/subscribe and use all the wonderful features of ROS?