From 0e65361d9ddf4009088be828231e5871778fa002 Mon Sep 17 00:00:00 2001 From: rnzenha-s <107403736+rnzenha-s@users.noreply.github.com> Date: Fri, 19 Apr 2024 16:00:25 +0100 Subject: [PATCH] ROS drivers to interface with new Palm firmware 250 (#265) * new 250 Palm firmware ethercat drivers. WIP * Revert some changes to make firm 250 compatible with 7-taxel sensor * 250 firm is now able to request 17-taxel mst for its information * Successfuly updated MST's structure to 12 taxels * Successfuly retrieving information from all 17-taxels (for dummy data - integeres 1-77). Not yet considering how speed of each hand cycle will impact sensor readings * Updating 250 firmware Ethercat Status data order to comply with changes made in hand-firmware * Adding docstring documentation to SR10 drivers related files * Update licensese/documentation on sr10, 240 and 250 ethercat protocol files * Adding Adding MST sensor to the list of tactile sensor controllers * Changing new sensor related messages. * Fixing some SR10 documentation. Starting MST documentation. Fixing sr_robot_lib files licences * Improve Ethercat protocol related files documentation * Document MST and MST publisher files. Fix identation and licences in some other files * Handle new status check on MST sensors * Add changes to handle new sensor status check information * Changes to mst tactile controller/publisher so that each sensor is published individually * Add a check to detect if palm is trying to poll data from the new tactile sensors too soon * Change generic tactiles stream from INFO to DEBUG * Properly evaluate the contents of status check byte sent by the sensor (last 2 char from git_version hex string) * Fix issues with status check flag detection for multiple sensors on the same hand * Add a 'bad frame counter' to sr10 * Copy files from hand-firmware (except license header) * Replacing boost shared_ptr by std share_ptr (supported since C11) and removing other unnecessary boost related imports * Include 'memory' library * Include 'memory' library * Remove 'bad_frame_counter_changes' * Cast IMU polled values to signed int16 * Add Bad frame counter * Addressing reviews. Updating Licenses, and prunning SR10 code (removing frequent dynamic memory allocations, unnecessary data publishing, unnecessary data castings, etc) * Change dynamic allocation of debug data realtime publisher msg structure (reserve to resize) * Delete Frame id from tactiles published messages. * Update git revision to exclude status check-enable byte * Remove unnecessary IMU updates * Update IMU zero catcher --- sr_edc_ethercat_drivers/CMakeLists.txt | 2 +- .../ethercat_device_plugin.xml | 7 +- .../include/sr_edc_ethercat_drivers/sr10.h | 208 +++++++ sr_edc_ethercat_drivers/src/sr10.cpp | 566 ++++++++++++++++++ .../0240_palm_edc_IMU_ethercat_protocol.h | 110 ++-- .../0250_palm_edc_IMU_ethercat_protocol.h | 145 +++++ .../0250_palm_edc_IMU_MST/CPPLINT.cfg | 2 + .../common/common_edc_ethercat_protocol.h | 111 ++-- .../common/ethercat_can_bridge_protocol.h | 65 +- .../common/tactile_edc_ethercat_protocol.h | 91 ++- sr_robot_lib/include/sr_robot_lib/MST.hpp | 98 ++- sr_robot_lib/include/sr_robot_lib/UBI0.hpp | 49 +- .../include/sr_robot_lib/generic_tactiles.hpp | 20 +- .../include/sr_robot_lib/generic_updater.hpp | 22 +- .../sr_robot_lib/motor_data_checker.hpp | 18 +- .../include/sr_robot_lib/motor_updater.hpp | 21 +- .../include/sr_robot_lib/sensor_updater.hpp | 18 +- .../include/sr_robot_lib/sr_robot_lib.hpp | 18 +- sr_robot_lib/src/MST.cpp | 322 +++++++--- sr_robot_lib/src/UBI0.cpp | 22 +- sr_robot_lib/src/biotac.cpp | 22 +- sr_robot_lib/src/generic_tactiles.cpp | 34 +- sr_robot_lib/src/generic_updater.cpp | 24 +- sr_robot_lib/src/motor_updater.cpp | 23 +- sr_robot_lib/src/sensor_updater.cpp | 20 +- sr_robot_lib/src/shadow_PSTs.cpp | 22 +- sr_robot_lib/src/sr_motor_hand_lib.cpp | 23 +- sr_robot_lib/src/sr_motor_robot_lib.cpp | 21 +- sr_robot_lib/src/sr_robot_lib.cpp | 20 +- sr_tactile_sensor_controller/CMakeLists.txt | 1 + .../sr_mst_tactile_sensor_publisher.hpp | 80 +++ .../src/sr_mst_tactile_sensor_publisher.cpp | 85 +++ .../src/sr_tactile_sensor_controller.cpp | 5 + 33 files changed, 1748 insertions(+), 547 deletions(-) create mode 100644 sr_edc_ethercat_drivers/include/sr_edc_ethercat_drivers/sr10.h create mode 100644 sr_edc_ethercat_drivers/src/sr10.cpp create mode 100644 sr_external_dependencies/include/sr_external_dependencies/external/0250_palm_edc_IMU_MST/0250_palm_edc_IMU_ethercat_protocol.h create mode 100644 sr_external_dependencies/include/sr_external_dependencies/external/0250_palm_edc_IMU_MST/CPPLINT.cfg create mode 100644 sr_tactile_sensor_controller/include/sr_tactile_sensor_controller/sr_mst_tactile_sensor_publisher.hpp create mode 100644 sr_tactile_sensor_controller/src/sr_mst_tactile_sensor_publisher.cpp diff --git a/sr_edc_ethercat_drivers/CMakeLists.txt b/sr_edc_ethercat_drivers/CMakeLists.txt index e61e45cc..2de4d466 100644 --- a/sr_edc_ethercat_drivers/CMakeLists.txt +++ b/sr_edc_ethercat_drivers/CMakeLists.txt @@ -42,7 +42,7 @@ catkin_package( ) -add_library(sr_edc_ethercat_drivers src/sr0x.cpp src/sr_edc.cpp src/sr06.cpp src/sr08.cpp src/sr09.cpp src/sr_edc_muscle.cpp src/srbridge.cpp src/motor_trace_buffer.cpp) +add_library(sr_edc_ethercat_drivers src/sr0x.cpp src/sr_edc.cpp src/sr06.cpp src/sr08.cpp src/sr09.cpp src/sr10.cpp src/sr_edc_muscle.cpp src/srbridge.cpp src/motor_trace_buffer.cpp) add_dependencies(sr_edc_ethercat_drivers ${sr_edc_ethercat_drivers_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) target_link_libraries(sr_edc_ethercat_drivers ${BFD_LIBRARY} ${Boost_LIBRARIES} ${catkin_LIBRARIES}) diff --git a/sr_edc_ethercat_drivers/ethercat_device_plugin.xml b/sr_edc_ethercat_drivers/ethercat_device_plugin.xml index 2e1e118f..6a6d046e 100644 --- a/sr_edc_ethercat_drivers/ethercat_device_plugin.xml +++ b/sr_edc_ethercat_drivers/ethercat_device_plugin.xml @@ -1,5 +1,5 @@