Skip to content

Commit

Permalink
New: Implement position dithering in torque mode
Browse files Browse the repository at this point in the history
KUKA turns off friction compensation when the robot is at the commanded
positions. This implements dithering of "position commands" in torque control mode.
  • Loading branch information
matthias-mayr committed Nov 4, 2022
1 parent b6a9f90 commit e293093
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion iiwa_driver/src/iiwa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
// FRI Headers
#include <kuka/fri/ClientData.h>

#include <cmath>
#include <thread>

namespace iiwa_ros {
Expand Down Expand Up @@ -304,8 +305,16 @@ namespace iiwa_ros {
_fri_message_data->resetCommandMessage();

if (_robot_state.getClientCommandMode() == kuka::fri::TORQUE) {
_joint_position_command = _joint_position;
// Implements dithering to trigger the friction observer.
// If the physical robot is at the commanded positions, KUKA turns off friction
// compensation.
for (int i = 0; i < 7; i++)
{
_joint_position_command.at(i) += 0.1 * sin(ros::Time::now().toSec());
}
_robot_command.setJointPosition(_joint_position_command.data());
_robot_command.setTorque(_joint_effort_command.data());
_robot_command.setJointPosition(_joint_position.data());
}
else if (_robot_state.getClientCommandMode() == kuka::fri::POSITION)
_robot_command.setJointPosition(_joint_position_command.data());
Expand Down

0 comments on commit e293093

Please sign in to comment.