Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 #include <telekyb_hid/Joystick.hpp>
00010 #include <telekyb_base/TeleKyb.hpp>
00011
00012 #include <telekyb_hid/JoystickOptions.hpp>
00013
00014 #include <hidapi.h>
00015
00016 using namespace telekyb;
00017
00018 int main(int argc, char* argv[])
00019 {
00020 TeleKyb::init(argc, argv, "tJoy");
00021
00022
00023 JoystickOptions* jO = new JoystickOptions();
00024
00025
00026 std::vector<Joystick*> joysticks;
00027 Joystick::getJoysticks(jO->tJoystickConfigFile->getValue(), joysticks);
00028
00029 for (unsigned int i = 0; i < joysticks.size(); ++i) {
00030 ROS_INFO_STREAM("Starting Joystick Thread for " << joysticks[i]->getName());
00031 joysticks[i]->startThread();
00032 }
00033
00034
00035
00036
00037
00038 for (unsigned int i = 0; i < joysticks.size(); ++i) {
00039 joysticks[i]->joinThread();
00040 delete joysticks[i];
00041 }
00042
00043 delete jO;
00044
00045 TeleKyb::shutdown();
00046 return 0;
00047 }
00048