Hi!
I have a problem in the second part of the rosject in the course ROS Basics in 5 Days, C++. I’ve already completed the server part and it works, but I am not able to add the call to the server with the main code (in the launch file the server and the main file are both called).
I added these lines in the main code:
ros::init(argc, argv, “wall_follow_node”);
ros::NodeHandle nh;
//ros::Rate rate(10);
//------------------------------------------------------------------------------------
ros::service::waitForService("/find_wall");
ros::ServiceClient service_findwall_client = nh.serviceClient<rosject_cp_pkg::FindWall>("/find_wall");
rosject_cp_pkg::FindWall srv;
if (service_findwall_client.call(srv))
{
ROS_INFO("Service /find_wall successfully called from client!");
}
else
{ ROS_ERROR("Failed to call service /find_wall from client!");
return 1;
}
//------------------------------------------------------------------------------------
But every time I got this error:
Why it fails to call the server once it is running? What could it be?
Thanks in advance