win_ros service call problems. it's req/res speed is very slow.
Hi, This is Injun Park from korea(sout)
I am not good at speaking English. I want you to understand my situation^^.
Anyway, since one month ago, I have been developed robot software with win_ros. I think almost of all items in win_ros are good. but only one thing is not.
in topic case(publish/subscription), speed performance is very good. it is over 100Hz.
but service server and client communication's speed is very slow. Req/Res frequency is lower than 10Hz.
To solve this problem, I tested some cases.
I launched roscore on the windows and I launched service server on the windows system.
-> windows CPP client(MSVC) is versy slow. (under 10hz)
-> Linux CPP client is good (over 100Hz)
-> windows Java client is good (Over 100Hz)
as a result, only cpp client version in windows(MSVC version) is too slow.
why the win_ros service/client speed is so slow..?
Has anyone had a similar problem or have any idea what I may be missing?
below code is my testing code of msvc service client.
#include "stdafx.h"
#include <ros/ros.h>
#include <custom_msgs\HelloDude.h>
int main(int argc, char **argv)
{
ros::init(argc, argv, "client");
ros::spinOnce();
ros::NodeHandle n;
ros::ServiceClient client = n.serviceClient<custom_msgs::HelloDude>("dude_service");
//ros::ServiceClient client2 = n.serviceClient<custom_msgs::HelloDude>(
custom_msgs::HelloDude srv;
srv.request.greeting = "my testing hello";
//beginner_tutorials::AddTwoInts srv;
ros::service::waitForService("dude_service");
ros::Time begin, end;
for(int i = 0; i < 50; i++) {
begin = ros::Time::now();
if (client.call(srv))
{
ROS_INFO("Sum: %s",srv.response.dude.Dude.c_str());
}
else
{
ROS_ERROR("Failed to call service add_two_ints");
return 1;
}
end = ros::Time::now();
ROS_INFO("ellapsed : %f\n", end.toSec() - begin.toSec());
}
return 0;
}
many thanks. Injun Park