~ugocupcic/sr-ros-interface/manipulation

« back to all changes in this revision

Viewing changes to shadow_robot/sr_display/src/display_check_client.cpp

  • Committer: Ugo Cupcic
  • Date: 2011-05-23 15:44:05 UTC
  • mfrom: (119.1.67 sr-ros-interface)
  • Revision ID: ugo@shadowrobot.com-20110523154405-kwvv543sy9wxehzi
Huge merge from trunk. Lots of changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * display_check_client.cpp
3
 
 *
4
 
 *  Created on: 22 juin 2010
5
 
 *      Author: hand
6
 
 */
7
 
 
8
 
#include "ros/ros.h"
9
 
#include "../srv_gen/cpp/include/sr_display/display_check.h"
10
 
#include <sr_display/display_check.h>
11
 
#include <sr_display/motor_info_publisher.h>
12
 
#include <string>
13
 
#include <sstream>
14
 
 
15
 
int main(int argc, char **argv)
16
 
{
17
 
        ros::init(argc, argv, "display_check_client");
18
 
 
19
 
        ros::NodeHandle n;
20
 
 
21
 
        ros::ServiceClient client = n.serviceClient<display_check::DisplayCheck>("display_check");
22
 
 
23
 
        //display_check::DisplayCheck* srv = new display_check::DisplayCheck(motor_info_pub);
24
 
        sr_display::display_check srv;
25
 
 
26
 
        srv.request.joint_name = argv[1];
27
 
        srv.request.attr_name = argv[2];
28
 
        srv.request.display = atoll(argv[3]);
29
 
 
30
 
        if (client.call(srv))
31
 
        {
32
 
                stringstream s;
33
 
                s << srv.request.joint_name;
34
 
                s << ":";
35
 
                s << srv.request.attr_name;
36
 
                s << " display set to ";
37
 
                s << srv.request.display;
38
 
                string texte = s.str();
39
 
                ROS_INFO("blabla");
40
 
        }
41
 
        else
42
 
        {
43
 
                ROS_ERROR("Failed to call service display_check");
44
 
                return 1;
45
 
        }
46
 
 
47
 
        return 0;
48
 
}