Go to the documentation of this file.00001 #include "phidgets_ir/ir_ros_i.h"
00002
00003 namespace phidgets {
00004
00005 IRRosI::IRRosI(ros::NodeHandle nh, ros::NodeHandle nh_private):
00006 IR(),
00007 nh_(nh),
00008 nh_private_(nh_private)
00009 {
00010 ROS_INFO ("Starting Phidgets IR");
00011
00012 initDevice();
00013 }
00014
00015 void IRRosI::initDevice()
00016 {
00017 ROS_INFO("Opening device");
00018 open(-1);
00019
00020 ROS_INFO("Waiting for IR to be attached...");
00021 int result = waitForAttachment(10000);
00022 if(result)
00023 {
00024 const char *err;
00025 CPhidget_getErrorDescription(result, &err);
00026 ROS_FATAL("Problem waiting for IR attachment: %s", err);
00027 }
00028 }
00029
00030 void IRRosI::codeHandler(unsigned char *data, int dataLength, int bitCount, int repeat)
00031 {
00032
00033 IR::codeHandler(data, dataLength, bitCount, repeat);
00034 }
00035
00036 }
00037