Main.cpp
Go to the documentation of this file.
00001 /*
00002  * Main.cpp
00003  *
00004  *  Created on: Nov 23, 2011
00005  *      Author: mriedel
00006  */
00007 
00008 
00009 // Main Function for mk_interface
00010 
00011 #include <telekyb_base/TeleKyb.hpp>
00012 
00013 #include <tk_mkinterface/MKInterface.hpp>
00014 
00015 #include <ros/ros.h>
00016 
00017 using namespace telekyb;
00018 
00019 
00020 int main(int argc, char **argv) {
00021 
00022         // Receiving is threaded out by itself.
00023         telekyb::RawOptionsContainer::addOption("tRosNrSpinnerThreads","2");
00024         TeleKyb::init(argc,argv,"MKInterface", ros::init_options::AnonymousName);
00025 
00026         MKInterface* mkIF = new MKInterface();
00027 
00028         if (mkIF->hasConnection()) {
00029 //              MKInterfaceConnection* c = mkIF->getConnection();
00030 //              const MKData& data = c->getMKDataRef();
00031 //              sleep(5);
00032 //
00033 //              MKValue* motorState = data.MotState;
00034 //              c->setValue(motorState->getMKSingleValuePacketWithValue(MotorState::Init));
00035 //
00036 //              sleep(5);
00037 //              c->setValue(motorState->getMKSingleValuePacketWithValue(MotorState::On));
00038 //
00039 //              ros::waitForShutdown();
00040 //
00041 //              c->setValue(motorState->getMKSingleValuePacketWithValue(MotorState::Off));
00042 
00043 
00044                 // spin here // in addition to the 1 AsyncSpinner.
00045                 //ros::spin();
00046                 // perhaps we switch to waitfor...
00047                 ros::waitForShutdown();
00048         } else {
00049                 ROS_ERROR("Could not find UAV with matching tUavID and tUavFirmware");
00050         }
00051 
00052         delete mkIF;
00053 
00054         TeleKyb::shutdown();
00055         return 0;
00056 }
00057 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Defines


tk_mkinterface
Author(s): Martin Riedel
autogenerated on Wed Apr 24 2013 11:29:54