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

Fix hwif names #115

Merged
merged 10 commits into from
Dec 12, 2023
Merged
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 @@ -7,9 +7,9 @@
damping_goals: [0.7, 0.0, 0.7, 0.7, 0.7, 0.7]

joints:
- joint_a1
- joint_a2
- joint_a3
- joint_a4
- joint_a5
- joint_a6
- joint_1
- joint_2
- joint_3
- joint_4
- joint_5
- joint_6
12 changes: 6 additions & 6 deletions examples/iiqka_moveit_example/config/dummy_publisher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
positions: [-0.2, -1.57, -0.2, -0.2, -0.2, -0.2]

joints:
- joint_a1
- joint_a2
- joint_a3
- joint_a4
- joint_a5
- joint_a6
- joint_1
- joint_2
- joint_3
- joint_4
- joint_5
- joint_6

check_starting_point: false
12 changes: 6 additions & 6 deletions examples/iiqka_moveit_example/config/moveit_controllers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ moveit_simple_controller_manager:
type: FollowJointTrajectory
default: true
joints:
- joint_a1
- joint_a2
- joint_a3
- joint_a4
- joint_a5
- joint_a6
- joint_1
- joint_2
- joint_3
- joint_4
- joint_5
- joint_6

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def launch_setup(context, *args, **kwargs):
)

rviz_config_file = get_package_share_directory(
'kuka_lbr_iisy_moveit_config') + "/config/urdf_planning_scene.rviz"
'kuka_resources') + "/config/view_6_axis_urdf.rviz"

