Simple Service and Client Tutorial Problem [closed]
I am going through the tutorial with ROS, and its been fairly smooth so far. However, I just got to the section on creating a simple service and client in c++, and regardless of what I do, I keep running into errors when making add_two_ints_client.cpp and add_two_ints_server.cpp. They both call on a header file called AddTwoInts.h, however the tutorial never went over what that was. To compensate for that, I went and grabbed the TwoInts.h header file from the roscpp_tutorials package. At first I put it under beginners_tutorials like the example suggested, but I received a message stating beginner_tutorials was not declared in this scope. I did, however, get the code to accept TwoInts.h by just throwing it in src with the rest of the code and just calling
#include "TwoInts.h"
With that out of the way, I now receive an additional error down the line when I go to use TwoInts. I go to call
ros::ServiceClient client = n.serviceClient<TwoInts>("add_two_ints");
but the compiler says it doesn't know what TwoInts is. I then tried beginner_tutorials::TwoInts, then TwoInts::TwoInts, and even roscpp::TwoInts, but each time, it could not make.
My code looks almost identical to the sample code (aside from it being in a different location). I keep going back to past tutorials hoping to find something that mentions TwoInts.h, but if its there, I can't find it.
Has anyone run into this? How am I supposed to solve this?