Skip to content
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

Feature/fri cart imp control #192

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
f36d0a2
add forward wrench controller to kuka controllers
krmihaly Aug 1, 2024
c2a52c4
add cartesian impedance controller for stifness/damping values
krmihaly Aug 1, 2024
56834f2
add cart imp ctr mode, wrench cmd mode to fri_connection; use wrench …
krmihaly Aug 1, 2024
0644001
seperate joint and cart stiffness and damping, fix s/d values not bei…
krmihaly Aug 2, 2024
65edcb7
wrench control impedance size fix, remove init in controller
krmihaly Aug 6, 2024
5897bd0
refactor impedance values publishing
krmihaly Aug 6, 2024
41d9914
robot application add cartesian impedance control mode
krmihaly Aug 6, 2024
ef7c966
format
krmihaly Aug 6, 2024
3023104
Merge commit '41d9914350c3c2a0bb19ca1bde0d412301c85302' into feature/…
krmihaly Aug 6, 2024
78360e5
format java
krmihaly Aug 6, 2024
84db233
typos, parameter set access rights changed, constexpressions added
krmihaly Aug 7, 2024
91fb08b
comment, exec depend
krmihaly Aug 7, 2024
e566cdc
wrench control interface joint names change, refactor export control …
krmihaly Aug 9, 2024
06a7597
2.5 FRI client sdk
krmihaly Aug 12, 2024
c4a709d
robot application modified to work with fri sdk 2.5
krmihaly Aug 12, 2024
5ac53a8
wrench config typo
krmihaly Aug 26, 2024
9aef28d
industrial ci upstream robot description branch to fri wrench control
krmihaly Aug 26, 2024
e82711c
branch typo
krmihaly Aug 26, 2024
56f6c89
missing file
krmihaly Aug 28, 2024
531a805
add missing files
krmihaly Aug 28, 2024
a21b35a
FRI msg generated with new nanopb, includes fixed
krmihaly Aug 28, 2024
9f4767f
typo
krmihaly Aug 28, 2024
c8ef56e
sorry I stole your branch
Aug 29, 2024
ebc181e
Revert "sorry I stole your branch"
Aug 29, 2024
360b3fb
send period < 5 ms is not needed in joint impedance mode
krmihaly Sep 16, 2024
0d60f9e
publish impedance config values after controllers start
krmihaly Sep 19, 2024
746efeb
add impedance commands to wrench mode
krmihaly Sep 20, 2024
ac33516
fromat
krmihaly Sep 20, 2024
a64a563
removed friction compensation
krmihaly Sep 20, 2024
be90c17
send period < 5 ms is not needed in joint impedance mode
krmihaly Sep 16, 2024
b1a458c
publish impedance config values after controllers start
krmihaly Sep 19, 2024
ba2dafb
add impedance commands to wrench mode
krmihaly Sep 20, 2024
c6a6dd0
fromat
krmihaly Sep 20, 2024
f29d295
removed friction compensation
krmihaly Sep 20, 2024
427deec
Merge commit 'a64a5637468e8b47519f23dd1d940312b2024838' into feature/…
krmihaly Sep 20, 2024
8cda01f
Merge remote-tracking branch 'origin/feature/fri_2.x_support' into fe…
krmihaly Sep 20, 2024
dca6179
add cartesian pose control to hwif, rob manager and launch file
krmihaly Sep 25, 2024
dc1bf8d
add feed forward cart pose controller
krmihaly Sep 25, 2024
c75439f
typo
krmihaly Sep 25, 2024
c200b46
remove debug code
krmihaly Oct 9, 2024
6ad65f6
fix hw command size
krmihaly Oct 9, 2024
c5eeb08
fix fri control mode to position control
krmihaly Oct 14, 2024
bfacd30
update wiki
krmihaly Oct 14, 2024
f1753e9
Merge branch 'master' into feature/fri_wrench_control
krmihaly Oct 14, 2024
080dc21
udate wiki
krmihaly Oct 14, 2024
5e099f0
add cart pose mode to robot application
krmihaly Oct 14, 2024
f72f42e
Merge branch 'feature/fri_wrench_control' into feature/fri_cart_pose_…
krmihaly Oct 14, 2024
419c591
update wiki
krmihaly Oct 15, 2024
f26cf0c
add cart imp mode to hwif and manager node
krmihaly Oct 15, 2024
f8cf452
fix quaternion vector to match FRI standard
krmihaly Oct 15, 2024
c483722
Merge remote-tracking branch 'origin/feature/fri_cart_pose_control' i…
krmihaly Oct 17, 2024
b0c10ea
format
krmihaly Oct 17, 2024
7c71b59
add both versions of FRI sdk, configurable in cmake
krmihaly Oct 17, 2024
cae6ee2
wiki, format
krmihaly Oct 22, 2024
996d796
FRI version fix
krmihaly Oct 24, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/industrial_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
BUILDER: colcon
ANALYZER: sonarqube
TEST_COVERAGE: true
UPSTREAM_WORKSPACE: 'github:kroshu/kuka_robot_descriptions#master github:kroshu/kuka-external-control-sdk#master'
UPSTREAM_WORKSPACE: 'github:kroshu/kuka_robot_descriptions#feature/fri_wrench_control github:kroshu/kuka-external-control-sdk#master'
ROS_DISTRO: jazzy
CCACHE_DIR: /github/home/.ccache # Directory for ccache (and how we enable ccache in industrial_ci)
EVENT_NAME: ${{ github.event_name }}
Expand Down
8 changes: 8 additions & 0 deletions controllers/cart_pose_controller/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package cart_pose_controller
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.9.0 (2024-09-23)
------------------
* Add controller for controlling cartesian pose
* Contributors: Mihaly Kristofi
69 changes: 69 additions & 0 deletions controllers/cart_pose_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
cmake_minimum_required(VERSION 3.5)
project(cart_pose_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(
cart_pose_controller_parameters
src/cart_pose_controller_parameters.yaml
)

add_library(${PROJECT_NAME} SHARED
src/cart_pose_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} cart_pose_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 "CART_POSE_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()
7 changes: 7 additions & 0 deletions controllers/cart_pose_controller/controller_plugins.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<library path="cart_pose_controller">
<class name="kuka_controllers/CartPoseController" type="kuka_controllers::CartPoseController" base_class_type="controller_interface::ControllerInterface">
<description>
This controller forwards the cartesian pose commands in real time
</description>
</class>
</library>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright 2024 Mihaly Kristofi
//
// 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 CART_POSE_CONTROLLER__CART_POSE_CONTROLLER_HPP_
#define CART_POSE_CONTROLLER__CART_POSE_CONTROLLER_HPP_

#include <memory>
#include <string>
#include <vector>

#include "forward_command_controller/multi_interface_forward_command_controller.hpp"

#include "cart_pose_controller/visibility_control.h"
#include "cart_pose_controller_parameters.hpp"

namespace kuka_controllers
{
class CartPoseController : public forward_command_controller::ForwardControllersBase
{
public:
CART_POSE_CONTROLLER_PUBLIC CartPoseController();
CART_POSE_CONTROLLER_PUBLIC controller_interface::return_type update(
const rclcpp::Time & /*time*/, const rclcpp::Duration & /*period*/) override;
CART_POSE_CONTROLLER_PUBLIC controller_interface::InterfaceConfiguration
command_interface_configuration() const override;

private:
CART_POSE_CONTROLLER_LOCAL void declare_parameters() override;
CART_POSE_CONTROLLER_LOCAL controller_interface::CallbackReturn read_parameters() override;
using Params = cart_pose_controller::Params;
using ParamListener = cart_pose_controller::ParamListener;

std::shared_ptr<ParamListener> param_listener_;
Params params_;
};
} // namespace kuka_controllers
#endif // CART_POSE_CONTROLLER__CART_POSE_CONTROLLER_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright 2024 Mihaly Kristofi
//
// 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 CART_POSE_CONTROLLER__VISIBILITY_CONTROL_H_
#define CART_POSE_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 CART_POSE_CONTROLLER_EXPORT __attribute__((dllexport))
#define CART_POSE_CONTROLLER_IMPORT __attribute__((dllimport))
#else
#define CART_POSE_CONTROLLER_EXPORT __declspec(dllexport)
#define CART_POSE_CONTROLLER_IMPORT __declspec(dllimport)
#endif
#ifdef CART_POSE_CONTROLLER_BUILDING_LIBRARY
#define CART_POSE_CONTROLLER_PUBLIC CART_POSE_CONTROLLER_EXPORT
#else
#define CART_POSE_CONTROLLER_PUBLIC CART_POSE_CONTROLLER_IMPORT
#endif
#define CART_POSE_CONTROLLER_PUBLIC_TYPE CART_POSE_CONTROLLER_PUBLIC
#define CART_POSE_CONTROLLER_LOCAL
#else
#define CART_POSE_CONTROLLER_EXPORT __attribute__((visibility("default")))
#define CART_POSE_CONTROLLER_IMPORT
#if __GNUC__ >= 4
#define CART_POSE_CONTROLLER_PUBLIC __attribute__((visibility("default")))
#define CART_POSE_CONTROLLER_LOCAL __attribute__((visibility("hidden")))
#else
#define CART_POSE_CONTROLLER_PUBLIC
#define CART_POSE_CONTROLLER_LOCAL
#endif
#define CART_POSE_CONTROLLER_PUBLIC_TYPE
#endif

#endif // CART_POSE_CONTROLLER__VISIBILITY_CONTROL_H_
22 changes: 22 additions & 0 deletions controllers/cart_pose_controller/package.xml
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>cart_pose_controller</name>
<version>0.9.2</version>
<description>Controller for forwarding cartesian pose commands</description>

<maintainer email="[email protected]">Mihaly Kristofi</maintainer>

<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>
105 changes: 105 additions & 0 deletions controllers/cart_pose_controller/src/cart_pose_controller.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// Copyright 2024 Mihaly Kristofi
//
// 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 "cart_pose_controller/cart_pose_controller.hpp"

namespace kuka_controllers
{

CartPoseController::CartPoseController() : ForwardControllersBase() {}

void CartPoseController::declare_parameters()
{
param_listener_ = std::make_shared<ParamListener>(get_node());
}

controller_interface::CallbackReturn CartPoseController::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_.emplace_back(joint + "/" + interface);
}
}

