Skip to content

Commit d3fdcd0

Browse files
authored
Merge pull request #100 from ROBOTIS-GIT/main
Bump 1.5.1
2 parents 31b7fbb + db2b903 commit d3fdcd0

File tree

5 files changed

+28
-24
lines changed

5 files changed

+28
-24
lines changed

.github/workflows/ros-ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: CI
44
# Specifies the events that trigger the workflow
55
on:
66
push:
7-
branches: [ humble, jazzy, main]
7+
branches: [ jazzy, main ]
88
pull_request:
9-
branches: [ humble, jazzy, main]
9+
branches: [ jazzy, main ]
1010

1111
# Defines a set of jobs to be run as part of the workflow
1212
jobs:
@@ -17,14 +17,14 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
ros_distribution:
20-
- humble
20+
# - humble
2121
- jazzy
2222
- rolling
2323
include:
2424
# ROS 2 Humble Hawksbill
25-
- docker_image: ubuntu:jammy
26-
ros_distribution: humble
27-
ros_version: 2
25+
# - docker_image: ubuntu:jammy
26+
# ros_distribution: humble
27+
# ros_version: 2
2828
# ROS 2 Jazzy Jalisco
2929
- docker_image: ubuntu:noble
3030
ros_distribution: jazzy

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Changelog for package dynamixel_hardware_interface
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5+
1.5.1 (2025-12-10)
6+
------------------
7+
* Fixed deprecated interface for ros2 control
8+
* Contributors: Woojin Wie
9+
510
1.5.0 (2025-11-26)
611
------------------
712
* Added comm_id/id concept for virtual_* devices.

include/dynamixel_hardware_interface/dynamixel_hardware_interface.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ class DynamixelHardware : public
113113

114114
/**
115115
* @brief Initialization callback for hardware interface.
116-
* @param info Hardware information for the system.
116+
* @param params Parameters for the hardware component interface.
117117
* @return Callback return indicating success or error.
118118
*/
119119
DYNAMIXEL_HARDWARE_INTERFACE_PUBLIC
120-
hardware_interface::CallbackReturn on_init(const hardware_interface::HardwareInfo & info)
121-
override;
120+
hardware_interface::CallbackReturn on_init(
121+
const hardware_interface::HardwareComponentInterfaceParams & params) override;
122122

123123
/**
124124
* @brief Exports state interfaces for ROS2.
@@ -315,6 +315,7 @@ class DynamixelHardware : public
315315
using StatePublisher = realtime_tools::RealtimePublisher<DynamixelStateMsg>;
316316
rclcpp::Publisher<DynamixelStateMsg>::SharedPtr dxl_state_pub_;
317317
std::unique_ptr<StatePublisher> dxl_state_pub_uni_ptr_;
318+
DynamixelStateMsg dxl_state_msg_;
318319

319320
rclcpp::Service<dynamixel_interfaces::srv::GetDataFromDxl>::SharedPtr get_dxl_data_srv_;
320321
void get_dxl_data_srv_callback(

package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
44
<name>dynamixel_hardware_interface</name>
5-
<version>1.5.0</version>
5+
<version>1.5.1</version>
66
<description>
77
ROS 2 package providing a hardware interface for controlling Dynamixel motors via the ROS 2 control framework.
88
</description>

src/dynamixel_hardware_interface.cpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ DynamixelHardware::~DynamixelHardware()
5656
}
5757

5858
hardware_interface::CallbackReturn DynamixelHardware::on_init(
59-
const hardware_interface::HardwareInfo & info)
59+
const hardware_interface::HardwareComponentInterfaceParams & params)
6060
{
61-
if (hardware_interface::SystemInterface::on_init(info) !=
61+
if (hardware_interface::SystemInterface::on_init(params) !=
6262
hardware_interface::CallbackReturn::SUCCESS)
6363
{
6464
RCLCPP_ERROR_STREAM(logger_, "Failed to initialize DynamixelHardware");
@@ -359,11 +359,9 @@ hardware_interface::CallbackReturn DynamixelHardware::on_init(
359359
dxl_state_pub_uni_ptr_ = std::make_unique<StatePublisher>(dxl_state_pub_);
360360

361361
size_t num_of_pub_data = hdl_trans_states_.size();
362-
dxl_state_pub_uni_ptr_->lock();
363-
dxl_state_pub_uni_ptr_->msg_.id.resize(num_of_pub_data);
364-
dxl_state_pub_uni_ptr_->msg_.dxl_hw_state.resize(num_of_pub_data);
365-
dxl_state_pub_uni_ptr_->msg_.torque_state.resize(num_of_pub_data);
366-
dxl_state_pub_uni_ptr_->unlock();
362+
dxl_state_msg_.id.resize(num_of_pub_data);
363+
dxl_state_msg_.dxl_hw_state.resize(num_of_pub_data);
364+
dxl_state_msg_.torque_state.resize(num_of_pub_data);
367365

368366
using namespace std::placeholders;
369367

@@ -647,18 +645,18 @@ hardware_interface::return_type DynamixelHardware::read(
647645
dxl_comm_->ReadItemBuf();
648646

649647
size_t index = 0;
650-
if (dxl_state_pub_uni_ptr_ && dxl_state_pub_uni_ptr_->trylock()) {
651-
dxl_state_pub_uni_ptr_->msg_.header.stamp = this->now();
652-
dxl_state_pub_uni_ptr_->msg_.comm_state = dxl_comm_err_;
648+
if (dxl_state_pub_uni_ptr_) {
649+
dxl_state_msg_.header.stamp = this->now();
650+
dxl_state_msg_.comm_state = dxl_comm_err_;
653651
for (auto it : hdl_trans_states_) {
654-
dxl_state_pub_uni_ptr_->msg_.id.at(index) = it.id;
655-
dxl_state_pub_uni_ptr_->msg_.dxl_hw_state.at(index) = dxl_hw_err_[it.id];
652+
dxl_state_msg_.id.at(index) = it.id;
653+
dxl_state_msg_.dxl_hw_state.at(index) = dxl_hw_err_[it.id];
656654
auto ts_it = dxl_torque_state_.find({it.comm_id, it.id});
657655
bool ts = (ts_it != dxl_torque_state_.end()) ? ts_it->second : false;
658-
dxl_state_pub_uni_ptr_->msg_.torque_state.at(index) = ts;
656+
dxl_state_msg_.torque_state.at(index) = ts;
659657
index++;
660658
}
661-
dxl_state_pub_uni_ptr_->unlockAndPublish();
659+
dxl_state_pub_uni_ptr_->try_publish(dxl_state_msg_);
662660
}
663661

664662
if (rclcpp::ok()) {

0 commit comments

Comments
 (0)