Verify with Example Programs ============================ Run some example programs to verify that everything is working. Run an example C++ program -------------------------- 1. Compile example C++ programs following :ref:`link_rdk_cpp_lib`. 2. Release (pull **up**) E-stop on the motion bar. The robot will have no action because an enabling method must be called to actually enable the robot. 3. Run the most basic example program ``basics1_display_robot_states`` to check the RDK connection can be established and the robot is normally operational. This example program will first enable the robot, then hold the robot while printing out all received robot states and actions. On Linux and macOS:: cd flexiv_rdk/example/build ./basics1_display_robot_states On Windows (Command Prompt):: cd flexiv_rdk\example\build set PATH=%USERPROFILE%\rdk_install\bin;%PATH% Release\basics1_display_robot_states.exe On Windows (bash emulator, such as Git Bash), use bash syntax to set ``PATH`` (note the use of ``/`` as path separator and ``:`` to delimit entries):: cd flexiv_rdk/example/build export PATH="$USERPROFILE/rdk_install/bin:$PATH" ./Release/basics1_display_robot_states.exe .. note:: * Replace ```` with the actual serial number of the robot. When passing it to the program, replace space with dash or underscore, for example, ``Enlight-L-123456``. * On Linux and macOS, the dependencies' shared libraries are found automatically at runtime via the RPATH baked into the executable. On Windows, which does not support RPATH, the ``bin`` folder under the installation directory must be added to ``PATH`` so the shared libraries can be found. * Root privilege is required if the real-time scheduler API ``flexiv::rdk::Scheduler`` is used in the program. 4. The robot will be enabled and release the joint brakes, which will make some audible crispy sound. After a few seconds, when the enabling process is done and the robot becomes operational, robot states and actions data will be obtained from the server and gets printed in the Terminal. An excerpt of the output is as follows: .. code-block:: c { "timestamp": [1780607158, 88876616], "q": [0.000, -0.698, 0.000, 1.571, 0.000, 0.698, 0.000], "theta": [0.000, -0.698, 0.000, 1.571, 0.000, 0.698, 0.000], "dq": [0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000], "dtheta": [0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000], "tau": [-0.000, 46.595, 1.089, -19.281, -2.042, 2.309, -0.000], "tau_dot": [0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000], "tau_ext": [0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000], "tau_interact": [0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000], "temperature": [0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000], "flange_pose": [0.687, -0.110, 0.287, -0.000, -0.000, 1.000, 0.000], "tcp_pose": [0.687, -0.110, 0.287, -0.000, -0.000, 1.000, 0.000], "tcp_twist": [0.000, 0.000, 0.000, 0.000, 0.000, 0.000], "tcp_wrench": [0.000, 0.000, 0.000, 0.000, 0.000, 0.000], "tcp_wrench_local": [-0.000, 0.000, 0.000, -0.000, 0.000, 0.000], "raw_tcp_wrench": [0.000, 0.000, 0.000, 0.000, 0.000, 0.000], "raw_tcp_wrench_local": [-0.000, 0.000, 0.000, -0.000, 0.000, 0.000], "raw_ft_sensor": [0.000, 0.000, 0.000, 0.000, 0.000, 0.000] } Followed by the robot actions data: .. code-block:: c { "q_d": [0.000, -0.698, 0.000, 1.571, 0.000, 0.698, 0.000], "dq_d": [0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000], "tau_d": [0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000], "tcp_pose_d": [0.687, -0.110, 0.287, -0.000, -0.000, 1.000, 0.000], "tcp_twist_d": [0.000, 0.000, 0.000, 0.000, 0.000, 0.000], "tcp_wrench_d": [0.000, 0.000, 0.000, 0.000, 0.000, 0.000] } 5. To close the running example program, simply press ``Ctrl+C``. .. _setup_and_run_python_rdk: Run an example Python program ----------------------------- Running en example Python program is similar to running the C++ example program, but without the need for any compilation:: cd flexiv_rdk/example_py python3 basics1_display_robot_states.py .. note:: Replace ``python3`` with ``python3.x`` to explicitly invoke a specific version of Python.