return controller_interface::CallbackReturn::SUCCESS;
}

controller_interface::InterfaceConfiguration CartPoseController::command_interface_configuration()
const
{
controller_interface::InterfaceConfiguration command_interfaces_config;
command_interfaces_config.type = controller_interface::interface_configuration_type::INDIVIDUAL;
command_interfaces_config.names = command_interface_types_;
return command_interfaces_config;
}

controller_interface::return_type CartPoseController::update(
const rclcpp::Time & /*time*/, const rclcpp::Duration & /*period*/)
{
auto joint_commands = rt_command_ptr_.readFromRT();

// no command received yet
if (!joint_commands || !(*joint_commands))
{
return controller_interface::return_type::OK;
}

if ((*joint_commands)->data.size() != command_interfaces_.size())
{
RCLCPP_ERROR_THROTTLE(
get_node()->get_logger(), *(get_node()->get_clock()), 1000,
"command size (%zu) does not match number of interfaces (%zu)",
(*joint_commands)->data.size(), command_interfaces_.size());
return controller_interface::return_type::ERROR;
}

for (auto index = 0ul; index < command_interfaces_.size(); index++)
{
// RCLCPP_ERROR(get_node()->get_logger(), "cart joints %i: %f ",index,
// (*joint_commands)->data[index]);
command_interfaces_.at(index).set_value((*joint_commands)->data[index]);
}

return controller_interface::return_type::OK;
}

} // namespace kuka_controllers

PLUGINLIB_EXPORT_CLASS(
kuka_controllers::CartPoseController, controller_interface::ControllerInterface)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cart_pose_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",
}
2 changes: 2 additions & 0 deletions controllers/kuka_controllers/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<exec_depend>fri_configuration_controller</exec_depend>
<exec_depend>fri_state_broadcaster</exec_depend>
<exec_depend>joint_group_impedance_controller</exec_depend>
<exec_depend>wrench_controller</exec_depend>
<exec_depend>cart_pose_controller</exec_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
16 changes: 16 additions & 0 deletions controllers/wrench_controller/CHANGELOG.rst
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
Loading
Loading