Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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 }
00066
00067
00068
00069
00070
00071
00072
00073 #endif
00074