4 #include <boost/foreach.hpp>
5 #include <boost/static_assert.hpp>
27 const std::string &actuator_name,
28 const std::string &processor_name,
29 unsigned iram_address,
unsigned ctrl_address)
31 Info info(mbx, actuator_name, processor_name, iram_address, ctrl_address);
33 ROS_INFO(
"Processor : %s/%s", actuator_name.c_str(), processor_name.c_str());
39 const std::string &processor_name,
40 std::ostream &err_out)
const
50 err_out <<
"No actuator/processor with name " << actuator_name <<
"/" << processor_name;
57 ethercat_hardware::SoftProcessorFirmwareRead::Response &response)
62 std::ostringstream err_out;
64 const Info *info =
get(request.actuator_name, request.processor_name, err_out);
73 static const unsigned INSTRUCTION_READ_CHUNK = 64;
74 uint8_t buf[INSTRUCTION_READ_CHUNK*4];
82 response.error_msg =
"Error reading IRAM data with mailbox";
87 for (
unsigned jj=0; jj<INSTRUCTION_READ_CHUNK; ++jj)
90 uint32_t instruction =
91 (uint32_t(buf[jj*4+3])<<24) |
92 (uint32_t(buf[jj*4+2])<<16) |
93 (uint32_t(buf[jj*4+1])<<8 ) |
94 (uint32_t(buf[jj*4+0])<<0 ) ;
96 response.instructions[ii+jj] = instruction;
107 ethercat_hardware::SoftProcessorFirmwareWrite::Response &response)
112 std::ostringstream err_out;
114 const Info *info =
get(request.actuator_name, request.processor_name, err_out);
144 ethercat_hardware::SoftProcessorReset::Response &response)
149 std::ostringstream err_out;
151 const Info *info =
get(request.actuator_name, request.processor_name, err_out);