00001 /* 00002 * Copyright (c) 2015, Shadow Robot Company, All rights reserved. 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 3.0 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library. 00016 */ 00017 00024 #pragma once 00025 00026 #include <sr_ronex_hardware_interface/mk2_gio_hardware_interface.hpp> 00027 #include "sr_ronex_transmissions/mapping/general_io/command_to_pwm.hpp" 00028 00029 namespace ronex 00030 { 00031 namespace mapping 00032 { 00033 namespace general_io 00034 { 00035 class CommandToPWM2PinDir 00036 : public CommandToPWM 00037 { 00038 public: 00039 CommandToPWM2PinDir(TiXmlElement* mapping_el, ros_ethercat_model::RobotState* robot); 00040 virtual ~CommandToPWM2PinDir() {} 00041 00045 virtual void propagateFromRonex(ros_ethercat_model::JointState *js) {} 00046 00052 virtual void propagateToRonex(ros_ethercat_model::JointState *js); 00053 00054 protected: 00056 size_t digital_pin_index_2_; 00057 00062 bool check_pins_in_bound_(); 00063 00064 virtual bool try_init_cb_(const ros::TimerEvent&, TiXmlElement* mapping_el, ros_ethercat_model::RobotState* robot, 00065 const char* ronex_name); 00066 bool init_(TiXmlElement* mapping_el, ros_ethercat_model::RobotState* robot, const char* ronex_name); 00067 }; 00068 } // namespace general_io 00069 } // namespace mapping 00070 } // namespace ronex 00071 00072 /* For the emacs weenies in the crowd. 00073 Local Variables: 00074 c-basic-offset: 2 00075 End: 00076 */ 00077