-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate kuka-external-control-sdk (#144)
* use client lib in hwif-without control mode switch * add control mode change * add event subscriber to manager * change type * format * add enums * hack for LD_LIBRARY_PATH * fake hw in activation test * set server event * recv timeout * clean up * fix control mode changes * log fix * log * rollback launch * modify access rights * format * recv timeout * prev_control_mode type * fix build * mutex * cleanup * package xml update + ci * sudo mkdir * fix * git * pipe fix * sudo * home * fix dir * update name * fix dir structure * fix dir * update env * fix deactivate * find_lib * fix build * debug * try without path * Revert "try without path" This reverts commit a80ab26. * fix multiple deact * cleanup * fix controller configuration * update build instructions * fix * remove unnecessary copy * fix switch * package xml * install deps * format * try pre-build script * remove sdk dep * fix upstream * sudo * clean up control mode handling * fix before_build * try path fix * before init * install deps * fix install path * protobuf dep * fix dep * fix condition * target include * fix hack * remove activation test * spell * fix tests with new config * extend ld_lib_path * fix * syntax * try extend again * fix hack * fix hack * debug * debug2 * Update industrial_ci.yml * Remove after init * debug * fix env * cleanup * better driver init * extend doc with torque difference * remove mock from doc * cleanup * fix log * spell * typo --------- Co-authored-by: Szitanics Márk <szitanics@gmail.com> Co-authored-by: Aron Svastits <svastits1@gmail.com> Co-authored-by: Gergely Kovacs <gergely.kovacs4@kuka.com>
- Loading branch information
1 parent
7ec32c8
commit 7506c7c
Showing
55 changed files
with
475 additions
and
4,039 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
kuka_drivers_core/include/kuka_drivers_core/hardware_event.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2024 Áron Svastits | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef KUKA_DRIVERS_CORE__HARDWARE_EVENT_HPP_ | ||
#define KUKA_DRIVERS_CORE__HARDWARE_EVENT_HPP_ | ||
|
||
namespace kuka_drivers_core | ||
{ | ||
/** | ||
* @brief Enum for controller-side events | ||
*/ | ||
enum class HardwareEvent : std::uint8_t | ||
{ | ||
HARDWARE_EVENT_UNSPECIFIED = 0, | ||
COMMAND_ACCEPTED = 2, | ||
CONTROL_STARTED = 3, | ||
CONTROL_STOPPED = 4, | ||
CONTROL_MODE_SWITCH = 5, | ||
ERROR = 6 | ||
}; | ||
|
||
} // namespace kuka_drivers_core | ||
|
||
#endif // KUKA_DRIVERS_CORE__HARDWARE_EVENT_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
kuka_iiqka_eac_driver/include/kuka_iiqka_eac_driver/event_observer.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Copyright 2024 Márk Szitanics | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef KUKA_IIQKA_EAC_DRIVER__EVENT_OBSERVER_HPP_ | ||
#define KUKA_IIQKA_EAC_DRIVER__EVENT_OBSERVER_HPP_ | ||
|
||
#include <string> | ||
#include "rclcpp/macros.hpp" | ||
|
||
#include "kuka/external-control-sdk/common/irobot.h" | ||
#include "kuka_drivers_core/hardware_event.hpp" | ||
#include "kuka_iiqka_eac_driver/hardware_interface.hpp" | ||
|
||
namespace kuka_eac | ||
{ | ||
class KukaEACEventObserver : public kuka::external::control::EventHandler | ||
{ | ||
public: | ||
explicit KukaEACEventObserver(KukaEACHardwareInterface * hw_interface) | ||
: hw_interface_(hw_interface) | ||
{ | ||
} | ||
void OnSampling() override | ||
{ | ||
hw_interface_->set_server_event(kuka_drivers_core::HardwareEvent::CONTROL_STARTED); | ||
RCLCPP_INFO(rclcpp::get_logger("KukaEACHardwareInterface"), "External control is active"); | ||
} | ||
void OnControlModeSwitch(const std::string &) override | ||
{ | ||
hw_interface_->set_server_event(kuka_drivers_core::HardwareEvent::CONTROL_MODE_SWITCH); | ||
RCLCPP_INFO( | ||
rclcpp::get_logger("KukaEACHardwareInterface"), "Control mode switch is in progress"); | ||
hw_interface_->reset_cycle_count(); | ||
} | ||
void OnStopped(const std::string &) override | ||
{ | ||
hw_interface_->set_server_event(kuka_drivers_core::HardwareEvent::CONTROL_STOPPED); | ||
RCLCPP_INFO(rclcpp::get_logger("KukaEACHardwareInterface"), "External control finished"); | ||
hw_interface_->set_stop_flag(); | ||
} | ||
void OnError(const std::string & reason) override | ||
{ | ||
hw_interface_->set_server_event(kuka_drivers_core::HardwareEvent::ERROR); | ||
RCLCPP_ERROR( | ||
rclcpp::get_logger("KukaEACHardwareInterface"), "External control stopped by an error"); | ||
RCLCPP_ERROR(rclcpp::get_logger("KukaEACHardwareInterface"), reason.c_str()); | ||
hw_interface_->set_stop_flag(); | ||
} | ||
|
||
private: | ||
KukaEACHardwareInterface * hw_interface_; | ||
}; | ||
|
||
} // namespace kuka_eac | ||
|
||
#endif // KUKA_IIQKA_EAC_DRIVER__EVENT_OBSERVER_HPP_ |
Oops, something went wrong.