Skip to content

Commit efe138c

Browse files
author
Felix Exner
committed
Fixed error output and use actual value on illegal force_mode_settings
There was a copy&paste error in the error output. By using the fallback value directly, this is avoided, if the default value may ever change.
1 parent 2eaffa6 commit efe138c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/ur/ur_driver.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ urcl::UrDriver::UrDriver(const std::string& robot_ip, const std::string& script_
134134
if (force_mode_damping < 0 || force_mode_damping > 1)
135135
{
136136
std::stringstream ss;
137-
ss << "Force mode damping, should be between 0 and 1, but it is " << force_mode_damping
138-
<< " setting it to default 0.5";
139-
URCL_LOG_ERROR(ss.str().c_str());
137+
ss << "Force mode damping, should be between 0 and 1, but it is " << force_mode_damping;
140138
force_mode_damping = 0.025;
139+
ss << " setting it to default " << force_mode_damping;
140+
URCL_LOG_ERROR(ss.str().c_str());
141141
}
142142
prog.replace(prog.find(FORCE_MODE_SET_DAMPING_REPLACE), FORCE_MODE_SET_DAMPING_REPLACE.length(),
143143
std::to_string(force_mode_damping));
@@ -158,10 +158,10 @@ urcl::UrDriver::UrDriver(const std::string& robot_ip, const std::string& script_
158158
if (force_mode_gain_scaling < 0 || force_mode_gain_scaling > 2)
159159
{
160160
std::stringstream ss;
161-
ss << "Force mode gain scaling, should be between 0 and 2, but it is " << force_mode_gain_scaling
162-
<< " setting it to default 0.5";
163-
URCL_LOG_ERROR(ss.str().c_str());
161+
ss << "Force mode gain scaling, should be between 0 and 2, but it is " << force_mode_gain_scaling;
164162
force_mode_gain_scaling = 0.5;
163+
ss << " setting it to default " << force_mode_gain_scaling;
164+
URCL_LOG_ERROR(ss.str().c_str());
165165
}
166166
prog.replace(prog.find(FORCE_MODE_SET_GAIN_SCALING_REPLACE), FORCE_MODE_SET_GAIN_SCALING_REPLACE.length(),
167167
std::to_string(force_mode_gain_scaling));

0 commit comments

Comments
 (0)