-
Notifications
You must be signed in to change notification settings - Fork 134
Add a resolved acceleration control mode #450
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
base: master
Are you sure you want to change the base?
Changes from all commits
795e4f3
fe44230
7ee1fdc
dae6f94
c86a757
a71f15e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,7 @@ const std::string INPUT_RECIPE = "examples/resources/rtde_input_recipe.txt"; | |
| std::unique_ptr<ExampleRobotWrapper> g_my_robot; | ||
| bool g_HEADLESS = true; | ||
| bool g_running = false; | ||
| bool g_support_set_friction_scales = false; | ||
|
|
||
| void sendScriptCommands() | ||
| { | ||
|
|
@@ -67,13 +68,27 @@ void sendScriptCommands() | |
| run_cmd("Setting tool voltage to 24V", | ||
| []() { g_my_robot->getUrDriver()->setToolVoltage(urcl::ToolVoltage::_24V); }); | ||
| run_cmd("Enabling tool contact mode", []() { g_my_robot->getUrDriver()->startToolContact(); }); | ||
| run_cmd("Setting friction_compensation variable to `false`", | ||
| []() { g_my_robot->getUrDriver()->setFrictionCompensation(false); }); | ||
|
|
||
| if (g_support_set_friction_scales) | ||
| { | ||
| // setFrictionScales is only supported from PolyScope 5.25.1 / PolyScope X 10.12.1 and upwards. | ||
| run_cmd("Turn off friction_compensation by setting the friction scales to zeroes", | ||
| []() { g_my_robot->getUrDriver()->setFrictionScales({ 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0 }); }); | ||
| } | ||
| run_cmd("Setting tool voltage to 0V", []() { g_my_robot->getUrDriver()->setToolVoltage(urcl::ToolVoltage::OFF); }); | ||
| run_cmd("Zeroing the force torque sensor", []() { g_my_robot->getUrDriver()->zeroFTSensor(); }); | ||
| run_cmd("Disabling tool contact mode", []() { g_my_robot->getUrDriver()->endToolContact(); }); | ||
| run_cmd("Setting friction_compensation variable to `true`", | ||
| []() { g_my_robot->getUrDriver()->setFrictionCompensation(true); }); | ||
| run_cmd("Setting TCP offset to [0.0, 0.0, 0.10, 0.0, 0.0, 0.0]", | ||
| []() { g_my_robot->getUrDriver()->setTcpOffset({ 0.0, 0.0, 0.10, 0.0, 0.0, 0.0 }); }); | ||
|
|
||
| if (g_support_set_friction_scales) | ||
| { | ||
| // setFrictionScales is only supported from PolyScope 5.25.1 / PolyScope X 10.12.1 and upwards. | ||
| run_cmd("Turn on friction_compensation by setting the friction scales to non-zero values", []() { | ||
| g_my_robot->getUrDriver()->setFrictionScales({ 0.9, 0.9, 0.8, 0.9, 0.9, 0.9 }, | ||
| { 0.8, 0.8, 0.7, 0.8, 0.8, 0.8 }); | ||
| }); | ||
| } | ||
| } | ||
| URCL_LOG_INFO("Script command thread finished."); | ||
| } | ||
|
|
@@ -106,6 +121,17 @@ int main(int argc, char* argv[]) | |
| g_my_robot = | ||
| std::make_unique<ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, g_HEADLESS, "external_control.urp"); | ||
|
|
||
| // Check if the robot version supports the friction scales command (requires 5.25.1 / 10.12.1) | ||
| auto version = g_my_robot->getUrDriver()->getVersion(); | ||
| g_support_set_friction_scales = (version.major == 5 && version >= urcl::VersionInformation::fromString("5.25.1")) || | ||
| (version.major >= 10 && version >= urcl::VersionInformation::fromString("10.12.1")); | ||
| if (!g_support_set_friction_scales) | ||
| { | ||
| URCL_LOG_INFO("Setting friction scales is not supported on this robot (version %s). " | ||
| "Requires at least 5.25.1 / 10.12.1. Skipping friction scale commands.", | ||
| version.toString().c_str()); | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Version check before robot health validation risks crashMedium Severity The newly added version check via |
||
|
|
||
| if (!g_my_robot->isHealthy()) | ||
| { | ||
| URCL_LOG_ERROR("Something in the robot initialization went wrong. Exiting. Please check the output above."); | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug print statement accidentally committed
Low Severity
A
std::coutstatement printing the robot version was added tofull_driver.cpp. Every other log message in this file uses theURCL_LOG_*macros. This looks like a leftover debugging statement.