Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class GazeboSystem : public GazeboSystemInterface
{
public:
// Documentation Inherited
hardware_interface::return_type configure(const hardware_interface::HardwareInfo & system_info)
CallbackReturn on_init(const hardware_interface::HardwareInfo & system_info)
override;

// Documentation Inherited
Expand All @@ -48,10 +48,10 @@ class GazeboSystem : public GazeboSystemInterface
std::vector<hardware_interface::CommandInterface> export_command_interfaces() override;

// Documentation Inherited
hardware_interface::return_type start() override;
CallbackReturn on_activate(const rclcpp_lifecycle::State & previous_state) override;

// Documentation Inherited
hardware_interface::return_type stop() override;
CallbackReturn on_deactivate(const rclcpp_lifecycle::State & previous_state) override;

// Documentation Inherited
hardware_interface::return_type read() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
#include "gazebo/physics/Model.hh"
#include "gazebo/physics/physics.hh"

#include "hardware_interface/base_interface.hpp"
#include "hardware_interface/system_interface.hpp"
#include "hardware_interface/types/hardware_interface_type_values.hpp"

#include "rclcpp/rclcpp.hpp"

Expand Down Expand Up @@ -60,7 +58,7 @@ class SafeEnum

// SystemInterface provides API-level access to read and command joint properties.
class GazeboSystemInterface
: public hardware_interface::BaseInterface<hardware_interface::SystemInterface>
: public hardware_interface::SystemInterface
{
public:
/// \brief Initilize the system interface
Expand Down
23 changes: 12 additions & 11 deletions gazebo_ros2_control/src/gazebo_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include "gazebo/sensors/ImuSensor.hh"
#include "gazebo/sensors/ForceTorqueSensor.hh"
#include "gazebo/sensors/SensorManager.hh"

#include "hardware_interface/types/hardware_interface_type_values.hpp"

class gazebo_ros2_control::GazeboSystemPrivate
{
public:
Expand Down Expand Up @@ -346,13 +349,13 @@ void GazeboSystem::registerSensors(
}
}

hardware_interface::return_type
GazeboSystem::configure(const hardware_interface::HardwareInfo & actuator_info)
CallbackReturn
GazeboSystem::on_init(const hardware_interface::HardwareInfo & actuator_info)
{
if (configure_default(actuator_info) != hardware_interface::return_type::OK) {
return hardware_interface::return_type::ERROR;
if (hardware_interface::SystemInterface::on_init(actuator_info) != CallbackReturn::SUCCESS) {
return CallbackReturn::ERROR;
}
return hardware_interface::return_type::OK;
return CallbackReturn::SUCCESS;
}

std::vector<hardware_interface::StateInterface>
Expand All @@ -367,16 +370,14 @@ GazeboSystem::export_command_interfaces()
return std::move(this->dataPtr->command_interfaces_);
}

hardware_interface::return_type GazeboSystem::start()
CallbackReturn GazeboSystem::on_activate(const rclcpp_lifecycle::State & previous_state)
{
status_ = hardware_interface::status::STARTED;
return hardware_interface::return_type::OK;
return CallbackReturn::SUCCESS;
}

hardware_interface::return_type GazeboSystem::stop()
CallbackReturn GazeboSystem::on_deactivate(const rclcpp_lifecycle::State & previous_state)
{
status_ = hardware_interface::status::STOPPED;
return hardware_interface::return_type::OK;
return CallbackReturn::SUCCESS;
}

hardware_interface::return_type GazeboSystem::read()
Expand Down