diff --git a/examples/force_mode_example.cpp b/examples/force_mode_example.cpp index 409ff590..fa3713bc 100644 --- a/examples/force_mode_example.cpp +++ b/examples/force_mode_example.cpp @@ -149,14 +149,25 @@ int main(int argc, char* argv[]) } // Task frame at the robot's base with limits being large enough to cover the whole workspace // Compliance in z axis and rotation around z axis - - bool success = g_my_driver->startForceMode({ 0, 0, 0, 0, 0, 0 }, // Task frame at the robot's base - { 0, 0, 1, 0, 0, 1 }, // Compliance in z axis and rotation around z axis - { 0, 0, 0, 0, 0, 0 }, // do not apply any active wrench - 2, // do not transform the force frame at all - { 0.1, 0.1, 1.5, 3.14, 3.14, 0.5 } // limits. See ScriptManual - , - 0.8, 0.8); // for details. + bool success; + if (g_my_driver->getVersion().major < 5) + success = g_my_driver->startForceMode({ 0, 0, 0, 0, 0, 0 }, // Task frame at the robot's base + { 0, 0, 1, 0, 0, 1 }, // Compliance in z axis and rotation around z axis + { 0, 0, 0, 0, 0, 0 }, // do not apply any active wrench + 2, // do not transform the force frame at all + { 0.1, 0.1, 1.5, 3.14, 3.14, 0.5 } // limits. See ScriptManual + , + 0.8); // for details. + else + { + success = g_my_driver->startForceMode({ 0, 0, 0, 0, 0, 0 }, // Task frame at the robot's base + { 0, 0, 1, 0, 0, 1 }, // Compliance in z axis and rotation around z axis + { 0, 0, 0, 0, 0, 0 }, // do not apply any active wrench + 2, // do not transform the force frame at all + { 0.1, 0.1, 1.5, 3.14, 3.14, 0.5 } // limits. See ScriptManual + , + 0.8, 0.8); // for details. + } if (!success) { URCL_LOG_ERROR("Failed to start force mode.");