Edit on GitHub

Examples

Device Setup(RH-P12-RN(A))

In order to run the example, RH-P12-RN(A) should be set as belows.

TIP: To change the values of the control table, use R+ Manager 2.0 (in Windows) or DYNAMIXEL Wizard 2.0 (in Windows, Linux or Mac OS.)

Communication Port Setup

The Serial COM Port for Windows example is set as “COM4”.
Please change the Serial COM Port to COM4 in the Device Manager or modify the DEVICE_NAME in the example source code.
In case of Linux example, the communication port is set as “/dev/ttyUSB0”.
If other communication port is used, the DEVICE_NAME in the example source code should be modified properly.

RH-P12-RN_Example/rh-p12-rna.cpp

...

#if defined(__linux__)
#define DEVICE_NAME             "/dev/ttyUSB0"
#elif defined(_WIN32) || defined(_WIN64)
#define DEVICE_NAME             "COM4"
#endif

...

Windows Example

Download

  1. Install Git Client at Git official website.
  2. Run Git Client.
  3. Download the repository using provided URL: https://github.com/ROBOTIS-GIT/RH-P12-RN_Example.

NOTE: Direct Download Link(.zip) is available at RH-P12-RN_Example-master.zip.

Build and Run

  1. Install Visual Studio program.

    The Windows example is tested on Visual Studio 2017

  2. Open the solution with RH-P12-RN_Example\win64\RH-P12-RN-Example.sln file.

  3. Build solution and run.

    • Below error message might appear due to the difference of Windows SDK version.
       error MSB8036: The Windows SDK version 10.0.14393.0 was not found.  
       Install the required version of Windows SDK or change the SDK version  
       in the project property pages or by right-clicking the solution  
       and selecting "Retarget solution".
      

      In order to resolve the error, open the property page from the project and select installed Windows SDK version, then rebuild the code.
      img

Execution Screen

If execution fails, confirm the error message and proceed to Device Setup(RH-P12-RN(A)) or Communication Port Setup properly.

Operation

Refer to the images (Current-based Position Control Mode and Current Control Mode) at Execution Screen.

Each option is described as belows.

++ MODE ++

++ TORQUE ++

++ CONTROL ++

++ PARAMETERS ++

Linux Example

Follow the steps to operate RH-P12-RN(A) by using Linux Example. Enter the given commands using Terminal.

Preperation

  1. Install DYNAMIXEL SDK.
    $ git clone https://github.com/ROBOTIS-GIT/DynamixelSDK
    $ cd DynamixelSDK/c++/build/linux64
    $ sudo make install
    
  2. Register USER_ID to dialout group.
    $ sudo usermod -aG dialout USER_ID  
    
  3. Restart or log out, and log in to validate the change in order to gain access to /dev/ttyUSB0

Download

$ git clone https://github.com/ROBOTIS-GIT/RH-P12-RN_Example

Build

$ cd RH-P12-RN_Example/linux64
$ make

Run

$ ./rh-p12-rna_example

Execution Screen

If execution fails, confirm the error message and proceed to Device Setup(RH-P12-RN(A)) or Communication Port Setup properly.

ROS GUI Example

Follow the steps to operate RH-P12-RN(A) by using Linux Example. Enter the given commands using Terminal.

Preperation

  1. Create real-time scheduling priority (rtprio) for USER_GROUP (your user group)
    $ sudo bash -c 'echo "@USER_GROUP - rtprio 99" > /etc/security/limits.d/robotis-rtprio.conf'
    
  2. Register USER_ID (your user ID) to dialout group in order to gain access to /dev/ttyUSB0
    $ sudo usermod –aG dialout USER_ID
    
  3. Restart or log out, and log in to validate the change in order to gain access to /dev/ttyUSB0

Download

$ cd ~/catkin_ws/src
$ git clone https://github.com/ROBOTIS-GIT/DynamixelSDK
$ git clone https://github.com/ROBOTIS-GIT/ROBOTIS-Framework
$ git clone https://github.com/ROBOTIS-GIT/ROBOTIS-Framework-msgs
$ git clone https://github.com/ROBOTIS-GIT/RH-P12-RN-A

Build

$ cd ~/catkin_ws
$ catkin_make

Run

  1. Open the new terminal and run manager.
    $ roslaunch rh_p12_rn_a_manager rh_p12_rn_a_manager.launch
    
  2. Open the new terminal and run GUI example.
    $ rosrun rh_p12_rn_a_gui rh_p12_rn_a_gui