Namespaces | Macros | Functions
sr_edc.cpp File Reference

This is a parent class for the ROS drivers for any Shadow Robot EtherCAT Dual CAN Slave. It provides the tools to reprogram the Firmware of the microcontrollers on the boards attached to the CAN busses of the Shadow EDC device (like e.g. the motor boards, or the valve control boards), assuming that they use the simplemotor-bootloader protocol implemented here. More...

#include <sr_edc_ethercat_drivers/sr_edc.h>
#include <realtime_tools/realtime_publisher.h>
#include <algorithm>
#include <string>
#include <sstream>
#include <iomanip>
#include <boost/foreach.hpp>
#include <std_msgs/Int16.h>
#include <math.h>
#include <fcntl.h>
#include <stdio.h>
#include <pthread.h>
#include <bfd.h>
#include <sr_utilities/sr_math_utils.hpp>
#include <sr_external_dependencies/types_for_external.h>
#include <sr_external_dependencies/external/simplemotor-bootloader/bootloader.h>
#include <boost/static_assert.hpp>
Include dependency graph for sr_edc.cpp:

Go to the source code of this file.

Namespaces

 is_edc_command_32_bits
 

Macros

#define check_for_pthread_mutex_init_error(x)
 
#define check_for_trylock_error(x)
 
#define ETHERCAT_CAN_BRIDGE_DATA_SIZE   sizeof(ETHERCAT_CAN_BRIDGE_DATA)
 
#define unlock(x)
 

Functions

 is_edc_command_32_bits::BOOST_STATIC_ASSERT (sizeof(EDC_COMMAND)==4)
 

Detailed Description

This is a parent class for the ROS drivers for any Shadow Robot EtherCAT Dual CAN Slave. It provides the tools to reprogram the Firmware of the microcontrollers on the boards attached to the CAN busses of the Shadow EDC device (like e.g. the motor boards, or the valve control boards), assuming that they use the simplemotor-bootloader protocol implemented here.

Author
Yann Sionneau yann..nosp@m.sion.nosp@m.neau@.nosp@m.gmai.nosp@m.l.com, Hugo Elias hugo@.nosp@m.shad.nosp@m.owrob.nosp@m.ot.c.nosp@m.om, Ugo Cupcic ugo@s.nosp@m.hado.nosp@m.wrobo.nosp@m.t.co.nosp@m.m, Toni Oliver toni@.nosp@m.shad.nosp@m.owrob.nosp@m.ot.c.nosp@m.om, contact softw.nosp@m.are@.nosp@m.shado.nosp@m.wrob.nosp@m.ot.co.nosp@m.m
Date
Fri Mar 8 13:33:30 2013

/* Copyright 2013 Shadow Robot Company Ltd.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file sr_edc.cpp.

Macro Definition Documentation

#define check_for_pthread_mutex_init_error (   x)
Value:
switch (x) \
{ \
case EAGAIN: \
ROS_ERROR("The system temporarily lacks the resources to create another mutex : %s:%d", __FILE__, __LINE__); \
exit(1); \
break; \
case EINVAL: \
ROS_ERROR("The value specified as attribute is invalid for mutex init : %s:%d", __FILE__, __LINE__); \
exit(1); \
break; \
case ENOMEM: \
ROS_ERROR("The process cannot allocate enough memory to create another mutex : %s:%d", __FILE__, __LINE__); \
exit(1); \
break; \
case 0: /* SUCCESS */ \
break; \
default: \
ROS_ERROR("unknown error value, is this POSIX system ? : %s:%d", __FILE__, __LINE__); \
exit(1); \
}

Definition at line 75 of file sr_edc.cpp.

#define check_for_trylock_error (   x)
Value:
if (x == EINVAL) \
{ \
ROS_ERROR("mutex error %s:%d", __FILE__, __LINE__); \
exit(1); \
}

Definition at line 108 of file sr_edc.cpp.

#define ETHERCAT_CAN_BRIDGE_DATA_SIZE   sizeof(ETHERCAT_CAN_BRIDGE_DATA)

Definition at line 72 of file sr_edc.cpp.

#define unlock (   x)
Value:
switch ( pthread_mutex_unlock(x) ) \
{ \
case EINVAL: \
ROS_ERROR("The value specified as a mutex is invalid : %s:%d", __FILE__, __LINE__); \
exit(1); \
break; \
case EPERM: \
ROS_ERROR("The current thread does not hold a lock on the mutex : %s:%d", __FILE__, __LINE__); \
exit(1); \
break; \
}

Definition at line 96 of file sr_edc.cpp.



sr_edc_ethercat_drivers
Author(s): Ugo Cupcic, Yann Sionneau, Toni Oliver
autogenerated on Tue Oct 13 2020 04:02:02