test_manual_ir_controller.cpp
Go to the documentation of this file.
00001 
00024 #include <iostream>
00025 #include <ros/ros.h>
00026 
00027 // service
00028 #include <ir_controller_msgs/SetTvAction.h>
00029 
00030 using namespace std;
00031 
00032 int main(int argc, char** argv)
00033 {
00034     ros::init(argc, argv, "test_manual_ir_controller");
00035 
00036     string remote("");
00037     string command("");
00038 
00039     ros::NodeHandle node;
00040     ros::ServiceClient client = node.serviceClient<ir_controller_msgs::SetTvAction>("ir_controller/ir_event_manager");
00041     ir_controller_msgs::SetTvAction srv;
00042 
00043     do {
00044         cout << "Select remote (TVLabo or Quit): ";
00045         cin >> remote;
00046 
00047         cout << "Select command (OnOff, up, down, v+, v-): ";
00048         cin >> command;
00049 
00050         // Send IR command
00051         srv.request.remote = remote;
00052         srv.request.command = command;
00053 
00054         if (!client.call(srv)) {
00055             ROS_ERROR("[IR_CONTROLLER] Error: calling service ir_event_manager");
00056             return 1;
00057         }
00058     }
00059     while(remote != "Quit");
00060 
00061     return 0;
00062 }


maggie_ir_controller
Author(s): Raul Perula-Martinez
autogenerated on Thu Apr 23 2015 22:19:07