-
Notifications
You must be signed in to change notification settings - Fork 36
Feature/fri wrench control #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
krmihaly
wants to merge
33
commits into
master
Choose a base branch
from
feature/fri_wrench_control
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
f36d0a2
add forward wrench controller to kuka controllers
krmihaly c2a52c4
add cartesian impedance controller for stifness/damping values
krmihaly 56834f2
add cart imp ctr mode, wrench cmd mode to fri_connection; use wrench …
krmihaly 0644001
seperate joint and cart stiffness and damping, fix s/d values not bei…
krmihaly 65edcb7
wrench control impedance size fix, remove init in controller
krmihaly 5897bd0
refactor impedance values publishing
krmihaly 41d9914
robot application add cartesian impedance control mode
krmihaly ef7c966
format
krmihaly 3023104
Merge commit '41d9914350c3c2a0bb19ca1bde0d412301c85302' into feature/…
krmihaly 78360e5
format java
krmihaly 84db233
typos, parameter set access rights changed, constexpressions added
krmihaly 91fb08b
comment, exec depend
krmihaly e566cdc
wrench control interface joint names change, refactor export control …
krmihaly 5ac53a8
wrench config typo
krmihaly 9aef28d
industrial ci upstream robot description branch to fri wrench control
krmihaly e82711c
branch typo
krmihaly c8ef56e
sorry I stole your branch
ebc181e
Revert "sorry I stole your branch"
360b3fb
send period < 5 ms is not needed in joint impedance mode
krmihaly 0d60f9e
publish impedance config values after controllers start
krmihaly 746efeb
add impedance commands to wrench mode
krmihaly ac33516
fromat
krmihaly a64a563
removed friction compensation
krmihaly be90c17
send period < 5 ms is not needed in joint impedance mode
krmihaly b1a458c
publish impedance config values after controllers start
krmihaly ba2dafb
add impedance commands to wrench mode
krmihaly c6a6dd0
fromat
krmihaly f29d295
removed friction compensation
krmihaly 427deec
Merge commit 'a64a5637468e8b47519f23dd1d940312b2024838' into feature/…
krmihaly bfacd30
update wiki
krmihaly f1753e9
Merge branch 'master' into feature/fri_wrench_control
krmihaly 080dc21
udate wiki
krmihaly 92d3ad5
format
krmihaly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,16 @@ | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| Changelog for package wrench_controller | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| 0.9.2 (2024-07-10) | ||
| ------------------ | ||
| * Fix GCC warning causing unstable build | ||
|
|
||
| 0.9.1 (2024-07-08) | ||
| ------------------ | ||
| * Add missing test dependency | ||
|
|
||
| 0.9.0 (2024-07-08) | ||
| ------------------ | ||
| * Add controller for updating stiffness and damping command interfaces | ||
| * Contributors: Aron Svastits |
This file contains hidden or 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,69 @@ | ||
| cmake_minimum_required(VERSION 3.5) | ||
| project(wrench_controller) | ||
|
|
||
| if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
| add_compile_options(-Wall -Wextra) | ||
| endif() | ||
|
|
||
| find_package(ament_cmake REQUIRED) | ||
| find_package(pluginlib REQUIRED) | ||
| find_package(forward_command_controller) | ||
| find_package(kuka_drivers_core) | ||
| find_package(generate_parameter_library) | ||
|
|
||
| include_directories(include) | ||
|
|
||
| generate_parameter_library( | ||
| wrench_controller_parameters | ||
| src/wrench_controller_parameters.yaml | ||
| ) | ||
|
|
||
| add_library(${PROJECT_NAME} SHARED | ||
| src/wrench_controller.cpp) | ||
|
|
||
| target_include_directories(${PROJECT_NAME} PRIVATE | ||
| include | ||
| ) | ||
|
|
||
| ament_target_dependencies(${PROJECT_NAME} forward_command_controller kuka_drivers_core | ||
| ) | ||
| target_link_libraries(${PROJECT_NAME} wrench_controller_parameters) | ||
|
|
||
| # Causes the visibility macros to use dllexport rather than dllimport, | ||
| # which is appropriate when building the dll but not consuming it. | ||
| target_compile_definitions(${PROJECT_NAME} PRIVATE "WRENCH_CONTROLLER_BUILDING_LIBRARY") | ||
| # prevent pluginlib from using boost | ||
| target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") | ||
|
|
||
| pluginlib_export_plugin_description_file(controller_interface controller_plugins.xml) | ||
|
|
||
| install(TARGETS ${PROJECT_NAME} | ||
| ARCHIVE DESTINATION lib | ||
| LIBRARY DESTINATION lib | ||
| RUNTIME DESTINATION bin | ||
| ) | ||
|
|
||
| install(DIRECTORY include/ | ||
| DESTINATION include | ||
| ) | ||
|
|
||
| install(FILES controller_plugins.xml | ||
| DESTINATION share/${PROJECT_NAME} | ||
| ) | ||
|
|
||
| if(BUILD_TESTING) | ||
|
|
||
| endif() | ||
|
|
||
| ament_export_include_directories(include) | ||
| ament_export_libraries(${PROJECT_NAME}) | ||
|
|
||
| ament_export_include_directories( | ||
| include | ||
| ) | ||
|
|
||
| ament_export_libraries( | ||
| ${PROJECT_NAME} | ||
| ) | ||
|
|
||
| ament_package() |
This file contains hidden or 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,7 @@ | ||
| <library path="wrench_controller"> | ||
| <class name="kuka_controllers/WrenchController" type="kuka_controllers::WrenchController" base_class_type="controller_interface::ControllerInterface"> | ||
| <description> | ||
| This controller forwards the wrench commands in real time | ||
| </description> | ||
| </class> | ||
| </library> |
49 changes: 49 additions & 0 deletions
49
controllers/wrench_controller/include/wrench_controller/visibility_control.h
This file contains hidden or 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,49 @@ | ||
| // Copyright 2023 Aron 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 WRENCH_CONTROLLER__VISIBILITY_CONTROL_H_ | ||
| #define WRENCH_CONTROLLER__VISIBILITY_CONTROL_H_ | ||
|
|
||
| // This logic was borrowed (then namespaced) from the examples on the gcc wiki: | ||
| // https://gcc.gnu.org/wiki/Visibility | ||
|
|
||
| #if defined _WIN32 || defined __CYGWIN__ | ||
| #ifdef __GNUC__ | ||
| #define WRENCH_CONTROLLER_EXPORT __attribute__((dllexport)) | ||
| #define WRENCH_CONTROLLER_IMPORT __attribute__((dllimport)) | ||
| #else | ||
| #define WRENCH_CONTROLLER_EXPORT __declspec(dllexport) | ||
| #define WRENCH_CONTROLLER_IMPORT __declspec(dllimport) | ||
| #endif | ||
| #ifdef WRENCH_CONTROLLER_BUILDING_LIBRARY | ||
| #define WRENCH_CONTROLLER_PUBLIC WRENCH_CONTROLLER_EXPORT | ||
| #else | ||
| #define WRENCH_CONTROLLER_PUBLIC WRENCH_CONTROLLER_IMPORT | ||
| #endif | ||
| #define WRENCH_CONTROLLER_PUBLIC_TYPE WRENCH_CONTROLLER_PUBLIC | ||
| #define WRENCH_CONTROLLER_LOCAL | ||
| #else | ||
| #define WRENCH_CONTROLLER_EXPORT __attribute__((visibility("default"))) | ||
| #define WRENCH_CONTROLLER_IMPORT | ||
| #if __GNUC__ >= 4 | ||
| #define WRENCH_CONTROLLER_PUBLIC __attribute__((visibility("default"))) | ||
| #define WRENCH_CONTROLLER_LOCAL __attribute__((visibility("hidden"))) | ||
| #else | ||
| #define WRENCH_CONTROLLER_PUBLIC | ||
| #define WRENCH_CONTROLLER_LOCAL | ||
| #endif | ||
| #define WRENCH_CONTROLLER_PUBLIC_TYPE | ||
| #endif | ||
|
|
||
| #endif // WRENCH_CONTROLLER__VISIBILITY_CONTROL_H_ | ||
45 changes: 45 additions & 0 deletions
45
controllers/wrench_controller/include/wrench_controller/wrench_controller.hpp
This file contains hidden or 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,45 @@ | ||
| // Copyright 2022 Aron 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 WRENCH_CONTROLLER__WRENCH_CONTROLLER_HPP_ | ||
| #define WRENCH_CONTROLLER__WRENCH_CONTROLLER_HPP_ | ||
|
|
||
| #include <memory> | ||
| #include <string> | ||
| #include <vector> | ||
|
|
||
| #include "forward_command_controller/multi_interface_forward_command_controller.hpp" | ||
|
|
||
| #include "wrench_controller/visibility_control.h" | ||
| #include "wrench_controller_parameters.hpp" | ||
|
|
||
| namespace kuka_controllers | ||
| { | ||
| class WrenchController : public forward_command_controller::ForwardControllersBase | ||
| { | ||
| public: | ||
| WRENCH_CONTROLLER_PUBLIC WrenchController(); | ||
|
|
||
| private: | ||
| WRENCH_CONTROLLER_LOCAL void declare_parameters() override; | ||
| WRENCH_CONTROLLER_LOCAL controller_interface::CallbackReturn read_parameters() override; | ||
|
|
||
| using Params = wrench_controller::Params; | ||
| using ParamListener = wrench_controller::ParamListener; | ||
|
|
||
| std::shared_ptr<ParamListener> param_listener_; | ||
| Params params_; | ||
| }; | ||
| } // namespace kuka_controllers | ||
| #endif // WRENCH_CONTROLLER__WRENCH_CONTROLLER_HPP_ |
This file contains hidden or 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,22 @@ | ||
| <?xml version="1.0"?> | ||
| <?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
| <package format="3"> | ||
| <name>wrench_controller</name> | ||
| <version>0.9.2</version> | ||
| <description>Controller for forwarding wrench commands</description> | ||
|
|
||
| <maintainer email="krmialy42@gmail.com">Mihaly Kristofi</maintainer> | ||
Svastits marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <license>Apache-2.0</license> | ||
|
|
||
| <buildtool_depend>ament_cmake</buildtool_depend> | ||
|
|
||
| <depend>forward_command_controller</depend> | ||
| <depend>pluginlib</depend> | ||
| <depend>kuka_drivers_core</depend> | ||
| <depend>generate_parameter_library</depend> | ||
|
|
||
| <export> | ||
| <build_type>ament_cmake</build_type> | ||
| </export> | ||
| </package> | ||
This file contains hidden or 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,66 @@ | ||
| // Copyright 2022 Aron 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. | ||
|
|
||
| #include "pluginlib/class_list_macros.hpp" | ||
|
|
||
| #include "kuka_drivers_core/hardware_interface_types.hpp" | ||
|
|
||
| #include "wrench_controller/wrench_controller.hpp" | ||
|
|
||
| namespace kuka_controllers | ||
| { | ||
|
|
||
| WrenchController::WrenchController() : ForwardControllersBase() {} | ||
|
|
||
| void WrenchController::declare_parameters() | ||
| { | ||
| param_listener_ = std::make_shared<ParamListener>(get_node()); | ||
| } | ||
|
|
||
| controller_interface::CallbackReturn WrenchController::read_parameters() | ||
| { | ||
| if (!param_listener_) | ||
| { | ||
| RCLCPP_ERROR(get_node()->get_logger(), "Error encountered during init"); | ||
| return controller_interface::CallbackReturn::ERROR; | ||
| } | ||
| params_ = param_listener_->get_params(); | ||
|
|
||
| if (params_.joints.empty()) | ||
| { | ||
| RCLCPP_ERROR(get_node()->get_logger(), "'joints' parameter is empty"); | ||
| return controller_interface::CallbackReturn::ERROR; | ||
| } | ||
|
|
||
| if (params_.interface_names.empty()) | ||
| { | ||
| RCLCPP_ERROR(get_node()->get_logger(), "'interfaces' parameter is empty"); | ||
| return controller_interface::CallbackReturn::ERROR; | ||
| } | ||
|
|
||
| for (const auto & joint : params_.joints) | ||
| { | ||
| for (const auto & interface : params_.interface_names) | ||
| { | ||
| command_interface_types_.push_back(joint + "/" + interface); | ||
| } | ||
| } | ||
|
|
||
| return controller_interface::CallbackReturn::SUCCESS; | ||
| } | ||
|
|
||
| } // namespace kuka_controllers | ||
|
|
||
| PLUGINLIB_EXPORT_CLASS( | ||
| kuka_controllers::WrenchController, controller_interface::ControllerInterface) |
11 changes: 11 additions & 0 deletions
11
controllers/wrench_controller/src/wrench_controller_parameters.yaml
This file contains hidden or 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,11 @@ | ||
| wrench_controller: | ||
| joints: { | ||
| type: string_array, | ||
| default_value: [], | ||
| description: "Name of the joints to control", | ||
| } | ||
| interface_names: { | ||
| type: string_array, | ||
| default_value: [], | ||
| description: "Names of the interfaces to command", | ||
| } |
This file contains hidden or 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 hidden or 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
9 changes: 9 additions & 0 deletions
9
kuka_sunrise_fri_driver/config/cartesian_impedance_controller_config.yaml
This file contains hidden or 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,9 @@ | ||
| cartesian_impedance_controller: | ||
| ros__parameters: | ||
| joints: | ||
| - CartDOF.X | ||
Svastits marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - CartDOF.Y | ||
| - CartDOF.Z | ||
| - CartDOF.A | ||
| - CartDOF.B | ||
| - CartDOF.C | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,9 +1,12 @@ | ||
| robot_manager: | ||
| ros__parameters: | ||
| control_mode: 1 | ||
Svastits marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| control_mode: 8 | ||
| position_controller_name: "joint_trajectory_controller" | ||
| torque_controller_name: "effort_controller" | ||
| wrench_controller_name: "wrench_controller" | ||
| receive_multiplier: 1 | ||
| send_period_ms: 10 | ||
| send_period_ms: 5 | ||
| joint_damping: [0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7] | ||
| joint_stiffness: [100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0] | ||
| cartesian_damping: [0.7, 0.7, 0.7, 0.7, 0.7, 0.7] | ||
| cartesian_stiffness: [2000.0, 2000.0, 2000.0, 200.0, 200.0, 200.0] | ||
This file contains hidden or 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
12 changes: 12 additions & 0 deletions
12
kuka_sunrise_fri_driver/config/wrench_controller_config.yaml
This file contains hidden or 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,12 @@ | ||
| wrench_controller: | ||
| ros__parameters: | ||
| joints: | ||
| - wrench | ||
|
|
||
| interface_names: | ||
| - force/x | ||
| - force/z | ||
| - force/y | ||
| - torque/x | ||
| - torque/y | ||
| - torque/z |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.