Skip to content

Commit

Permalink
Merge branch 'master' into feature/upgrade_ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Svastits authored Dec 19, 2023
2 parents 9758f16 + 9048622 commit dbacb47
Show file tree
Hide file tree
Showing 70 changed files with 1,011 additions and 828 deletions.
8 changes: 4 additions & 4 deletions examples/iiqka_moveit_example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ find_package(kuka_driver_interfaces REQUIRED)

include_directories(include)

add_executable(moveit_basic_planners_example src/MoveitBasicPlannersExample.cpp)
add_executable(moveit_basic_planners_example src/moveit_basic_planners_example.cpp)
ament_target_dependencies(moveit_basic_planners_example
moveit_ros_planning_interface
rclcpp
Expand All @@ -31,7 +31,7 @@ ament_target_dependencies(moveit_basic_planners_example
kuka_driver_interfaces
)

add_executable(moveit_collision_avoidance_example src/MoveitCollisionAvoidanceExample.cpp)
add_executable(moveit_collision_avoidance_example src/moveit_collision_avoidance_example.cpp)
ament_target_dependencies(moveit_collision_avoidance_example
moveit_ros_planning_interface
rclcpp
Expand All @@ -40,7 +40,7 @@ ament_target_dependencies(moveit_collision_avoidance_example
kuka_driver_interfaces
)

add_executable(moveit_constrained_planning_example src/MoveitConstrainedPlanningExample.cpp)
add_executable(moveit_constrained_planning_example src/moveit_constrained_planning_example.cpp)
ament_target_dependencies(moveit_constrained_planning_example
moveit_ros_planning_interface
rclcpp
Expand All @@ -49,7 +49,7 @@ ament_target_dependencies(moveit_constrained_planning_example
kuka_driver_interfaces
)

add_executable(moveit_depalletizing_example src/MoveitDepalletizingExample.cpp)
add_executable(moveit_depalletizing_example src/moveit_depalletizing_example.cpp)
ament_target_dependencies(moveit_depalletizing_example
moveit_ros_planning_interface
rclcpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/publisher_joint_impedance_controller:
ros__parameters:

controller_name: "joint_impedance_controller"
controller_name: "joint_group_impedance_controller"

stiffness_goals: [30, 0, 30, 30, 30, 30]
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
28 changes: 28 additions & 0 deletions kuka_driver_interfaces/msg/FRIState.msg
Original file line number Diff line number Diff line change
@@ -1,11 +1,39 @@
# Message describing the state of the robot and FRI

# FRI session state enum
# IDLE = 0, MONITORING_WAIT = 1, MONITORING_READY = 2,COMMANDING_WAIT = 3, COMMANDING_ACTIVE = 4
int32 session_state

# FRI connection quality
# POOR = 0, FAIR = 1, GOOD = 2, EXCELLENT = 3
int32 connection_quality

# Safety state
# NORMAL_OPERATION = 0, SAFETY_STOP_LEVEL_0 = 1, SAFETY_STOP_LEVEL_1 = 2, SAFETY_STOP_LEVEL_2 = 3
int32 safety_state

# Client command mode
# NO_COMMAND_MODE = 0, POSITION = 1, WRENCH = 2, TORQUE = 3
int32 command_mode

# Control mode of the robot
# POSITION_CONTROL_MODE = 0, CART_IMP_CONTROL_MODE = 1, JOINT_IMP_CONTROL_MODE = 2, NO_CONTROL = 3
int32 control_mode

# Operation mode
# TEST_MODE_1 = 0, TEST_MODE_2 = 1, AUTOMATIC_MODE = 2
int32 operation_mode

# Drive state
# OFF = 0, TRANSITIONING = 1, ACTIVE = 2
int32 drive_state

# Overlay overlay_type
# NO_OVERLAY = 0, JOINT = 1, CARTESIAN = 2
int32 overlay_type

# Tracking performance of the robot
# Indicates how well the commanded robot is able to follow the commands of the FRI client.
# The best possible value is 1.0, when the robot executes the given commands instantaneously.
# The tracking performance is always 0 when the session state is not COMMANDING_ACTIVE.
float64 tracking_performance
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
8 changes: 4 additions & 4 deletions kuka_drivers_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ find_package(lifecycle_msgs REQUIRED)
find_package(controller_manager REQUIRED)

add_library(kuka_drivers_core SHARED
src/ROS2BaseNode.cpp
src/ROS2BaseLCNode.cpp
src/ParameterHandler.cpp
src/ControllerHandler.cpp
src/ros2_base_node.cpp
src/ros2_base_lc_node.cpp
src/parameter_handler.cpp
src/controller_handler.cpp
)
ament_target_dependencies(kuka_drivers_core rclcpp rclcpp_lifecycle lifecycle_msgs)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright 2020 Á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 COMMUNICATION_HELPERS__ROS2_CONTROL_TOOLS_HPP_
#define COMMUNICATION_HELPERS__ROS2_CONTROL_TOOLS_HPP_

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

#include "rclcpp/rclcpp.hpp"
#include "controller_manager_msgs/srv/set_hardware_component_state.hpp"
#include "controller_manager_msgs/srv/switch_controller.hpp"
#include "communication_helpers/service_tools.hpp"

namespace kuka_drivers_core
{

bool changeHardwareState(
rclcpp::Client<controller_manager_msgs::srv::SetHardwareComponentState>::SharedPtr client,
const std::string & hardware_name, uint8_t state, int timeout_ms = 2000)
{
auto hw_request =
std::make_shared<controller_manager_msgs::srv::SetHardwareComponentState::Request>();
hw_request->name = hardware_name;
hw_request->target_state.id = state;
auto hw_response = sendRequest<controller_manager_msgs::srv::SetHardwareComponentState::Response>(
client, hw_request, 0, timeout_ms);
if (!hw_response || !hw_response->ok) {
return false;
}
return true;
}

bool changeControllerState(
rclcpp::Client<controller_manager_msgs::srv::SwitchController>::SharedPtr client,
const std::vector<std::string> & activate_controllers,
const std::vector<std::string> & deactivate_controllers,
int32_t strictness = controller_manager_msgs::srv::SwitchController::Request::STRICT)
{
auto controller_request =
std::make_shared<controller_manager_msgs::srv::SwitchController::Request>();
controller_request->strictness = strictness;
controller_request->activate_controllers = activate_controllers;
controller_request->deactivate_controllers = deactivate_controllers;

auto controller_response = sendRequest<controller_manager_msgs::srv::SwitchController::Response>(
client, controller_request, 0, 2000);
if (!controller_response || !controller_response->ok) {
return false;
}
return true;
}
} // namespace kuka_drivers_core

#endif // COMMUNICATION_HELPERS__ROS2_CONTROL_TOOLS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// limitations under the License.


#ifndef KUKA_DRIVERS_CORE__CONTROLMODE_HPP_
#define KUKA_DRIVERS_CORE__CONTROLMODE_HPP_
#ifndef KUKA_DRIVERS_CORE__CONTROL_MODE_HPP_
#define KUKA_DRIVERS_CORE__CONTROL_MODE_HPP_

namespace kuka_drivers_core
{
Expand Down Expand Up @@ -51,4 +51,4 @@ enum class ControllerType : std::uint8_t
};
} // namespace kuka_drivers_core

#endif // KUKA_DRIVERS_CORE__CONTROLMODE_HPP_
#endif // KUKA_DRIVERS_CORE__CONTROL_MODE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef KUKA_DRIVERS_CORE__CONTROLLERHANDLER_HPP_
#define KUKA_DRIVERS_CORE__CONTROLLERHANDLER_HPP_
#ifndef KUKA_DRIVERS_CORE__CONTROLLER_HANDLER_HPP_
#define KUKA_DRIVERS_CORE__CONTROLLER_HANDLER_HPP_

#include <string>
#include <vector>
Expand All @@ -22,7 +22,7 @@
#include <set>

#include "rclcpp/rclcpp.hpp"
#include "ControlMode.hpp"
#include "control_mode.hpp"

namespace kuka_drivers_core
{
Expand Down Expand Up @@ -128,4 +128,4 @@ class ControllerHandler
} // namespace kuka_drivers_core


#endif // KUKA_DRIVERS_CORE__CONTROLLERHANDLER_HPP_
#endif // KUKA_DRIVERS_CORE__CONTROLLER_HANDLER_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// 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
//
// 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_INTERFACE_TYPES_HPP_
#define KUKA_DRIVERS_CORE__HARDWARE_INTERFACE_TYPES_HPP_

namespace hardware_interface
{
/* Custom interfaces */
// Constant defining stiffness interface
static constexpr char HW_IF_STIFFNESS[] = "stiffness";
// Constant defining damping interface
static constexpr char HW_IF_DAMPING[] = "damping";
// Constant defining external torque interface
static constexpr char HW_IF_EXTERNAL_TORQUE[] = "external_torque";

/* Interface prefixes */
// Constant defining prefix for I/O interfaces
static constexpr char IO_PREFIX[] = "gpio";
// Constant defining prefix for interfaces of "configuration controllers"
static constexpr char CONFIG_PREFIX[] = "runtime_config";
// Constant defining prefix for fri state
static constexpr char FRI_STATE_PREFIX[] = "fri_state";

/* Configuration interfaces */
// Constant defining control_mode configuration interface
static constexpr char CONTROL_MODE[] = "control_mode";
// Constant defining the receive multiplier interface needed for FRI
static constexpr char RECEIVE_MULTIPLIER[] = "receive_multiplier";

/* FRI state interfaces */
static constexpr char SESSION_STATE[] = "session_state";
static constexpr char CONNECTION_QUALITY[] = "connection_quality";
static constexpr char SAFETY_STATE[] = "safety_state";
static constexpr char COMMAND_MODE[] = "command_mode";
static constexpr char OPERATION_MODE[] = "operation_mode";
static constexpr char DRIVE_STATE[] = "drive_state";
static constexpr char OVERLAY_TYPE[] = "overlay_type";
static constexpr char TRACKING_PERFORMANCE[] = "tracking_performance";


} // namespace hardware_interface

#endif // KUKA_DRIVERS_CORE__HARDWARE_INTERFACE_TYPES_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef KUKA_DRIVERS_CORE__PARAMETERHANDLER_HPP_
#define KUKA_DRIVERS_CORE__PARAMETERHANDLER_HPP_
#ifndef KUKA_DRIVERS_CORE__PARAMETER_HANDLER_HPP_
#define KUKA_DRIVERS_CORE__PARAMETER_HANDLER_HPP_

#include <functional>
#include <memory>
Expand Down Expand Up @@ -180,4 +180,4 @@ class ParameterHandler
} // namespace kuka_drivers_core


#endif // KUKA_DRIVERS_CORE__PARAMETERHANDLER_HPP_
#endif // KUKA_DRIVERS_CORE__PARAMETER_HANDLER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef KUKA_DRIVERS_CORE__ROS2BASELCNODE_HPP_
#define KUKA_DRIVERS_CORE__ROS2BASELCNODE_HPP_
#ifndef KUKA_DRIVERS_CORE__ROS2_BASE_LC_NODE_HPP_
#define KUKA_DRIVERS_CORE__ROS2_BASE_LC_NODE_HPP_

#include <string>
#include <map>
Expand All @@ -23,7 +23,7 @@
#include "rclcpp_lifecycle/lifecycle_node.hpp"
#include "lifecycle_msgs/msg/state.hpp"

#include "kuka_drivers_core/ParameterHandler.hpp"
#include "kuka_drivers_core/parameter_handler.hpp"

namespace kuka_drivers_core
{
Expand Down Expand Up @@ -90,4 +90,4 @@ class ROS2BaseLCNode : public rclcpp_lifecycle::LifecycleNode
} // namespace kuka_drivers_core


#endif // KUKA_DRIVERS_CORE__ROS2BASELCNODE_HPP_
#endif // KUKA_DRIVERS_CORE__ROS2_BASE_LC_NODE_HPP_
Loading

0 comments on commit dbacb47

Please sign in to comment.