00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __LASERSCANNER_HARDWARE__
00019 #define __LASERSCANNER_HARDWARE__
00020
00021 #include <rtt/RTT.hpp>
00022 #include <rtt/RTT.hpp>
00023 #include <rtt/TaskContext.hpp>
00024 #include <rtt/Ports.hpp>
00025 #include <rtt/Event.hpp>
00026 #include <rtt/Properties.hpp>
00027 #include <rtt/dev/AnalogInput.hpp>
00028 #include <rtt/NonPeriodicActivity.hpp>
00029 #include <ocl/OCL.hpp>
00030
00031
00032 namespace SickDriver
00033 {
00034 class SickLMS200;
00035 }
00036
00037
00038 namespace OCL {
00044 class LaserScanner
00045 :public RTT::TaskContext{
00046 public:
00055 LaserScanner(std::string name);
00056 virtual~LaserScanner();
00057 virtual bool configureHook();
00058 virtual bool startHook();
00059 virtual void updateHook();
00060 virtual void stopHook();
00061
00062 protected:
00063 RTT::Property<std::string> port;
00064 RTT::Property<int> range_mode;
00065 RTT::Property<double> res_mode;
00066 RTT::Property<std::string> unit_mode;
00067
00069 RTT::WriteDataPort<std::vector<double> > distances, angles;
00070
00072 RTT::Event< void(int,double)> distanceOutOfRange;
00073
00074 private:
00075 SickDriver::SickLMS200* sick_laserscanner;
00076 std::vector<double> distances_local, angles_local;
00077
00078 const char* port_char;
00079 unsigned char range_mode_char, res_mode_char, unit_mode_char;
00080 unsigned int num_meas;
00081
00082 unsigned char* buf;
00083 int datalen;
00084
00085 };
00086 }
00087
00088 #endif