Dynamixel SDK

dxl_initialize

It initializes the communication devices and makes ready status.

 

int dxl_initialize(
 
      int devIndex ,
      int baudnum
 
);

 

Parameters

- devIndex  

It is the number of currently connected communication devices. (It may vary depending on the platform.)

For example, Windows distinguishes devices by COM Port.

- baudnum

It is Baud rate number to be set.  It is the same number used by Dynamixel.

The following table shows the main Baudrate.

 

Address 4

Set BPS

Goal BPS

Error

1

    1000000.0       1000000.0     0.000 %

3

      500000.0         500000.0     0.000 %

4

      400000.0         400000.0     0.000 %

7

      250000.0         250000.0     0.000 %

9

      200000.0         200000.0     0.000 %

16

      117647.1       115200.0    -2.124 %

34

        57142.9         57600.0     0.794 %

103

        19230.8         19200.0    -0.160 %

207

          9615.4           9600.0    -0.160 %

 

Return Values

- If the value is 1, it means success; however, if  the value is 0, it means failure.

 

Example

It shows COM3 Port in Windows environment and how to initialize the communication speed to 1Mbps.

#define DEFAULT_PORTNUM 3   // COM3
#define DEFAULT_BAUDNUM 1  //  1Mbps
 
int result;
result =  dxl_initialize( DEFAULT_PORTNUM, DEFAULT_BAUDNUM );
 
if( result == 1)
 {
    // Succeed to open USB2Dynamixel

  }

else if( result == 0 )

 {

    // Failed to open USB2Dynamixel

  }

 

Go Back to the List