Edit on GitHub

Library Setup <Java Linux>

Install requirements

Compiler and Builder

Required Packages

Java Native Access(JNA)

Function Reference

  • The function reference file is located in [DynamixelSDK folder]/java/dynamixel_functions_java/x86 or x64/Dynamixel.java

Building and Running the Sample Code

The DYNAMIXEL SDK example code for Java uses the library files(.so for Linux) built in C language.

Each released DYNAMIXEL SDK have latest library files in [DynamixelSDK folder]/c/build/[linuxXX]/libdxl_xYY_c.so which should be built by its own source code.

Make Java Project

  • Set workspace

  • Make new project. Click New - Project...

  • Select Java Project, then click Next

  • Type Project Name, then click Next

Import function reference

  • Click Link Additional Source to Project

  • Click Browse

  • Select the folder linux64 in c language folder, then click ok
    (for x86 platform, select [DynamixelSDK folder]/java/dynamixel_functions_java/linux32)

  • Click Finish

Import DynamixelSDK library

  • Click Link Additional Source to Project

  • Click Browse

  • Select the folder x64 in java language folder, then click ok

  • Click Finish

Import JNA

  • Go to Libraries on the screen.

  • Click Add External JARs

  • Choose the jna-X.Y.Z.jar downloaded previously.

  • Click Finish

Run example

  • Make the port be able to be used

    $ sudo chmod a+rw /dev/ttyUSB0
    

  • Put ReadWrite.java source into the folder src on the screen

  • Adjust the values surrounded with red circle to proper value as shown in the comment.

  • Click Run in the Eclipse toolbox above. Console window will show the results

Library Setup <Java Windows>

Install requirements

Compiler and Builder

Required Packages

Java Native Access(JNA)

Function Reference

  • The function reference file is located in [DynamixelSDK folder]/java/dynamixel_functions_java/x86 or x64/Dynamixel.java

Building and Running the Sample Code

The DYNAMIXEL SDK example code for Java uses the library files(.dll for Windows) built in C language.

Each released DYNAMIXEL SDK have latest library files in [DynamixelSDK folder]/c/build/[winXX]/output/dxl_xYY_c.dll which were built by its own source code.

Make Java Project

  • Set workspace

  • Make new project. Click New - Project...

  • Select Java Project, then click Next

  • Type Project Name, then click Next

Import function reference

  • Open Configure Build Path

  • Click Link Additional Source to Project

  • Click Browse

  • Select the folder output in c language folder, then click ok

  • Click Finish

Import DynamixelSDK library

  • Click Link Additional Source to Project

  • Click Browse

  • Select the folder x64 in java language folder, then click ok
    (for x86 platform, select [DynamixelSDK folder]/java/dynamixel_functions_java/x86)

  • Tpye Folder name and Click Finish

Import JNA

  • Go to Libraries tap and Click Add External JARs.

  • Choose the jna-X.Y.Z.jar downloaded previously.

  • Click Apply and Close

Run example

  • Put ReadWrite.java source into the folder src on the screen

  • Adjust the values surrounded with red circle to proper value as shown in the comment.

  • Click Run in the Eclipse toolbox above. Console window will show the results

Library Setup <Java macOS>

Maintenance is in progress. We apologize for your inconvenience. The manual is available in the near future.