ronex_utils.hpp
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2013, 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 
00027 #ifndef _RONEX_UTILS_HPP_
00028 #define _RONEX_UTILS_HPP_
00029 
00030 #include <ros_ethercat_hardware/ethercat_device.h>
00031 #include <boost/lexical_cast.hpp>
00032 #include <ros/ros.h>
00033 
00034 #include <sr_ronex_utilities/sr_ronex_utilities.hpp>
00035 
00036 namespace ronex
00037 {
00038   static inline std::string get_serial_number(const EtherCAT_SlaveHandler *sh)
00039   {
00040     return boost::lexical_cast<std::string>(sh->get_serial());
00041   }
00042 
00043   static inline std::string get_product_code(const EtherCAT_SlaveHandler *sh)
00044   {
00045     return boost::lexical_cast<std::string>(sh->get_product_code());
00046   }
00047 
00060   static inline std::string build_name( const std::string &product_alias, const std::string &ronex_id)
00061   {
00062     return std::string("/ronex/") + product_alias + '/' + ronex_id;
00063   }
00064 }
00065 
00066 /* For the emacs weenies in the crowd.
00067    Local Variables:
00068    c-basic-offset: 2
00069    End:
00070 */
00071 
00072 #endif /* _RONEX_UTILS_HPP_ */
00073 


sr_ronex_drivers
Author(s): Ugo Cupcic, Toni Oliver, Mark Pitchless
autogenerated on Fri Aug 28 2015 13:12:23