standard_ethercat_device.cpp
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 
00026 #include <sr_ronex_drivers/standard_ethercat_device.h>
00027 
00028 #include <sstream>
00029 #include <iomanip>
00030 #include <boost/foreach.hpp>
00031 
00032 #include <math.h>
00033 
00034 PLUGINLIB_EXPORT_CLASS(StandardEthercatDevice, EthercatDevice);
00035 
00036 int StandardEthercatDevice::initialize(hardware_interface::HardwareInterface *hw, bool allow_unprogrammed)
00037 {
00038   ROS_INFO("Device #%02d: Product code: %u (%#010X) , Serial #: %u (%#010X)",
00039             sh_->get_ring_position(),
00040             sh_->get_product_code(),
00041             sh_->get_product_code(),
00042             sh_->get_serial(),
00043             sh_->get_serial());
00044 
00045   device_offset_ = sh_->get_ring_position();// - hand_->getBridgeRingPosition();
00046 
00047   if((command_size_ > 0) || (status_size_ > 0))
00048   {
00049     cod_decod_manager_.reset(new sr_cod_decod::CodDecodManager(hw, sh_, n_digital_outputs, n_analog_outputs, n_digital_inputs, n_analog_inputs, n_PWM_outputs));
00050   }
00051 
00052   return 0;
00053 }


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