@@ -57,7 +57,7 @@ std::unique_ptr<ExampleRobotWrapper> g_my_robot;
5757
5858void sendFreedriveMessageOrDie (const control::FreedriveControlMessage freedrive_action)
5959{
60- bool ret = g_my_robot->ur_driver_ ->writeFreedriveControlMessage (freedrive_action);
60+ bool ret = g_my_robot->getUrDriver () ->writeFreedriveControlMessage (freedrive_action);
6161 if (!ret)
6262 {
6363 URCL_LOG_ERROR (" Could not send joint command. Is the robot in remote control?" );
@@ -91,7 +91,7 @@ int main(int argc, char* argv[])
9191 URCL_LOG_ERROR (" Something in the robot initialization went wrong. Exiting. Please check the output above." );
9292 return 1 ;
9393 }
94- if (!g_my_robot->ur_driver_ ->checkCalibration (CALIBRATION_CHECKSUM))
94+ if (!g_my_robot->getUrDriver () ->checkCalibration (CALIBRATION_CHECKSUM))
9595 {
9696 URCL_LOG_ERROR (" Calibration checksum does not match actual robot." );
9797 URCL_LOG_ERROR (" Use the ur_calibration tool to extract the correct calibration from the robot and pass that into "
@@ -107,24 +107,24 @@ int main(int argc, char* argv[])
107107 // Task frame at the robot's base with limits being large enough to cover the whole workspace
108108 // Compliance in z axis and rotation around z axis
109109 bool success;
110- if (g_my_robot->ur_driver_ ->getVersion ().major < 5 )
111- success =
112- g_my_robot-> ur_driver_ -> startForceMode ( { 0 , 0 , 0 , 0 , 0 , 0 }, // Task frame at the robot's base
113- { 0 , 0 , 1 , 0 , 0 , 1 }, // Compliance in z axis and rotation around z axis
114- { 0 , 0 , -2 , 0 , 0 , 0 }, // Press in -z direction
115- 2 , // do not transform the force frame at all
116- { 0.1 , 0.1 , 1.5 , 3.14 , 3.14 , 0.5 }, // limits
117- 0.005 ); // damping_factor. See ScriptManual for details.
110+ if (g_my_robot->getUrDriver () ->getVersion ().major < 5 )
111+ success = g_my_robot-> getUrDriver ()-> startForceMode ({ 0 , 0 , 0 , 0 , 0 , 0 }, // Task frame at the robot's base
112+ { 0 , 0 , 1 , 0 , 0 , 1 }, // Compliance in z axis and rotation
113+ // around z axis
114+ { 0 , 0 , -2 , 0 , 0 , 0 }, // Press in -z direction
115+ 2 , // do not transform the force frame at all
116+ { 0.1 , 0.1 , 1.5 , 3.14 , 3.14 , 0.5 }, // limits
117+ 0.005 ); // damping_factor. See ScriptManual for details.
118118 else
119119 {
120- success =
121- g_my_robot-> ur_driver_ -> startForceMode ( { 0 , 0 , 0 , 0 , 0 , 0 }, // Task frame at the robot's base
122- { 0 , 0 , 1 , 0 , 0 , 1 }, // Compliance in z axis and rotation around z axis
123- { 0 , 0 , -2 , 0 , 0 , 0 }, // Press in -z direction
124- 2 , // do not transform the force frame at all
125- { 0.1 , 0.1 , 1.5 , 3.14 , 3.14 , 0.5 }, // limits
126- 0.005 , // damping_factor
127- 1.0 ); // gain_scaling. See ScriptManual for details.
120+ success = g_my_robot-> getUrDriver ()-> startForceMode ({ 0 , 0 , 0 , 0 , 0 , 0 }, // Task frame at the robot's base
121+ { 0 , 0 , 1 , 0 , 0 , 1 }, // Compliance in z axis and rotation
122+ // around z axis
123+ { 0 , 0 , -2 , 0 , 0 , 0 }, // Press in -z direction
124+ 2 , // do not transform the force frame at all
125+ { 0.1 , 0.1 , 1.5 , 3.14 , 3.14 , 0.5 }, // limits
126+ 0.005 , // damping_factor
127+ 1.0 ); // gain_scaling. See ScriptManual for details.
128128 }
129129 if (!success)
130130 {
@@ -138,13 +138,13 @@ int main(int argc, char* argv[])
138138 auto stopwatch_now = stopwatch_last;
139139 while (time_done < timeout || second_to_run.count () == 0 )
140140 {
141- g_my_robot->ur_driver_ ->writeKeepalive ();
141+ g_my_robot->getUrDriver () ->writeKeepalive ();
142142
143143 stopwatch_now = std::chrono::steady_clock::now ();
144144 time_done += stopwatch_now - stopwatch_last;
145145 stopwatch_last = stopwatch_now;
146146 std::this_thread::sleep_for (std::chrono::milliseconds (2 ));
147147 }
148148 URCL_LOG_INFO (" Timeout reached." );
149- g_my_robot->ur_driver_ ->endForceMode ();
149+ g_my_robot->getUrDriver () ->endForceMode ();
150150}
0 commit comments