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

Kuka fts to test #2

Open
wants to merge 71 commits into
base: indigo-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
b0d19ec
First draft of readme
Oct 18, 2016
f7ed9e2
Drop first package recieved from robot
Oct 18, 2016
7260206
Tested and working
Oct 18, 2016
d222b33
RSI 2.3: First frame is empty <rob> frame, drop it
Oct 19, 2016
51a33eb
Set individual axis limits
Oct 19, 2016
4096a85
Removed external axes from XML file
Oct 20, 2016
387118e
Fixed info about RSI.XML package
ivareri Oct 21, 2016
6ea1cac
Added support for kr5
destogl Mar 21, 2017
222c8c8
Added KR5 Podest
destogl Mar 24, 2017
ee6ee14
Corrected xacro node warning
destogl May 9, 2017
99844a8
Added support for kr5
destogl Mar 21, 2017
d288aa9
Added KR5 Podest
destogl Mar 24, 2017
52887be
Corrected xacro node warning
destogl May 9, 2017
3b9bc03
Removed dependecy to schunk_description
destogl May 9, 2017
fa8e42f
Merge branch 'kuka-kr5-support' into iirob_dev
destogl May 9, 2017
2758117
Partitial changes as disscussed... the rest follows
destogl May 11, 2017
4028b74
Podest remove and file restructured. Removed test folder since whole …
destogl May 15, 2017
c2db3e5
KUKA_DEG2RAD replaced with radians function see #79
destogl May 15, 2017
84c4405
Lunch file testing simplified
destogl May 16, 2017
7abe2cd
Merge branch 'kuka-kr5-support' into iirob_dev
destogl May 16, 2017
dffecae
Merge branch 'kuka_kr16_corrections' into iirob_dev
destogl May 16, 2017
b809f14
Reverted test changes
destogl May 16, 2017
cb885a1
Fixed accoring to comments
destogl May 16, 2017
b89543a
Merge branch 'kuka-kr5-support' into iirob_dev
destogl May 16, 2017
fba1914
Added support for kr5
destogl Mar 21, 2017
cc626da
Updated xacro wiki URL
destogl May 17, 2017
f064213
Reduced collision meshes
destogl Jun 14, 2017
6d6a9c7
Removed shift in two axes on joint A4 and tool0 according to kuka manual
destogl Jun 14, 2017
762815f
kr5arc: change collision mesh units to meters.
gavanderhoorn Jun 14, 2017
d37c44a
Merge branch 'indigo-devel' of https://github.com/ros-industrial/kuka…
destogl Jun 16, 2017
537983a
Merge branch 'kuka-kr5-support' into iirob_dev
destogl Jun 16, 2017
8c26117
Added calculation of joint velocities.
hartmanndennis Aug 10, 2017
b593d8e
Merge branch 'indigo-devel' into iirob_dev
hartmanndennis Aug 10, 2017
b96c463
Merge branch 'velocity_calc' into iirob_dev
hartmanndennis Aug 11, 2017
a918c84
First draft of readme
Oct 18, 2016
67d8eb9
Drop first package recieved from robot
Oct 18, 2016
5fc3212
Tested and working
Oct 18, 2016
36f50ae
RSI 2.3: First frame is empty <rob> frame, drop it
Oct 19, 2016
c248774
Set individual axis limits
Oct 19, 2016
1caa45a
Removed external axes from XML file
Oct 20, 2016
c5abd91
Fixed info about RSI.XML package
ivareri Oct 21, 2016
6e342b4
IP_NUMBER set to invalid address
Aug 29, 2017
8230b2a
Added license info
Aug 29, 2017
91e14b4
Set start position to match the KR C4 version
Aug 29, 2017
643ab81
Moved files for KR C4 to it's own sub dir
Aug 29, 2017
2e1fe4d
Fixed comments for IP_NUMBER and PORT
Aug 30, 2017
c3cea0c
Added note regarding HMI. Better description for IP_NUMBER setting
Aug 30, 2017
275d9e6
Merge remote-tracking branch 'remote/pr/74' into iirob_dev
hartmanndennis Sep 7, 2017
a6a6839
Increased publish rate and added goal time constraint.
hartmanndennis Sep 7, 2017
a85eaa4
Added support for KR150-2
hartmanndennis Dec 13, 2017
334d33d
Merge branch 'kr150_support' into iirob_dev
hartmanndennis Dec 13, 2017
6574bac
Merge branch 'indigo-devel' into iirob_dev
hartmanndennis Jan 9, 2018
7a47043
Merge branch 'indigo-devel' into iirob_dev
hartmanndennis Mar 14, 2018
5195243
rsi_hw_interface: set holdon to 1 to prevent late packets from crashi…
hartmanndennis Mar 14, 2018
1b8062c
Publish as fast as possible
hartmanndennis Mar 21, 2018
11d8bd9
Merge branch 'rsi_set_holdon_1' into iirob_dev
hartmanndennis Mar 21, 2018
1821df2
Added FTS interface for Force-Torque-Control
Jun 18, 2018
5fd76e9
Merge branch 'iirob_dev' of https://github.com/iirob/kuka_experimenta…
Jun 18, 2018
9c80674
Create .travis.rosinstall
destogl Jun 18, 2018
a38f984
Update .travis.yml
destogl Jun 18, 2018
8d00e74
Update kuka_hardware_interface_with_fts.h
destogl Jun 18, 2018
397f49f
Update kuka_hardware_interface_with_fts.cpp
destogl Jun 18, 2018
9615202
Update kuka_hardware_interface_with_fts.h
destogl Jun 18, 2018
d0c5374
Update CMakeLists.txt
destogl Jun 18, 2018
3177ac9
Update package.xml
destogl Jun 18, 2018
6fe7664
Update kuka_hardware_interface_node.cpp
destogl Jun 18, 2018
d319d96
Update kuka_hardware_interface_node.cpp
destogl Jun 18, 2018
a8010c5
Update CMakeLists.txt
destogl Jun 18, 2018
7346fbe
Update CMakeLists.txt
destogl Jun 18, 2018
25a64bb
Update CMakeLists.txt
destogl Jun 18, 2018
d20e330
Merge branch 'indigo-devel' of https://github.com/ros-industrial/kuka…
destogl Feb 25, 2019
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
13 changes: 13 additions & 0 deletions .travis.rosinstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- git:
uri: 'https://github.com/iirob/iirob_filters.git'
local-name: iirob_filters
version: kinetic-devel
- git:
uri: 'https://github.com/iirob/rosparam_handler.git'
local-name: rosparam_handler
version: master
- git:
uri: 'https://github.com/KITrobotics/force_torque_sensor.git'
local-name: force_torque_sensor
version: kinetic-devel

