Skip to content

Commit df110ef

Browse files
committed
Return false from setFrictionCompensation if the command is not supported
1 parent 21a63e3 commit df110ef

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/control/script_command_interface.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,11 @@ bool ScriptCommandInterface::endToolContact()
228228

229229
bool ScriptCommandInterface::setFrictionCompensation(const bool friction_compensation_enabled)
230230
{
231-
robotVersionSupportsCommandOrWarn(urcl::VersionInformation::fromString("5.23.0"),
232-
urcl::VersionInformation::fromString("10.10.0"), __func__);
231+
if (!robotVersionSupportsCommandOrWarn(urcl::VersionInformation::fromString("5.23.0"),
232+
urcl::VersionInformation::fromString("10.10.0"), __func__))
233+
{
234+
return false;
235+
}
233236
const int message_length = 2;
234237
uint8_t buffer[sizeof(int32_t) * MAX_MESSAGE_LENGTH];
235238
uint8_t* b_pos = buffer;
@@ -300,6 +303,7 @@ void ScriptCommandInterface::messageCallback(const socket_t filedescriptor, char
300303
nbytesrecv);
301304
}
302305
}
306+
303307
bool ScriptCommandInterface::robotVersionSupportsCommandOrWarn(const VersionInformation& min_polyscope5,
304308
const VersionInformation& min_polyscopeX,
305309
const std::string& command_name)

0 commit comments

Comments
 (0)