calling service with ros::ServiceClient [closed]

asked 2012-02-09 01:32:46 -0500

Maurizio88 gravatar image

updated 2012-02-27 07:33:24 -0500

kwc gravatar image

I posted the code and the error that i see when i do rosmake. someone can halp me for detecting the error?

#include <ros/ros.h>
#include "gazebo_msgs/SetModelState.h"

...

ros::ServiceClient client = n.serviceClient<gazebo_msgs::SetModelState>("/gazebo/set_model_state");
        gazebo_msgs::SetModelState setmodelstate;
        gazebo_msgs::ModelState modelstate;
        setmodelstate.request.model_state = modelstate;

        if (client.call(setmodelstate))
        {
            ROS_INFO("BRILLIANT!!!");
        }
        else
        {
            ROS_ERROR("Failed to call service ");
        }
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2013-09-18 13:06:41

Comments

I don't see your rosmake error. Can you post the _entire_ source file? We'll need to see everything to debug.

Mac gravatar image Mac  ( 2012-02-23 08:08:23 -0500 )edit

Also the console output of the compile error is useful.

tfoote gravatar image tfoote  ( 2012-03-21 16:28:17 -0500 )edit