3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ notifications:
on_failure: always

env:
global:
- UPSTREAM_WORKSPACE=file
matrix:
- USE_DEB=true
ROS_DISTRO="indigo"
ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu
- USE_DEB=true
ROS_DISTRO="indigo"
ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu
- ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu

install:
- git clone https://github.com/ros-industrial/industrial_ci.git .ci_config
Expand Down
2 changes: 1 addition & 1 deletion kuka_kr16_support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ catkin_package()

if (CATKIN_ENABLE_TESTING)
find_package(roslaunch REQUIRED)
roslaunch_add_file_check(test/roslaunch_test.xml)
roslaunch_add_file_check(launch)
endif()

install(DIRECTORY config launch meshes urdf
Expand Down
9 changes: 0 additions & 9 deletions kuka_kr16_support/test/roslaunch_test.xml

This file was deleted.

20 changes: 20 additions & 0 deletions kuka_rsi_hw_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ find_package(catkin REQUIRED COMPONENTS
realtime_tools
roscpp
std_msgs
force_torque_sensor
force_controllers
kdl_parser
)

find_package(Boost REQUIRED COMPONENTS system)
Expand All @@ -28,6 +31,8 @@ catkin_package(
joint_limits_interface
roscpp
std_msgs
force_torque_sensor
force_controllers
DEPENDS
TinyXML
)
Expand All @@ -43,21 +48,32 @@ include_directories(
add_library(kuka_hardware_interface
src/kuka_hardware_interface.cpp
)
add_library(kuka_hardware_interface_with_fts
src/kuka_hardware_interface_with_fts.cpp
)

target_link_libraries(kuka_hardware_interface
${catkin_LIBRARIES}
${Boost_LIBRARIES}
${TinyXML_LIBRARIES}
)
target_link_libraries(kuka_hardware_interface_with_fts
${catkin_LIBRARIES}
${Boost_LIBRARIES}
${TinyXML_LIBRARIES}
kuka_hardware_interface
)

add_executable(kuka_hardware_interface_node
src/kuka_hardware_interface_node.cpp
)

target_link_libraries(kuka_hardware_interface_node
kuka_hardware_interface
kuka_hardware_interface_with_fts
)


install(
TARGETS kuka_hardware_interface
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
Expand All @@ -67,3 +83,7 @@ install(
install(
TARGETS kuka_hardware_interface_node
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

install(DIRECTORY config launch test
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
7 changes: 4 additions & 3 deletions kuka_rsi_hw_interface/config/hardware_controllers.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#Publish all joint states
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 50

publish_rate: 1000
# Joint trajectory controller
position_trajectory_controller:
type: "position_controllers/JointTrajectoryController"
Expand All @@ -14,5 +13,7 @@ position_trajectory_controller:
- joint_a5
- joint_a6

state_publish_rate: 50 # Defaults to 50
state_publish_rate: 1000 # Defaults to 50
action_monitor_rate: 20 # Defaults to 20
constraints:
goal_time: 0.5
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class KukaHardwareInterface : public hardware_interface::RobotHW
std::vector<std::string> joint_names_;

std::vector<double> joint_position_;
std::vector<double> joint_position_last_;
std::vector<double> joint_velocity_;
std::vector<double> joint_effort_;
std::vector<double> joint_position_command_;
Expand Down Expand Up @@ -112,20 +113,23 @@ class KukaHardwareInterface : public hardware_interface::RobotHW
ros::Duration control_period_;
ros::Duration elapsed_time_;
double loop_hz_;

protected:
// Interfaces
hardware_interface::JointStateInterface joint_state_interface_;
hardware_interface::PositionJointInterface position_joint_interface_;
// TODO
hardware_interface::VelocityJointInterface velocity_joint_interface_;

public:

KukaHardwareInterface();
KukaHardwareInterface(ros::NodeHandle nh);
~KukaHardwareInterface();

void start();
void configure();
bool read(const ros::Time time, const ros::Duration period);
bool write(const ros::Time time, const ros::Duration period);
// virtual void handleInit();

};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#ifndef KUKA_RSI_HARDWARE_INTERFACE_WITH_FTS
#define KUKA_RSI_HARDWARE_INTERFACE_WITH_FTS

#include <force_controllers/force_controller.h>
#include <force_torque_sensor/force_torque_sensor_handle.h>
#include <hardware_interface/force_torque_sensor_interface.h>
#include <kuka_rsi_hw_interface/kuka_hardware_interface.h>
#include <ros/console.h>
#include <boost/shared_ptr.hpp>

namespace kuka_rsi_hw_interface
{

class KukaHardwareInterfaceWithFTS : public KukaHardwareInterface
{
force_torque_control::ForceTorqueControllerInterface ftc_interface_;
// ForceTorqueSensorHandle* ftsh_;
boost::shared_ptr<hardware_interface::ForceTorqueSensorHandle> ftsh_;
ros::NodeHandle nh_;

std::string fts_name;
std::string fts_sensor_frame;
std::string fts_transform_frame;

public:
KukaHardwareInterfaceWithFTS(ros::NodeHandle nh);
// ~KukaHardwareInterfaceWithFTS();

void handleInit();
};
} // namespace kuka_rsi_hw_interface

#endif
29 changes: 18 additions & 11 deletions kuka_rsi_hw_interface/krl/KR_C2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ This guide highlights the steps needed in order to successfully configure the **

## 1. Controller network configuration

Controller setup is described in chapter 4 of the **KUKA.Ethernet RSI XML 1.1** manual.
**KUKA.RobotSensorInterface** package must be installed. Depending on the version of the **KUKA.RobotSensorInterface** package you might also need the **KUKA.Ethernet RSI XML**. This can be verified in the *InstallTech* window (`Setup -> 9 Install additional Software` on the KCP).
Controller setup is described in chapter 4 of the **KUKA.Ethernet RSI XML 1.1** manual.
**KUKA.RobotSensorInterface** package must be installed. Depending on the version of the **KUKA.RobotSensorInterface** package you might also need the **KUKA.Ethernet RSI XML**. This can be verified in the *InstallTech* window (`Setup -> 9 Install additional Software` on the KCP)

Make sure not to use the `192.0.1.x` IP range for the controller or PC.
Make sure the not to use the `192.0.1.x` IP range for the controller or PC.

From the Ethernet RSI XML manual:

> The IP address range 192.0.1.x is reserved and is disabled for applications.
> Configuring the VxWorks network connection with this address range results in a system error in the KUKA system software. It is no longer possible to boot the robot controller.
> Configuring the VxWorks network connection with this address range results
> in a system error in the KUKA system software. It is no longer possible to
> boot the robot controller.

Ping the controller from the PC with ROS to make sure the network configuration is working.
Ping the controller from the PC with ROS to make sure the network configuration is working.


## 2. KRL Files
Expand All @@ -38,7 +40,7 @@ This should only be edited if the start position or max joint movements specifie
1. Copy the `ros_rsi.src` file to `KRC:\R1\Program` (Alternatively `C:\KRC\ROBOTER\KRC\R1\Program`)
2. Copy the `ros_rsi_ethernet.xml` file to `C:\KRC\ROBOTER\Init`

Note: You must reload KSS or reboot the controller if `ros_rsi.src` is not created / copied using the HMI.
Note: You must reload KSS or reboot the controller if `ros_rsi.src` is not created\copied using the HMI.

## 3. Configure the kuka_rsi_hw_interface

Expand All @@ -49,7 +51,7 @@ The **kuka_rsi_hardware_interface** needs to be configured in order to successfu

We recommend that you copy the configuration files, edit the copies for your needs and use these files to create your own launch file. A template will be provided at a later time. However, at this time, have a look at `test_hardware_interface.launch`, `test_params.yaml`, `controller_joint_names.yaml` and `hardware_controllers.yaml` to achieve a working test-launch.

In order to successfully launch the **kuka_rsi_hardware_interface** a parameter `robot_description` needs to be present on the ROS parameter server. This parameter can be set manually or by adding this line inside the launch file (replace support package and `.xacro` to match your application):
In order to successfully launch the **kuka_rsi_hardware_interface** a parameter `robot_description` needs to be present on the ROS parameter server. This parameter can be set manually or by adding this line inside the launch file (replace support package and .xacro to match your application):

```
<param name="robot_description" command="$(find xacro)/xacro.py '$(find kuka_kr6_support)/urdf/kr6r900sixx.xacro'"/>
Expand Down Expand Up @@ -100,16 +102,21 @@ Choose **controller manager ns** and **controller** and you should be able to mo

### RSI: Error in function <ST_ETHERNET>

Problems establishing connection between robot or PC. Check IP, port and that the **kuka_rsi_hardware_interface** is running on the PC. May also come from malformed XML in `ros_rsi_ethernet.xml`.

Problems establishing connection between robot or PC. Check IP, port and that the **kuka_rsi_hardware_interface** is running on the PC. May also come from malformed XML in ros_rsi_ethernet.xml


### SEN: RSI execution error <execute> - RSI stopped

Most likely due to late packages. From the Ethernet RSI XML manual:

> A data packet received by the external system must be answered within approx. 10 ms. If the data packet is not received by the robot controller within this period, the response is classified as too late. When the maximum number of external data packets for which a response has been sent too late has been exceeded, the robot interprets this as an error and stops.
> A data packet received by the external system must be answered within approx.
> 10 ms. If the data packet is not received by the robot controller within this
> period, the response is classified as too late. When the maximum number of
> external data packets for which a response has been sent too late has been
> exceeded, the robot interprets this as an error and stops

If you have problems with the connection to RSI shutting down now and then while moving the robot it is suggested to:

* Compile and install a [RT-Preempt](https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO) kernel for your PC.
* Give **kuka_rsi_hardware_interface** on your PC real-time priority when the RSI connection is established.


3 changes: 3 additions & 0 deletions kuka_rsi_hw_interface/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@
<depend>realtime_tools</depend>
<depend>roscpp</depend>
<depend>std_msgs</depend>
<depend>force_torque_sensor</depend>
<depend>force_controllers</depend>
<depend>kdl_parser</depend>
</package>
90 changes: 52 additions & 38 deletions kuka_rsi_hw_interface/src/kuka_hardware_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,43 +45,51 @@
namespace kuka_rsi_hw_interface
{

KukaHardwareInterface::KukaHardwareInterface() :
joint_position_(6, 0.0), joint_velocity_(6, 0.0), joint_effort_(6, 0.0), joint_position_command_(6, 0.0), joint_velocity_command_(
6, 0.0), joint_effort_command_(6, 0.0), joint_names_(6), rsi_initial_joint_positions_(6, 0.0), rsi_joint_position_corrections_(
6, 0.0), ipoc_(0), n_dof_(6)
KukaHardwareInterface::KukaHardwareInterface(ros::NodeHandle nh) :
joint_position_(6, 0.0), joint_position_last_(6, 0.0), joint_velocity_(6, 0.0), joint_effort_(6, 0.0),
joint_position_command_(6, 0.0), joint_velocity_command_(6, 0.0), joint_effort_command_(6, 0.0), joint_names_(6),
rsi_initial_joint_positions_(6, 0.0), rsi_joint_position_corrections_(6, 0.0), ipoc_(0), n_dof_(6)
{
in_buffer_.resize(1024);
out_buffer_.resize(1024);
remote_host_.resize(1024);
remote_port_.resize(1024);

if (!nh_.getParam("controller_joint_names", joint_names_))
{
ROS_ERROR("Cannot find required parameter 'controller_joint_names' "
"on the parameter server.");
throw std::runtime_error("Cannot find required parameter "
"'controller_joint_names' on the parameter server.");
}

//Create ros_control interfaces
for (std::size_t i = 0; i < n_dof_; ++i)
{
// Create joint state interface for all joints
joint_state_interface_.registerHandle(
hardware_interface::JointStateHandle(joint_names_[i], &joint_position_[i], &joint_velocity_[i],
&joint_effort_[i]));

// Create joint position control interface
position_joint_interface_.registerHandle(
hardware_interface::JointHandle(joint_state_interface_.getHandle(joint_names_[i]),
&joint_position_command_[i]));
}

// Register interfaces
registerInterface(&joint_state_interface_);
registerInterface(&position_joint_interface_);

ROS_INFO_STREAM_NAMED("hardware_interface", "Loaded kuka_rsi_hardware_interface");
nh_ = nh;
in_buffer_.resize(1024);
out_buffer_.resize(1024);
remote_host_.resize(1024);
remote_port_.resize(1024);

if (!nh_.getParam("controller_joint_names", joint_names_))
{
ROS_ERROR("Cannot find required parameter 'controller_joint_names' "
"on the parameter server.");
throw std::runtime_error("Cannot find required parameter "
"'controller_joint_names' on the parameter server.");
}

//Create ros_control interfaces
for (std::size_t i = 0; i < n_dof_; ++i)
{
// Create joint state interface for all joints
joint_state_interface_.registerHandle(
hardware_interface::JointStateHandle(joint_names_[i], &joint_position_[i], &joint_velocity_[i],
&joint_effort_[i]));

// Create joint position control interface
position_joint_interface_.registerHandle(
hardware_interface::JointHandle(joint_state_interface_.getHandle(joint_names_[i]),
&joint_position_command_[i]));

// TODO Create joint velocity control interface
velocity_joint_interface_.registerHandle(
hardware_interface::JointHandle(joint_state_interface_.getHandle(joint_names_[i]),
&joint_velocity_command_[i]));
}

// Register interfaces
registerInterface(&joint_state_interface_);
registerInterface(&position_joint_interface_);
// TODO
registerInterface(&velocity_joint_interface_);

ROS_INFO_STREAM_NAMED("hardware_interface", "Loaded kuka_rsi_hardware_interface");
}

KukaHardwareInterface::~KukaHardwareInterface()
Expand All @@ -107,8 +115,13 @@ bool KukaHardwareInterface::read(const ros::Time time, const ros::Duration perio
for (std::size_t i = 0; i < n_dof_; ++i)
{
joint_position_[i] = DEG2RAD * rsi_state_.positions[i];
if(!period.isZero())
{
joint_velocity_[i] = (joint_position_[i] - joint_position_last_[i]) / period.toSec();
}
}
ipoc_ = rsi_state_.ipoc;
joint_position_last_ = joint_position_;

return true;
}
Expand Down Expand Up @@ -142,7 +155,7 @@ void KukaHardwareInterface::start()
{
bytes = server_->recv(in_buffer_);
}

rsi_state_ = RSIState(in_buffer_);
for (std::size_t i = 0; i < n_dof_; ++i)
{
Expand Down Expand Up @@ -177,6 +190,7 @@ void KukaHardwareInterface::configure()
throw std::runtime_error(msg);
}
rt_rsi_pub_.reset(new realtime_tools::RealtimePublisher<std_msgs::String>(nh_, "rsi_xml_doc", 3));
}
}
// void handleInit(){};

} // namespace kuka_rsi_hardware_interface
Loading