From 2a4cafb04838b3df4bfa4836b7743017cfa0ae55 Mon Sep 17 00:00:00 2001 From: mhubii Date: Fri, 23 Feb 2024 13:35:08 +0000 Subject: [PATCH 1/7] Adding dev-tools ROS development tools in readme #145 --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1ffa6d30..2f416279 100644 --- a/README.md +++ b/README.md @@ -26,15 +26,23 @@ ROS 2 packages for the KUKA LBR, including communication to the real robot via t Full documentation available [here](https://lbr-fri-ros2-stack-doc.readthedocs.io/en/humble/index.html). ## Quick Start -Install [colcon](https://docs.ros.org/en/humble/Tutorials/Colcon-Tutorial.html#install-colcon), [rosdep](https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Install-Binary.html#installing-and-initializing-rosdep) and [vcstool](https://github.com/dirk-thomas/vcstool#how-to-install-vcstool). Build this repository +Install ROS 2 development tools +```shell +sudo apt install ros-dev-tools +``` +Create a workspace and build this stack ```shell mkdir -p lbr-stack/src && cd lbr-stack wget https://raw.githubusercontent.com/lbr-stack/lbr_fri_ros2_stack/humble/lbr_fri_ros2_stack/repos.yaml -P src vcs import src < src/repos.yaml rosdep install --from-paths src --ignore-src -r -y -colcon build --symlink-install +colcon build --symlink-install --no-warn-unused-cli --cmake-args -DFRI_CLIENT_VERSION=1.15 # replace by your FRI version ``` + +> [!NOTE] +> FRI is fetched via CMake and must be available, refer [README](https://github.com/lbr-stack/fri?tab=readme-ov-file#contributing). + Next, launch the simulation via ```shell source install/setup.bash From 98f417ce73f1c3db5518bd967670e8538a54ce4c Mon Sep 17 00:00:00 2001 From: mhubii Date: Fri, 23 Feb 2024 13:40:31 +0000 Subject: [PATCH 2/7] fixed install --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2f416279..1ce491fa 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,11 @@ mkdir -p lbr-stack/src && cd lbr-stack wget https://raw.githubusercontent.com/lbr-stack/lbr_fri_ros2_stack/humble/lbr_fri_ros2_stack/repos.yaml -P src vcs import src < src/repos.yaml rosdep install --from-paths src --ignore-src -r -y -colcon build --symlink-install --no-warn-unused-cli --cmake-args -DFRI_CLIENT_VERSION=1.15 # replace by your FRI version +colcon build --symlink-install --cmake-args -DFRI_CLIENT_VERSION=1.15 --no-warn-unused-cli # replace by your FRI client version ``` > [!NOTE] -> FRI is fetched via CMake and must be available, refer [README](https://github.com/lbr-stack/fri?tab=readme-ov-file#contributing). +> FRI client is fetched via CMake and must be available, refer [README](https://github.com/lbr-stack/fri?tab=readme-ov-file#contributing). Next, launch the simulation via ```shell From 15bce58dab2fce7ac8b29030ce63b0490b3adf41 Mon Sep 17 00:00:00 2001 From: mhubii Date: Fri, 23 Feb 2024 13:43:13 +0000 Subject: [PATCH 3/7] improved doc --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ce491fa..3ffebc46 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Install ROS 2 development tools sudo apt install ros-dev-tools ``` -Create a workspace and build this stack +Create a workspace, clone, and build this stack ```shell mkdir -p lbr-stack/src && cd lbr-stack wget https://raw.githubusercontent.com/lbr-stack/lbr_fri_ros2_stack/humble/lbr_fri_ros2_stack/repos.yaml -P src From 085536f4f5d59f62959f43a00949a38fdbc1b3d0 Mon Sep 17 00:00:00 2001 From: mhubii Date: Fri, 23 Feb 2024 14:21:45 +0000 Subject: [PATCH 4/7] improved readme --- README.md | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 3ffebc46..315d1d7a 100644 --- a/README.md +++ b/README.md @@ -26,32 +26,35 @@ ROS 2 packages for the KUKA LBR, including communication to the real robot via t Full documentation available [here](https://lbr-fri-ros2-stack-doc.readthedocs.io/en/humble/index.html). ## Quick Start -Install ROS 2 development tools -```shell -sudo apt install ros-dev-tools -``` +1. Install ROS 2 development tools + ```shell + sudo apt install ros-dev-tools + ``` -Create a workspace, clone, and build this stack -```shell -mkdir -p lbr-stack/src && cd lbr-stack -wget https://raw.githubusercontent.com/lbr-stack/lbr_fri_ros2_stack/humble/lbr_fri_ros2_stack/repos.yaml -P src -vcs import src < src/repos.yaml -rosdep install --from-paths src --ignore-src -r -y -colcon build --symlink-install --cmake-args -DFRI_CLIENT_VERSION=1.15 --no-warn-unused-cli # replace by your FRI client version -``` +2. Create a workspace, clone, and install dependencies + ```shell + mkdir -p lbr-stack/src && cd lbr-stack + vcs import src --input https://raw.githubusercontent.com/lbr-stack/lbr_fri_ros2_stack/humble/lbr_fri_ros2_stack/repos.yaml + rosdep install --from-paths src --ignore-src -r -y + ``` -> [!NOTE] -> FRI client is fetched via CMake and must be available, refer [README](https://github.com/lbr-stack/fri?tab=readme-ov-file#contributing). +3. Build + ```shell + colcon build --symlink-install --cmake-args -DFRI_CLIENT_VERSION=1.15 --no-warn-unused-cli # replace by your FRI client version + ``` -Next, launch the simulation via -```shell -source install/setup.bash -ros2 launch lbr_bringup bringup.launch.py \ - model:=iiwa7 # [iiwa7, iiwa14, med7, med14] \ - sim:=true # [true, false] \ - rviz:=true # [true, false] \ - moveit:=true # [true, false] -``` + > [!NOTE] + > FRI client is fetched via CMake and must be available, refer [README](https://github.com/lbr-stack/fri?tab=readme-ov-file#contributing). + +4. Launch the simulation via + ```shell + source install/setup.bash + ros2 launch lbr_bringup bringup.launch.py \ + model:=iiwa7 # [iiwa7, iiwa14, med7, med14] \ + sim:=true # [true, false] \ + rviz:=true # [true, false] \ + moveit:=true # [true, false] + ``` Now, run the [demos](https://lbr-fri-ros2-stack-doc.readthedocs.io/en/humble/lbr_fri_ros2_stack/lbr_demos/doc/lbr_demos.html). To get started with the real robot, checkout the [Documentation](https://lbr-fri-ros2-stack-doc.readthedocs.io/en/humble/index.html) above. From 4b3a9a00450fe6d8af947cd8a562297a7228b63d Mon Sep 17 00:00:00 2001 From: mhubii Date: Fri, 23 Feb 2024 14:22:48 +0000 Subject: [PATCH 5/7] fixed note --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 315d1d7a..b4223bfc 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,8 @@ Full documentation available [here](https://lbr-fri-ros2-stack-doc.readthedocs.i colcon build --symlink-install --cmake-args -DFRI_CLIENT_VERSION=1.15 --no-warn-unused-cli # replace by your FRI client version ``` - > [!NOTE] - > FRI client is fetched via CMake and must be available, refer [README](https://github.com/lbr-stack/fri?tab=readme-ov-file#contributing). +> [!NOTE] +> FRI client is fetched via CMake and must be available, refer [README](https://github.com/lbr-stack/fri?tab=readme-ov-file#contributing). 4. Launch the simulation via ```shell From 35be1ff0d188c80c6bee39f10ea4c5fac3c1e851 Mon Sep 17 00:00:00 2001 From: mhubii Date: Fri, 23 Feb 2024 16:36:37 +0000 Subject: [PATCH 6/7] FRI 2.x compilation https://github.com/lbr-stack/lbr_fri_ros2_stack/issues/156 --- .../include/lbr_fri_ros2/async_client.hpp | 1 + .../include/lbr_fri_ros2/command_guard.hpp | 1 + .../lbr_fri_ros2/command_interface.hpp | 2 ++ .../include/lbr_fri_ros2/enum_maps.hpp | 9 ++++++ .../include/lbr_fri_ros2/state_interface.hpp | 1 + lbr_fri_ros2/src/app_component.cpp | 17 +++++++++-- lbr_fri_ros2/src/app_component.hpp | 2 ++ lbr_fri_ros2/src/async_client.cpp | 25 ++++++++++++++-- lbr_fri_ros2/src/command_guard.cpp | 9 ++++++ lbr_fri_ros2/src/command_interface.cpp | 16 +++++++++- lbr_fri_ros2/src/state_interface.cpp | 4 +++ .../lbr_ros2_control/system_interface.hpp | 1 + lbr_ros2_control/src/system_interface.cpp | 30 ++++++++++++++----- 13 files changed, 104 insertions(+), 14 deletions(-) diff --git a/lbr_fri_ros2/include/lbr_fri_ros2/async_client.hpp b/lbr_fri_ros2/include/lbr_fri_ros2/async_client.hpp index 8c3f2bfb..95c2ce73 100644 --- a/lbr_fri_ros2/include/lbr_fri_ros2/async_client.hpp +++ b/lbr_fri_ros2/include/lbr_fri_ros2/async_client.hpp @@ -9,6 +9,7 @@ #include "rclcpp/logging.hpp" #include "friLBRClient.h" +#include "friVersion.h" #include "lbr_fri_ros2/command_interface.hpp" #include "lbr_fri_ros2/enum_maps.hpp" diff --git a/lbr_fri_ros2/include/lbr_fri_ros2/command_guard.hpp b/lbr_fri_ros2/include/lbr_fri_ros2/command_guard.hpp index 7ebc0f2e..6d89fc49 100644 --- a/lbr_fri_ros2/include/lbr_fri_ros2/command_guard.hpp +++ b/lbr_fri_ros2/include/lbr_fri_ros2/command_guard.hpp @@ -11,6 +11,7 @@ #include "friLBRClient.h" #include "friLBRState.h" +#include "friVersion.h" #include "lbr_fri_msgs/msg/lbr_command.hpp" diff --git a/lbr_fri_ros2/include/lbr_fri_ros2/command_interface.hpp b/lbr_fri_ros2/include/lbr_fri_ros2/command_interface.hpp index 22bb47c6..7a02da58 100644 --- a/lbr_fri_ros2/include/lbr_fri_ros2/command_interface.hpp +++ b/lbr_fri_ros2/include/lbr_fri_ros2/command_interface.hpp @@ -10,9 +10,11 @@ #include "rclcpp/logging.hpp" #include "friLBRClient.h" +#include "friVersion.h" #include "lbr_fri_msgs/msg/lbr_command.hpp" #include "lbr_fri_ros2/command_guard.hpp" +#include "lbr_fri_ros2/enum_maps.hpp" #include "lbr_fri_ros2/filters.hpp" namespace lbr_fri_ros2 { diff --git a/lbr_fri_ros2/include/lbr_fri_ros2/enum_maps.hpp b/lbr_fri_ros2/include/lbr_fri_ros2/enum_maps.hpp index f94393e5..c93ca0e1 100644 --- a/lbr_fri_ros2/include/lbr_fri_ros2/enum_maps.hpp +++ b/lbr_fri_ros2/include/lbr_fri_ros2/enum_maps.hpp @@ -4,6 +4,7 @@ #include #include "friLBRClient.h" +#include "friVersion.h" namespace lbr_fri_ros2 { struct EnumMaps { @@ -43,8 +44,16 @@ struct EnumMaps { switch (client_command_mode) { case KUKA::FRI::EClientCommandMode::NO_COMMAND_MODE: return "NO_COMMAND_MODE"; +#if FRICLIENT_VERSION_MAJOR == 1 case KUKA::FRI::EClientCommandMode::POSITION: return "POSITION"; +#endif +#if FRICLIENT_VERSION_MAJOR == 2 + case KUKA::FRI::EClientCommandMode::JOINT_POSITION: + return "JOINT_POSITION"; + case KUKA::FRI::EClientCommandMode::CARTESIAN_POSE: + return "CARTESIAN_POSE"; +#endif case KUKA::FRI::EClientCommandMode::TORQUE: return "TORQUE"; case KUKA::FRI::EClientCommandMode::WRENCH: diff --git a/lbr_fri_ros2/include/lbr_fri_ros2/state_interface.hpp b/lbr_fri_ros2/include/lbr_fri_ros2/state_interface.hpp index f230587f..179d410d 100644 --- a/lbr_fri_ros2/include/lbr_fri_ros2/state_interface.hpp +++ b/lbr_fri_ros2/include/lbr_fri_ros2/state_interface.hpp @@ -7,6 +7,7 @@ #include "rclcpp/logging.hpp" #include "friLBRClient.h" +#include "friVersion.h" #include "lbr_fri_msgs/msg/lbr_state.hpp" #include "lbr_fri_ros2/filters.hpp" diff --git a/lbr_fri_ros2/src/app_component.cpp b/lbr_fri_ros2/src/app_component.cpp index a42bd61c..6ab7a4e2 100644 --- a/lbr_fri_ros2/src/app_component.cpp +++ b/lbr_fri_ros2/src/app_component.cpp @@ -144,7 +144,12 @@ void AppComponent::connect_(const int &port_id, const char *const remote_host, // subscriptions switch (async_client_ptr_->get_state_interface().get_state().client_command_mode) { +#if FRICLIENT_VERSION_MAJOR == 1 case KUKA::FRI::EClientCommandMode::POSITION: +#endif +#if FRICLIENT_VERSION_MAJOR == 2 + case KUKA::FRI::EClientCommandMode::JOINT_POSITION: +#endif position_command_sub_ = app_node_ptr_->create_subscription( "command/joint_position", 1, @@ -169,9 +174,15 @@ void AppComponent::connect_(const int &port_id, const char *const remote_host, void AppComponent::on_position_command_( const lbr_fri_msgs::msg::LBRPositionCommand::SharedPtr lbr_position_command) { - if (!on_command_checks_(KUKA::FRI::EClientCommandMode::POSITION)) { - return; - } +#if FRICLIENT_VERSION_MAJOR == 1 + if (!on_command_checks_(KUKA::FRI::EClientCommandMode::POSITION)) +#endif +#if FRICLIENT_VERSION_MAJOR == 2 + if (!on_command_checks_(KUKA::FRI::EClientCommandMode::JOINT_POSITION)) +#endif + { + return; + } if (async_client_ptr_->get_state_interface().get_state().session_state == KUKA::FRI::ESessionState::COMMANDING_ACTIVE) { diff --git a/lbr_fri_ros2/src/app_component.hpp b/lbr_fri_ros2/src/app_component.hpp index e818ecae..945d9895 100644 --- a/lbr_fri_ros2/src/app_component.hpp +++ b/lbr_fri_ros2/src/app_component.hpp @@ -8,6 +8,8 @@ #include "rclcpp/rclcpp.hpp" #include "urdf/model.h" +#include "friVersion.h" + #include "lbr_fri_msgs/msg/lbr_position_command.hpp" #include "lbr_fri_msgs/msg/lbr_state.hpp" #include "lbr_fri_msgs/msg/lbr_torque_command.hpp" diff --git a/lbr_fri_ros2/src/async_client.cpp b/lbr_fri_ros2/src/async_client.cpp index 923bf6db..8210f458 100644 --- a/lbr_fri_ros2/src/async_client.cpp +++ b/lbr_fri_ros2/src/async_client.cpp @@ -49,20 +49,39 @@ void AsyncClient::command() { } switch (robotState().getClientCommandMode()) { +#if FRICLIENT_VERSION_MAJOR == 1 case KUKA::FRI::EClientCommandMode::POSITION: +#endif +#if FRICLIENT_VERSION_MAJOR == 2 + case KUKA::FRI::EClientCommandMode::JOINT_POSITION: +#endif + { command_interface_.get_joint_position_command(robotCommand(), robotState()); return; - case KUKA::FRI::EClientCommandMode::TORQUE: + } +#if FRICLIENT_VERSION_MAJOR == 2 + case KUKA::FRI::EClientCommandMode::CARTESIAN_POSE: { + std::string err = + EnumMaps::client_command_mode_map(KUKA::FRI::EClientCommandMode::CARTESIAN_POSE) + + " command mode not supported yet."; + RCLCPP_ERROR(rclcpp::get_logger(LOGGER_NAME), err.c_str()); + throw std::runtime_error(err); + } +#endif + case KUKA::FRI::EClientCommandMode::TORQUE: { command_interface_.get_torque_command(robotCommand(), robotState()); return; - case KUKA::FRI::EClientCommandMode::WRENCH: + } + case KUKA::FRI::EClientCommandMode::WRENCH: { command_interface_.get_wrench_command(robotCommand(), robotState()); return; - default: + } + default: { std::string err = "Unsupported command mode: " + std::to_string(robotState().getClientCommandMode()) + "."; RCLCPP_ERROR(rclcpp::get_logger(LOGGER_NAME), err.c_str()); throw std::runtime_error(err); } + } } } // end of namespace lbr_fri_ros2 diff --git a/lbr_fri_ros2/src/command_guard.cpp b/lbr_fri_ros2/src/command_guard.cpp index f663781d..610efb84 100644 --- a/lbr_fri_ros2/src/command_guard.cpp +++ b/lbr_fri_ros2/src/command_guard.cpp @@ -9,7 +9,12 @@ bool CommandGuard::is_valid_command(const_idl_command_t_ref lbr_command, switch (lbr_state.getClientCommandMode()) { case KUKA::FRI::EClientCommandMode::NO_COMMAND_MODE: return false; +#if FRICLIENT_VERSION_MAJOR == 1 case KUKA::FRI::EClientCommandMode::POSITION: +#endif +#if FRICLIENT_VERSION_MAJOR == 2 + case KUKA::FRI::EClientCommandMode::JOINT_POSITION: +#endif if (!command_in_position_limits_(lbr_command, lbr_state)) { return false; } @@ -17,6 +22,10 @@ bool CommandGuard::is_valid_command(const_idl_command_t_ref lbr_command, return false; } return true; +#if FRICLIENT_VERSION_MAJOR == 2 + case KUKA::FRI::EClientCommandMode::CARTESIAN_POSE: + return false; +#endif case KUKA::FRI::EClientCommandMode::WRENCH: if (!command_in_position_limits_(lbr_command, lbr_state)) { return false; diff --git a/lbr_fri_ros2/src/command_interface.cpp b/lbr_fri_ros2/src/command_interface.cpp index 9ff16367..93d4a965 100644 --- a/lbr_fri_ros2/src/command_interface.cpp +++ b/lbr_fri_ros2/src/command_interface.cpp @@ -11,11 +11,25 @@ CommandInterface::CommandInterface(const PIDParameters &pid_parameters, void CommandInterface::get_joint_position_command(fri_command_t_ref command, const_fri_state_t_ref state) { +#if FRICLIENT_VERSION_MAJOR == 1 if (state.getClientCommandMode() != KUKA::FRI::EClientCommandMode::POSITION) { - std::string err = "Set joint position only allowed in position command mode."; + std::string err = "Set joint position only allowed in " + + EnumMaps::client_command_mode_map(KUKA::FRI::EClientCommandMode::POSITION) + + " command mode."; RCLCPP_ERROR(rclcpp::get_logger(LOGGER_NAME), err.c_str()); throw std::runtime_error(err); } +#endif +#if FRICLIENT_VERSION_MAJOR == 2 + if (state.getClientCommandMode() != KUKA::FRI::EClientCommandMode::JOINT_POSITION) { + std::string err = + "Set joint position only allowed in " + + EnumMaps::client_command_mode_map(KUKA::FRI::EClientCommandMode::JOINT_POSITION) + + " command mode."; + RCLCPP_ERROR(rclcpp::get_logger(LOGGER_NAME), err.c_str()); + throw std::runtime_error(err); + } +#endif if (!command_guard_) { std::string err = "Uninitialized command guard."; RCLCPP_ERROR(rclcpp::get_logger(LOGGER_NAME), err.c_str()); diff --git a/lbr_fri_ros2/src/state_interface.cpp b/lbr_fri_ros2/src/state_interface.cpp index 5cf5597b..3a914df7 100644 --- a/lbr_fri_ros2/src/state_interface.cpp +++ b/lbr_fri_ros2/src/state_interface.cpp @@ -6,8 +6,10 @@ StateInterface::StateInterface(const StateInterfaceParameters &state_interface_p void StateInterface::set_state(const_fri_state_t_ref state) { state_.client_command_mode = state.getClientCommandMode(); +#if FRICLIENT_VERSION_MAJOR == 1 std::memcpy(state_.commanded_joint_position.data(), state.getCommandedJointPosition(), sizeof(double) * fri_state_t::NUMBER_OF_JOINTS); +#endif std::memcpy(state_.commanded_torque.data(), state.getCommandedTorque(), sizeof(double) * fri_state_t::NUMBER_OF_JOINTS); state_.connection_quality = state.getConnectionQuality(); @@ -41,8 +43,10 @@ void StateInterface::set_state(const_fri_state_t_ref state) { void StateInterface::set_state_open_loop(const_fri_state_t_ref state, const_idl_joint_pos_t_ref joint_position) { state_.client_command_mode = state.getClientCommandMode(); +#if FRICLIENT_VERSION_MAJOR == 1 std::memcpy(state_.commanded_joint_position.data(), state.getCommandedJointPosition(), sizeof(double) * fri_state_t::NUMBER_OF_JOINTS); +#endif std::memcpy(state_.commanded_torque.data(), state.getCommandedTorque(), sizeof(double) * fri_state_t::NUMBER_OF_JOINTS); state_.connection_quality = state.getConnectionQuality(); diff --git a/lbr_ros2_control/include/lbr_ros2_control/system_interface.hpp b/lbr_ros2_control/include/lbr_ros2_control/system_interface.hpp index e6295b7f..95094745 100644 --- a/lbr_ros2_control/include/lbr_ros2_control/system_interface.hpp +++ b/lbr_ros2_control/include/lbr_ros2_control/system_interface.hpp @@ -16,6 +16,7 @@ #include "rclcpp_lifecycle/state.hpp" #include "friLBRState.h" +#include "friVersion.h" #include "lbr_fri_msgs/msg/lbr_command.hpp" #include "lbr_fri_msgs/msg/lbr_state.hpp" diff --git a/lbr_ros2_control/src/system_interface.cpp b/lbr_ros2_control/src/system_interface.cpp index 4722e417..aac53815 100644 --- a/lbr_ros2_control/src/system_interface.cpp +++ b/lbr_ros2_control/src/system_interface.cpp @@ -272,14 +272,21 @@ hardware_interface::return_type SystemInterface::write(const rclcpp::Time & /*ti if (hw_session_state_ != KUKA::FRI::COMMANDING_ACTIVE) { return hardware_interface::return_type::OK; } - if (hw_client_command_mode_ == KUKA::FRI::EClientCommandMode::POSITION) { - if (std::any_of(hw_lbr_command_.joint_position.cbegin(), hw_lbr_command_.joint_position.cend(), - [](const double &v) { return std::isnan(v); })) { +#if FRICLIENT_VERSION_MAJOR == 1 + if (hw_client_command_mode_ == KUKA::FRI::EClientCommandMode::POSITION) +#endif +#if FRICLIENT_VERSION_MAJOR == 2 + if (hw_client_command_mode_ == KUKA::FRI::EClientCommandMode::JOINT_POSITION) +#endif + { + if (std::any_of(hw_lbr_command_.joint_position.cbegin(), + hw_lbr_command_.joint_position.cend(), + [](const double &v) { return std::isnan(v); })) { + return hardware_interface::return_type::OK; + } + async_client_ptr_->get_command_interface().set_command_target(hw_lbr_command_); return hardware_interface::return_type::OK; } - async_client_ptr_->get_command_interface().set_command_target(hw_lbr_command_); - return hardware_interface::return_type::OK; - } if (hw_client_command_mode_ == KUKA::FRI::EClientCommandMode::TORQUE) { if (std::any_of(hw_lbr_command_.joint_position.cbegin(), hw_lbr_command_.joint_position.cend(), [](const double &v) { return std::isnan(v); }) || @@ -291,8 +298,17 @@ hardware_interface::return_type SystemInterface::write(const rclcpp::Time & /*ti return hardware_interface::return_type::OK; } if (hw_client_command_mode_ == KUKA::FRI::EClientCommandMode::WRENCH) { - throw std::runtime_error("Wrench command mode currently not implemented."); + throw std::runtime_error( + lbr_fri_ros2::EnumMaps::client_command_mode_map(hw_client_command_mode_) + + " command mode currently not implemented."); + } +#if FRICLIENT_VERSION_MAJOR == 2 + if (hw_client_command_mode_ == KUKA::FRI::EClientCommandMode::CARTESIAN_POSE) { + throw std::runtime_error( + lbr_fri_ros2::EnumMaps::client_command_mode_map(hw_client_command_mode_) + + " command mode currently not implemented."); } +#endif return hardware_interface::return_type::ERROR; } From a599e94690f334ee6ef3d487139811ea248d4aec Mon Sep 17 00:00:00 2001 From: mhubii Date: Mon, 26 Feb 2024 16:55:36 +0000 Subject: [PATCH 7/7] udpated readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b4223bfc..0bedda3b 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Full documentation available [here](https://lbr-fri-ros2-stack-doc.readthedocs.i ``` > [!NOTE] -> FRI client is fetched via CMake and must be available, refer [README](https://github.com/lbr-stack/fri?tab=readme-ov-file#contributing). +> FRI client is added as external CMake project via [fri_vendor](https://github.com/lbr-stack/fri_vendor) and must be available as branch, refer [README](https://github.com/lbr-stack/fri?tab=readme-ov-file#contributing). 4. Launch the simulation via ```shell