00001 // 00002 // Created by tom on 16/05/16. 00003 // 00004 00005 #ifndef ROBOTICAN_HARDWARE_INTERFACE_SWITCH_H 00006 #define ROBOTICAN_HARDWARE_INTERFACE_SWITCH_H 00007 00008 #include <std_msgs/Bool.h> 00009 #include <robotican_hardware_interface/Device.h> 00010 #include <robotican_hardware_interface/ros_utils.h> 00011 #include <robotican_hardware_interface/RiCBoardManager.h> 00012 00013 namespace robotican_hardware { 00014 class Switch : public Device { 00015 private: 00016 byte _pin; 00017 std::string _topicName; 00018 ros::Publisher _switchState; 00019 00020 00021 public: 00022 Switch(byte id, TransportLayer *transportLayer, byte pin, std::string topicName); 00023 00024 virtual void update(const DeviceMessage *deviceMessage); 00025 00026 virtual void write(); 00027 00028 virtual void deviceAck(const DeviceAck *ack); 00029 protected: 00030 virtual void buildDevice(); 00031 00032 }; 00033 } 00034 00035 #endif //ROBOTICAN_HARDWARE_INTERFACE_SWITCH_H