startup_launch = IncludeLaunchDescription(PythonLaunchDescriptionSource(
[get_package_share_directory('kuka_iiqka_eac_driver'), '/launch/startup.launch.py']),
Expand Down
1 change: 1 addition & 0 deletions kuka_drivers/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<exec_depend>kuka_kss_rsi_driver</exec_depend>
<exec_depend>kuka_sunrise_fri_driver</exec_depend>
<exec_depend>iiqka_moveit_example</exec_depend>
<exec_depend>kuka_rsi_simulator</exec_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
13 changes: 9 additions & 4 deletions kuka_iiqka_eac_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,16 @@ else()
remove_definitions(-DNON_MOCK_SETUP)
endif()

add_library(kuka_iiqka_eac_driver SHARED
add_library(${PROJECT_NAME} SHARED
src/hardware_interface.cpp
)
ament_target_dependencies(kuka_iiqka_eac_driver rclcpp sensor_msgs hardware_interface)
target_link_libraries(kuka_iiqka_eac_driver motion-external-proto-api-nanopb motion-services-ecs-proto-api-cpp

# 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 "KUKA_IIQKA_EAC_DRIVER_BUILDING_LIBRARY")

ament_target_dependencies(${PROJECT_NAME} rclcpp sensor_msgs hardware_interface)
target_link_libraries(${PROJECT_NAME} motion-external-proto-api-nanopb motion-services-ecs-proto-api-cpp
motion-services-ecs-proto-api-nanopb yaml-cpp kuka::os-core-udp-communication kuka::nanopb-helpers)


Expand All @@ -86,7 +91,7 @@ target_link_libraries(robot_manager_node kuka_drivers_core::communication_helper

pluginlib_export_plugin_description_file(hardware_interface hardware_interface.xml)

install(TARGETS kuka_iiqka_eac_driver robot_manager_node
install(TARGETS ${PROJECT_NAME} robot_manager_node
DESTINATION lib/${PROJECT_NAME})

install(DIRECTORY config launch
Expand Down
24 changes: 12 additions & 12 deletions kuka_iiqka_eac_driver/config/effort_controller_config.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
effort_controller:
ros__parameters:
joints:
- joint_a1
- joint_a2
- joint_a3
- joint_a4
- joint_a5
- joint_a6
- joint_1
- joint_2
- joint_3
- joint_4
- joint_5
- joint_6
gains:
joint_a1:
joint_1:
p: 5.0
i: 0.0
d: 0.1
joint_a2:
joint_2:
p: 5.0
i: 0.0
d: 0.1
joint_a3:
joint_3:
p: 5.0
i: 0.0
d: 0.1
joint_a4:
joint_4:
p: 5.0
i: 0.0
d: 0.1
joint_a5:
joint_5:
p: 5.0
i: 0.0
d: 0.1
joint_a6:
joint_6:
p: 5.0
i: 0.0
d: 0.1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
joint_impedance_controller:
ros__parameters:
joints:
- joint_a1
- joint_a2
- joint_a3
- joint_a4
- joint_a5
- joint_a6
- joint_1
- joint_2
- joint_3
- joint_4
- joint_5
- joint_6
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
joint_trajectory_controller:
ros__parameters:
joints:
- joint_a1
- joint_a2
- joint_a3
- joint_a4
- joint_a5
- joint_a6
- joint_1
- joint_2
- joint_3
- joint_4
- joint_5
- joint_6

command_interfaces:
- position
Expand Down
2 changes: 1 addition & 1 deletion kuka_iiqka_eac_driver/hardware_interface.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<library path="kuka_iiqka_eac_driver">
<class type="kuka_rox::KukaRoXHardwareInterface"
<class type="kuka_eac::KukaEACHardwareInterface"
base_class_type="hardware_interface::SystemInterface">
<description>ROS2 control Kuka driver for RoX</description>
</class>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,47 @@
#include "nanopb/kuka/ecs/v1/motion_state_external.pb.hh"
#include "os-core-udp-communication/replier.h"

#include "kuka_iiqka_eac_driver/visibility_control.h"

using hardware_interface::return_type;
using CallbackReturn = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn;

namespace kuka_rox
namespace kuka_eac
{

class KukaRoXHardwareInterface : public hardware_interface::SystemInterface
class KukaEACHardwareInterface : public hardware_interface::SystemInterface
{
public:
RCLCPP_SHARED_PTR_DEFINITIONS(KukaRoXHardwareInterface)
RCLCPP_SHARED_PTR_DEFINITIONS(KukaEACHardwareInterface)

CallbackReturn on_init(const hardware_interface::HardwareInfo & info) override;
KUKA_IIQKA_EAC_DRIVER_PUBLIC CallbackReturn on_init(const hardware_interface::HardwareInfo & info)
override;

std::vector<hardware_interface::StateInterface> export_state_interfaces() override;
KUKA_IIQKA_EAC_DRIVER_PUBLIC std::vector<hardware_interface::StateInterface>
export_state_interfaces() override;

std::vector<hardware_interface::CommandInterface> export_command_interfaces() override;
KUKA_IIQKA_EAC_DRIVER_PUBLIC std::vector<hardware_interface::CommandInterface>
export_command_interfaces() override;

CallbackReturn on_configure(const rclcpp_lifecycle::State & previous_state) override;
KUKA_IIQKA_EAC_DRIVER_PUBLIC CallbackReturn on_configure(
const rclcpp_lifecycle::State & previous_state) override;

CallbackReturn on_activate(const rclcpp_lifecycle::State & previous_state) override;
KUKA_IIQKA_EAC_DRIVER_PUBLIC CallbackReturn on_activate(
const rclcpp_lifecycle::State & previous_state) override;

CallbackReturn on_deactivate(const rclcpp_lifecycle::State & previous_state) override;
KUKA_IIQKA_EAC_DRIVER_PUBLIC CallbackReturn on_deactivate(
const rclcpp_lifecycle::State & previous_state) override;

return_type read(const rclcpp::Time & time, const rclcpp::Duration & period) override;
KUKA_IIQKA_EAC_DRIVER_PUBLIC return_type read(
const rclcpp::Time & time,
const rclcpp::Duration & period) override;

return_type write(const rclcpp::Time & time, const rclcpp::Duration & period) override;
KUKA_IIQKA_EAC_DRIVER_PUBLIC return_type write(
const rclcpp::Time & time,
const rclcpp::Duration & period) override;

private:
void ObserveControl();
KUKA_IIQKA_EAC_DRIVER_LOCAL void ObserveControl();

bool is_active_ = false;
bool msg_received_ = false;
Expand Down Expand Up @@ -108,6 +120,6 @@ class KukaRoXHardwareInterface : public hardware_interface::SystemInterface
static constexpr char HW_IF_DAMPING[] = "damping";
static constexpr char CONTROL_MODE[] = "control_mode";
};
} // namespace kuka_rox
} // namespace kuka_eac

#endif // KUKA_IIQKA_EAC_DRIVER__HARDWARE_INTERFACE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#include "kuka/ecs/v1/motion_services_ecs.grpc.pb.h"

namespace kuka_rox
namespace kuka_eac
{
class RobotManagerNode : public kuka_drivers_core::ROS2BaseLCNode
{
Expand Down Expand Up @@ -94,7 +94,7 @@ class RobotManagerNode : public kuka_drivers_core::ROS2BaseLCNode
static constexpr int IMPEDANCE_MODE_IF_SIZE = 2;
};

} // namespace kuka_rox
} // namespace kuka_eac


#endif // KUKA_IIQKA_EAC_DRIVER__ROBOT_MANAGER_NODE_HPP_
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
// Copyright 2017 Open Source Robotics Foundation, Inc.
// Copyright 2023 Á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
// 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
// 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.

/* This header must be included by all rclcpp headers which declare symbols
* which are defined in the rclcpp library. When not building the rclcpp
* library, i.e. when using the headers in other package's code, the contents
* of this header change the visibility of certain symbols which the rclcpp
* library cannot have, but the consuming code must have inorder to link.
*/
// 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__VISIBILITY_CONTROL_H_
#define KUKA_IIQKA_EAC_DRIVER__VISIBILITY_CONTROL_H_
Expand All @@ -33,7 +26,7 @@
#define KUKA_IIQKA_EAC_DRIVER_EXPORT __declspec(dllexport)
#define KUKA_IIQKA_EAC_DRIVER_IMPORT __declspec(dllimport)
#endif
#ifdef KUKA_IIQKA_EAC_DRIVER_BUILDING_DLL
#ifdef KUKA_IIQKA_EAC_DRIVER_BUILDING_LIBRARY
#define KUKA_IIQKA_EAC_DRIVER_PUBLIC KUKA_IIQKA_EAC_DRIVER_EXPORT
#else
#define KUKA_IIQKA_EAC_DRIVER_PUBLIC KUKA_IIQKA_EAC_DRIVER_IMPORT
Expand All @@ -50,7 +43,7 @@
#define KUKA_IIQKA_EAC_DRIVER_PUBLIC
#define KUKA_IIQKA_EAC_DRIVER_LOCAL
#endif
#define KUKA_IIQKA_EAC_DRIVER__VISIBILITY_CONTROL_H_
#define KUKA_IIQKA_EAC_DRIVER_PUBLIC_TYPE
#endif

#endif // KUKA_IIQKA_EAC_DRIVER__VISIBILITY_CONTROL_H_
2 changes: 2 additions & 0 deletions kuka_iiqka_eac_driver/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<depend>libgrpc</depend>

<exec_depend>kuka_lbr_iisy_support</exec_depend>
<exec_depend>ros2_control</exec_depend>
<exec_depend>ros2_controllers</exec_depend>

<test_depend>ament_cmake_copyright</test_depend>
<test_depend>ament_cmake_cppcheck</test_depend>
Expand Down
Loading
Loading