From 3e4c3b32ea0cbd2d33dac6c95f14823d821a6d19 Mon Sep 17 00:00:00 2001 From: Darby Lim Date: Tue, 11 Dec 2018 17:39:41 +0900 Subject: [PATCH 1/4] sync opencjr --- .../dynamixel_sdk/port_handler_arduino.cpp | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/c++/src/dynamixel_sdk/port_handler_arduino.cpp b/c++/src/dynamixel_sdk/port_handler_arduino.cpp index 19ad599f..ee3db54b 100644 --- a/c++/src/dynamixel_sdk/port_handler_arduino.cpp +++ b/c++/src/dynamixel_sdk/port_handler_arduino.cpp @@ -27,7 +27,7 @@ #define DYNAMIXEL_SERIAL Serial3 #endif -#define LATENCY_TIMER 16 // msec (USB latency timer) +#define LATENCY_TIMER 4 // msec (USB latency timer) using namespace dynamixel; @@ -93,8 +93,17 @@ void PortHandlerArduino::clearPort() { #if defined(__OPENCR__) DYNAMIXEL_SERIAL.flush(); + // Clear out all data from the input queue. + while (DYNAMIXEL_SERIAL.available()) + { + DYNAMIXEL_SERIAL.read(); + } #elif defined(__OPENCM904__) p_dxl_serial->flush(); + while (p_dxl_serial->available()) + { + p_dxl_serial->read(); + } #endif } @@ -205,7 +214,7 @@ bool PortHandlerArduino::isPacketTimeout() double PortHandlerArduino::getCurrentTime() { - return (double)millis(); + return (double)millis(); } double PortHandlerArduino::getTimeSinceStart() @@ -285,8 +294,15 @@ void PortHandlerArduino::setTxEnable() void PortHandlerArduino::setTxDisable() { #if defined(__OPENCR__) +#ifdef SERIAL_WRITES_NON_BLOCKING + DYNAMIXEL_SERIAL.flush(); // make sure it completes before we disable... +#endif drv_dxl_tx_enable(FALSE); + #elif defined(__OPENCM904__) +#ifdef SERIAL_WRITES_NON_BLOCKING + p_dxl_serial->flush(); +#endif drv_dxl_tx_enable(socket_fd_, FALSE); #endif } From 5014a3afa418df31a2aa73404381885162d28a35 Mon Sep 17 00:00:00 2001 From: Darby Lim Date: Tue, 11 Dec 2018 17:42:22 +0900 Subject: [PATCH 2/4] sync opencm --- c++/src/dynamixel_sdk/port_handler_arduino.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/c++/src/dynamixel_sdk/port_handler_arduino.cpp b/c++/src/dynamixel_sdk/port_handler_arduino.cpp index ee3db54b..07add9ad 100644 --- a/c++/src/dynamixel_sdk/port_handler_arduino.cpp +++ b/c++/src/dynamixel_sdk/port_handler_arduino.cpp @@ -91,18 +91,16 @@ void PortHandlerArduino::closePort() void PortHandlerArduino::clearPort() { + int temp __attribute__((unused)); #if defined(__OPENCR__) - DYNAMIXEL_SERIAL.flush(); - // Clear out all data from the input queue. - while (DYNAMIXEL_SERIAL.available()) + while (DYNAMIXEL_SERIAL.available()) { - DYNAMIXEL_SERIAL.read(); + temp = DYNAMIXEL_SERIAL.read(); } #elif defined(__OPENCM904__) - p_dxl_serial->flush(); - while (p_dxl_serial->available()) + while (p_dxl_serial->available()) { - p_dxl_serial->read(); + temp = p_dxl_serial->read(); } #endif } From 47697e75a61101af590c16770518ce147435e93c Mon Sep 17 00:00:00 2001 From: Darby Lim Date: Mon, 17 Dec 2018 11:25:04 +0900 Subject: [PATCH 3/4] add macro --- c++/include/dynamixel_sdk/packet_handler.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/c++/include/dynamixel_sdk/packet_handler.h b/c++/include/dynamixel_sdk/packet_handler.h index 211068bd..a2efc996 100644 --- a/c++/include/dynamixel_sdk/packet_handler.h +++ b/c++/include/dynamixel_sdk/packet_handler.h @@ -24,6 +24,11 @@ #if defined(ARDUINO) || defined(__OPENCR__) || defined(__OPENCM904__) #include + +#define ERROR_PRINT SerialBT2.print +#else +#define ERROR_PRINT printf + #endif #include From bebda37575104ee715bdf3da92d1d74125e4d932 Mon Sep 17 00:00:00 2001 From: Pyo Date: Thu, 3 Jan 2019 11:29:57 +0900 Subject: [PATCH 4/4] updated the CHANGELOG and version to release binary packages --- ReleaseNote.md | 14 +++++++++--- ros/CHANGELOG.rst | 9 ++++++++ ros/include/dynamixel_sdk/packet_handler.h | 7 +++++- .../dynamixel_sdk/protocol1_packet_handler.h | 2 +- .../dynamixel_sdk/protocol2_packet_handler.h | 2 +- ros/package.xml | 6 +++-- .../dynamixel_sdk/port_handler_arduino.cpp | 22 +++++++++++++++---- .../protocol1_packet_handler.cpp | 2 +- .../protocol2_packet_handler.cpp | 2 +- 9 files changed, 52 insertions(+), 14 deletions(-) mode change 100755 => 100644 ros/include/dynamixel_sdk/packet_handler.h mode change 100755 => 100644 ros/include/dynamixel_sdk/protocol1_packet_handler.h mode change 100755 => 100644 ros/include/dynamixel_sdk/protocol2_packet_handler.h mode change 100755 => 100644 ros/src/dynamixel_sdk/protocol1_packet_handler.cpp diff --git a/ReleaseNote.md b/ReleaseNote.md index c1bb7dfb..62a0faa5 100644 --- a/ReleaseNote.md +++ b/ReleaseNote.md @@ -1,17 +1,25 @@ # Dynamixel SDK Release Notes +3.7.0 (2019-01-03) +------------------ +* added clear instruction [#269](https://github.com/ROBOTIS-GIT/DynamixelSDK/issues/269) +* removed busy waiting for rxPacket() +* fixed addStuffing() function (reduced stack memory usage) +* fixed memory issues [#268](https://github.com/ROBOTIS-GIT/DynamixelSDK/issues/268) +* fixed the broadcast ping bug in dxl_monitor + 3.6.2 (2018-07-17) ------------------ * added python modules for ROS to ros folder * moved cpp library files for ROS to ros folder -* created an ROS package separately `#187 `_ +* created an ROS package separately [#187](https://github.com/ROBOTIS-GIT/DynamixelSDK/issues/187) * modified the e-Manual address to emanual.robotis.com 3.6.1 (2018-06-14) ------------------ -* removed printTxRxResult(), printRxPacketError() `#193 `_ +* removed printTxRxResult(), printRxPacketError() [#193](https://github.com/ROBOTIS-GIT/DynamixelSDK/issues/193) * removed cache files -* merge pull request `#195 `_ +* merge pull request [#195](https://github.com/ROBOTIS-GIT/DynamixelSDK/issues/195) 3.6.0 (2018-03-16) ------------------ diff --git a/ros/CHANGELOG.rst b/ros/CHANGELOG.rst index 829e486d..a7cfc1d4 100644 --- a/ros/CHANGELOG.rst +++ b/ros/CHANGELOG.rst @@ -2,6 +2,15 @@ Changelog for package dynamixel_sdk ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3.7.0 (2019-01-03) +------------------ +* added clear instruction [#269](https://github.com/ROBOTIS-GIT/DynamixelSDK/issues/269) +* removed busy waiting for rxPacket() +* fixed addStuffing() function (reduced stack memory usage) +* fixed memory issues [#268](https://github.com/ROBOTIS-GIT/DynamixelSDK/issues/268) +* fixed the broadcast ping bug in dxl_monitor +* Contributors: Gilbert, Zerom, Darby Lim, Kurt, Pyo + 3.6.2 (2018-07-17) ------------------ * added python modules for ROS to ros folder diff --git a/ros/include/dynamixel_sdk/packet_handler.h b/ros/include/dynamixel_sdk/packet_handler.h old mode 100755 new mode 100644 index b04501c5..a2efc996 --- a/ros/include/dynamixel_sdk/packet_handler.h +++ b/ros/include/dynamixel_sdk/packet_handler.h @@ -24,6 +24,11 @@ #if defined(ARDUINO) || defined(__OPENCR__) || defined(__OPENCM904__) #include + +#define ERROR_PRINT SerialBT2.print +#else +#define ERROR_PRINT printf + #endif #include @@ -587,4 +592,4 @@ class WINDECLSPEC PacketHandler } -#endif /* DYNAMIXEL_SDK_INCLUDE_DYNAMIXEL_SDK_PACKETHANDLER_H_ */ \ No newline at end of file +#endif /* DYNAMIXEL_SDK_INCLUDE_DYNAMIXEL_SDK_PACKETHANDLER_H_ */ diff --git a/ros/include/dynamixel_sdk/protocol1_packet_handler.h b/ros/include/dynamixel_sdk/protocol1_packet_handler.h old mode 100755 new mode 100644 index 2ec3bcb2..54c054dc --- a/ros/include/dynamixel_sdk/protocol1_packet_handler.h +++ b/ros/include/dynamixel_sdk/protocol1_packet_handler.h @@ -534,4 +534,4 @@ class WINDECLSPEC Protocol1PacketHandler : public PacketHandler } -#endif /* DYNAMIXEL_SDK_INCLUDE_DYNAMIXEL_SDK_PROTOCOL1PACKETHANDLER_H_ */ \ No newline at end of file +#endif /* DYNAMIXEL_SDK_INCLUDE_DYNAMIXEL_SDK_PROTOCOL1PACKETHANDLER_H_ */ diff --git a/ros/include/dynamixel_sdk/protocol2_packet_handler.h b/ros/include/dynamixel_sdk/protocol2_packet_handler.h old mode 100755 new mode 100644 index 36e88f1b..d6a2230e --- a/ros/include/dynamixel_sdk/protocol2_packet_handler.h +++ b/ros/include/dynamixel_sdk/protocol2_packet_handler.h @@ -551,4 +551,4 @@ class WINDECLSPEC Protocol2PacketHandler : public PacketHandler } -#endif /* DYNAMIXEL_SDK_INCLUDE_DYNAMIXEL_SDK_PROTOCOL2PACKETHANDLER_H_ */ \ No newline at end of file +#endif /* DYNAMIXEL_SDK_INCLUDE_DYNAMIXEL_SDK_PROTOCOL2PACKETHANDLER_H_ */ diff --git a/ros/package.xml b/ros/package.xml index a24119b7..29fdf4d4 100644 --- a/ros/package.xml +++ b/ros/package.xml @@ -1,15 +1,17 @@ dynamixel_sdk - 3.6.2 + 3.7.0 This package is wrapping version of ROBOTIS Dynamxel SDK for ROS. The ROBOTIS Dynamixel SDK, or SDK, is a software development library that provides Dynamixel control functions for packet communication. The API is designed for Dynamixel actuators and Dynamixel-based platforms. Apache 2.0 - Pyo + Gilbert Zerom + Darby Lim Leon Pyo + Gilbert http://wiki.ros.org/dynamixel_sdk http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/ https://github.com/ROBOTIS-GIT/DynamixelSDK diff --git a/ros/src/dynamixel_sdk/port_handler_arduino.cpp b/ros/src/dynamixel_sdk/port_handler_arduino.cpp index 19ad599f..07add9ad 100644 --- a/ros/src/dynamixel_sdk/port_handler_arduino.cpp +++ b/ros/src/dynamixel_sdk/port_handler_arduino.cpp @@ -27,7 +27,7 @@ #define DYNAMIXEL_SERIAL Serial3 #endif -#define LATENCY_TIMER 16 // msec (USB latency timer) +#define LATENCY_TIMER 4 // msec (USB latency timer) using namespace dynamixel; @@ -91,10 +91,17 @@ void PortHandlerArduino::closePort() void PortHandlerArduino::clearPort() { + int temp __attribute__((unused)); #if defined(__OPENCR__) - DYNAMIXEL_SERIAL.flush(); + while (DYNAMIXEL_SERIAL.available()) + { + temp = DYNAMIXEL_SERIAL.read(); + } #elif defined(__OPENCM904__) - p_dxl_serial->flush(); + while (p_dxl_serial->available()) + { + temp = p_dxl_serial->read(); + } #endif } @@ -205,7 +212,7 @@ bool PortHandlerArduino::isPacketTimeout() double PortHandlerArduino::getCurrentTime() { - return (double)millis(); + return (double)millis(); } double PortHandlerArduino::getTimeSinceStart() @@ -285,8 +292,15 @@ void PortHandlerArduino::setTxEnable() void PortHandlerArduino::setTxDisable() { #if defined(__OPENCR__) +#ifdef SERIAL_WRITES_NON_BLOCKING + DYNAMIXEL_SERIAL.flush(); // make sure it completes before we disable... +#endif drv_dxl_tx_enable(FALSE); + #elif defined(__OPENCM904__) +#ifdef SERIAL_WRITES_NON_BLOCKING + p_dxl_serial->flush(); +#endif drv_dxl_tx_enable(socket_fd_, FALSE); #endif } diff --git a/ros/src/dynamixel_sdk/protocol1_packet_handler.cpp b/ros/src/dynamixel_sdk/protocol1_packet_handler.cpp old mode 100755 new mode 100644 index c3c6639c..25259684 --- a/ros/src/dynamixel_sdk/protocol1_packet_handler.cpp +++ b/ros/src/dynamixel_sdk/protocol1_packet_handler.cpp @@ -725,4 +725,4 @@ int Protocol1PacketHandler::bulkReadTx(PortHandler *port, uint8_t *param, uint16 int Protocol1PacketHandler::bulkWriteTxOnly(PortHandler *port, uint8_t *param, uint16_t param_length) { return COMM_NOT_AVAILABLE; -} \ No newline at end of file +} diff --git a/ros/src/dynamixel_sdk/protocol2_packet_handler.cpp b/ros/src/dynamixel_sdk/protocol2_packet_handler.cpp index 885b7a59..f9a96baa 100755 --- a/ros/src/dynamixel_sdk/protocol2_packet_handler.cpp +++ b/ros/src/dynamixel_sdk/protocol2_packet_handler.cpp @@ -1069,4 +1069,4 @@ int Protocol2PacketHandler::bulkWriteTxOnly(PortHandler *port, uint8_t *param, u free(txpacket); //delete[] txpacket; return result; -} \ No newline at end of file +}