@@ -46,10 +46,10 @@ const std::string INPUT_RECIPE = "examples/resources/rtde_input_recipe.txt";
4646const size_t JOINT_INDEX = 5 ; // Joint index to control, in this case joint 6 (index 5)
4747
4848// This example will apply a sinusoidal torque to JOINT_INDEX, while the other joints are kept at 0.0.
49- constexpr double frequency = 0.2 ; // [Hz]
50- constexpr double amplitude = 2.5 ; // [Nm]
51- constexpr double omega = 2 * M_PI * frequency ;
52- constexpr double start_position = 0.0 ; // [rad]
49+ constexpr double FREQUENCY = 0.2 ; // [Hz]
50+ constexpr double AMPLITUDE = 2.5 ; // [Nm]
51+ constexpr double OMEGA = 2 * M_PI * FREQUENCY ;
52+ constexpr double START_POSITION = 0.0 ; // [rad]
5353
5454std::unique_ptr<urcl::ExampleRobotWrapper> g_my_robot;
5555urcl::vector6d_t g_joint_positions;
@@ -130,7 +130,7 @@ int main(int argc, char* argv[])
130130 throw std::runtime_error (error_msg);
131131 }
132132 // Use motion primitives to move JOINT_INDEX to start position
133- g_joint_positions[JOINT_INDEX ] = start_position ;
133+ g_joint_positions[JOINT_INDEX ] = START_POSITION ;
134134 auto instruction_executor = std::make_shared<urcl::InstructionExecutor>(g_my_robot->getUrDriver ());
135135 instruction_executor->optimoveJ (g_joint_positions);
136136
@@ -139,7 +139,7 @@ int main(int argc, char* argv[])
139139 double time = 0.0 ;
140140
141141 // Run 10 periods of the sinusoidal
142- while (time < 10 * 2 * M_PI / omega )
142+ while (time < 10 * 2 * M_PI / OMEGA )
143143 {
144144 time += timestep;
145145 // Read latest RTDE package. This will block for a hard-coded timeout (see UrDriver), so the
@@ -160,7 +160,7 @@ int main(int argc, char* argv[])
160160 }
161161
162162 // Open loop control. The target is incremented with a constant each control loop
163- target_torques[JOINT_INDEX ] = amplitude * std::sin (omega * time);
163+ target_torques[JOINT_INDEX ] = AMPLITUDE * std::sin (OMEGA * time);
164164
165165 // Setting the RobotReceiveTimeout time is for example purposes only. This will make the example running more
166166 // reliable on non-realtime systems. Use with caution in productive applications. Having it
0 commit comments