Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ros-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: CI
# Specifies the events that trigger the workflow
on:
push:
branches: [ humble, jazzy, main]
branches: [ jazzy, main ]
pull_request:
branches: [ humble, jazzy, main]
branches: [ jazzy, main ]

# Defines a set of jobs to be run as part of the workflow
jobs:
Expand All @@ -17,14 +17,14 @@ jobs:
fail-fast: false
matrix:
ros_distribution:
- humble
# - humble
- jazzy
- rolling
include:
# ROS 2 Humble Hawksbill
- docker_image: ubuntu:jammy
ros_distribution: humble
ros_version: 2
# - docker_image: ubuntu:jammy
# ros_distribution: humble
# ros_version: 2
# ROS 2 Jazzy Jalisco
- docker_image: ubuntu:noble
ros_distribution: jazzy
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog for package dynamixel_hardware_interface
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1.5.1 (2025-12-10)
------------------
* Fixed deprecated interface for ros2 control
* Contributors: Woojin Wie

1.5.0 (2025-11-26)
------------------
* Added comm_id/id concept for virtual_* devices.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ class DynamixelHardware : public

/**
* @brief Initialization callback for hardware interface.
* @param info Hardware information for the system.
* @param params Parameters for the hardware component interface.
* @return Callback return indicating success or error.
*/
DYNAMIXEL_HARDWARE_INTERFACE_PUBLIC
hardware_interface::CallbackReturn on_init(const hardware_interface::HardwareInfo & info)
override;
hardware_interface::CallbackReturn on_init(
const hardware_interface::HardwareComponentInterfaceParams & params) override;

/**
* @brief Exports state interfaces for ROS2.
Expand Down Expand Up @@ -315,6 +315,7 @@ class DynamixelHardware : public
using StatePublisher = realtime_tools::RealtimePublisher<DynamixelStateMsg>;
rclcpp::Publisher<DynamixelStateMsg>::SharedPtr dxl_state_pub_;
std::unique_ptr<StatePublisher> dxl_state_pub_uni_ptr_;
DynamixelStateMsg dxl_state_msg_;

rclcpp::Service<dynamixel_interfaces::srv::GetDataFromDxl>::SharedPtr get_dxl_data_srv_;
void get_dxl_data_srv_callback(
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>dynamixel_hardware_interface</name>
<version>1.5.0</version>
<version>1.5.1</version>
<description>
ROS 2 package providing a hardware interface for controlling Dynamixel motors via the ROS 2 control framework.
</description>
Expand Down
26 changes: 12 additions & 14 deletions src/dynamixel_hardware_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ DynamixelHardware::~DynamixelHardware()
}

hardware_interface::CallbackReturn DynamixelHardware::on_init(
const hardware_interface::HardwareInfo & info)
const hardware_interface::HardwareComponentInterfaceParams & params)
Comment thread
Woojin-Crive marked this conversation as resolved.
{
if (hardware_interface::SystemInterface::on_init(info) !=
if (hardware_interface::SystemInterface::on_init(params) !=
hardware_interface::CallbackReturn::SUCCESS)
{
RCLCPP_ERROR_STREAM(logger_, "Failed to initialize DynamixelHardware");
Expand Down Expand Up @@ -359,11 +359,9 @@ hardware_interface::CallbackReturn DynamixelHardware::on_init(
dxl_state_pub_uni_ptr_ = std::make_unique<StatePublisher>(dxl_state_pub_);

size_t num_of_pub_data = hdl_trans_states_.size();
dxl_state_pub_uni_ptr_->lock();
dxl_state_pub_uni_ptr_->msg_.id.resize(num_of_pub_data);
dxl_state_pub_uni_ptr_->msg_.dxl_hw_state.resize(num_of_pub_data);
dxl_state_pub_uni_ptr_->msg_.torque_state.resize(num_of_pub_data);
dxl_state_pub_uni_ptr_->unlock();
dxl_state_msg_.id.resize(num_of_pub_data);
dxl_state_msg_.dxl_hw_state.resize(num_of_pub_data);
dxl_state_msg_.torque_state.resize(num_of_pub_data);

using namespace std::placeholders;

Expand Down Expand Up @@ -647,18 +645,18 @@ hardware_interface::return_type DynamixelHardware::read(
dxl_comm_->ReadItemBuf();

size_t index = 0;
if (dxl_state_pub_uni_ptr_ && dxl_state_pub_uni_ptr_->trylock()) {
dxl_state_pub_uni_ptr_->msg_.header.stamp = this->now();
dxl_state_pub_uni_ptr_->msg_.comm_state = dxl_comm_err_;
if (dxl_state_pub_uni_ptr_) {
dxl_state_msg_.header.stamp = this->now();
dxl_state_msg_.comm_state = dxl_comm_err_;
for (auto it : hdl_trans_states_) {
dxl_state_pub_uni_ptr_->msg_.id.at(index) = it.id;
dxl_state_pub_uni_ptr_->msg_.dxl_hw_state.at(index) = dxl_hw_err_[it.id];
dxl_state_msg_.id.at(index) = it.id;
dxl_state_msg_.dxl_hw_state.at(index) = dxl_hw_err_[it.id];
auto ts_it = dxl_torque_state_.find({it.comm_id, it.id});
bool ts = (ts_it != dxl_torque_state_.end()) ? ts_it->second : false;
dxl_state_pub_uni_ptr_->msg_.torque_state.at(index) = ts;
dxl_state_msg_.torque_state.at(index) = ts;
index++;
}
dxl_state_pub_uni_ptr_->unlockAndPublish();
dxl_state_pub_uni_ptr_->try_publish(dxl_state_msg_);
}

if (rclcpp::ok()) {
Expand Down
Loading