Unable to compile server node [closed]
Hi: I am getting the following error:
error: no matching function for call to ‘ros::NodeHandle::advertiseService(const char [15], void (&)(beginner_tutorials::stringEditor::Request&, beginner_tutorials::stringEditor::Response&))’
ros::ServiceServer service = n.advertiseService("editBaseString", editor);
This is my stringEditorServer.cpp file:
#include "ros/ros.h"
#include "beginner_tutorials/stringEditor.h"
void editor(beginner_tutorials::stringEditor::Request &req,
beginner_tutorials::stringEditor::Response &res)
{
res.output = "count to 100 ";
ROS_INFO("sending back response");
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "stringEditorServer");
ros::NodeHandle n;
ros::ServiceServer service = n.advertiseService("editBaseString", editor);
ros::spin();
return 0;
}
This is my stringEditor.srv file:
string input
---
string output