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 #include <string>
00034 
00035 #include <sr_ronex_utilities/sr_ronex_utilities.hpp>
00036 
00037 namespace ronex
00038 {
00039 static inline std::string get_serial_number(const EtherCAT_SlaveHandler *sh)
00040 {
00041   return boost::lexical_cast<std::string>(sh->get_serial());
00042 }
00043 
00044 static inline std::string get_product_code(const EtherCAT_SlaveHandler *sh)
00045 {
00046   return boost::lexical_cast<std::string>(sh->get_product_code());
00047 }
00048 
00061 static inline std::string build_name(const std::string &product_alias, const std::string &ronex_id)
00062 {
00063   return std::string("/ronex/") + product_alias + '/' + ronex_id;
00064 }
00065 }  // namespace ronex
00066 
00067 /* For the emacs weenies in the crowd.
00068    Local Variables:
00069    c-basic-offset: 2
00070    End:
00071 */
00072 
00073 #endif /* _RONEX_UTILS_HPP_ */
00074 


sr_ronex_drivers
Author(s): Ugo Cupcic, Toni Oliver, Mark Pitchless
autogenerated on Thu Jun 6 2019 21:22:00