PDA

View Full Version : On Bioloid: What is the "bin folder" I need to add?



cybernetics
07-19-2011, 10:24 AM
On http://support.robotis.com/en/ under Software Help > Dynamixel SDK > USB2Dynamixel > Windows

it says:
"Add bin folder to the end of existing variable values with semicolon under the example folder.
Please be careful not to change or delete the existing variable values.
The example below shows added things, assuming the location of DLL file is C:\Project\bin."

But I don't understand what I really need to add?

Moreover, under C:\Program Files (x86)\ROBOTIS , I only have the "RoboPlus" option and not the "USB2dynamixel" as needed.
See On http://support.robotis.com/en/ under Software Help > Dynamixel SDK > USB2Dynamixel > Windows > Matlab

Thanks a lot!

P.S.: I want to controll my robot with Matlab.

Gertlex
07-19-2011, 01:00 PM
Did you click the edit button as shown in the image above that text?

I'll rehash what you're doing in those steps:
-Click on the row in the bottom text box that has Path (In the variable column) (this row is highlighted in blue in the example image).
-Click the edit button below that text box. (The window shown in step 3's image appears...)
-Select all of the text in the text box labeled 'variable value'. Copy and paste this in a text editor.
-Append a semicolon (';') to the end of the line, then paste the folder path %SDK%\bin to the end, where %SDK% is where the stuff you installed was installed to... I've not used this software, so I don't know what the probable path is.
-Copy/paste this modified line back into the 'variable value' text box.
-Close each of the three windows by pressing OK.

cybernetics
07-19-2011, 01:15 PM
Ok I've done it, but I still get this error on MATLAB:


??? Error using ==> loadlibrary>lFullPath at 553
Could not find file dxl_matlab.h.

Error in ==> loadlibrary at 221
header=lFullPath(header);

Error in ==> ReadWrite at 36
loadlibrary('dynamixel','dxl_matlab.h');

And I've added this path (under File > Set Path): D:\LiberT\Desktop\Laboratoire de Robotique\dxl_sdk_win64_v1_02\import

So I don't know what else I need to do? :S

Thanks for your help, it's appreciated.

tician
07-19-2011, 02:25 PM
If you look at the SyncWrite.m example, they use:
loadlibrary('dynamixel','dynamixel.h'); instead of:
loadlibrary('dynamixel','dxl_matlab.h'); So I think it might just be a typo as I can find no file named 'dxl_matlab.h' anywhere in the zip file.

cybernetics
07-19-2011, 03:01 PM
Now I get this error:


??? Error using ==> loadlibrary at 368
Failed to preprocess the input file.
Output from preprocessor is:'cl' n'est pas reconnu en tant que commande interne
ou externe, un programme ex‚cutable ou un fichier de commandes.


Error in ==> ReadWrite at 38
loadlibrary('dynamixel','dynamixel.h');

Do you know why?

thanks

tician
07-20-2011, 08:03 AM
Testing with Matlab 7.0.4 was giving the same error (except it is spitting out 'C:\Program' instead of 'cl'). Apparently there is a known bug (http://www.mathworks.fr/matlabcentral/newsreader/view_thread/93227) in older versions of loadlibrary, but the first response in that thread fixed it. I could have sworn I tested the examples with Matlab 7.0.4 last year, but I guess the GA and NN toolbox (re-?)installations earlier this year might have required a complete reinstall that broke it.

It works fine by default on Matlab 2006a (and probably 2010b, but I can't test it right now because the license was transferred to another machine).

Note: Setting up the Windows environment variables (http://support.robotis.com/en/techsupport_eng.htm#software/dynamixel_sdk/usb2dynamixel/usb2dxl_windows.htm) only affects programs compiled to run directly on Windows and does not affect the Matlab environment. Also, does the other program (SyncWrite.m) get past that same point (loadlibrary(...))?

cybernetics
07-20-2011, 09:27 AM
it works fine on Matlab 2006a (and probably 2010b, [...]

I've got Matlab R2010a (7.10.0) and R2011a (7.12.0). Since the beginning I was using the 7.10.0 version. Now that I've try with the 7.12.0 I've got a different error:


??? Error using ==> loadlibrary at 264
A 'Selected' compiler was not found. You may need to run mex -setup.

Error in ==> ReadWrite at 38
loadlibrary('dynamixel','dynamixel.h');

So I'll try to procure myself another version.


Note: Setting up the Windows environment variables only affects programs compiled to run directly on Windows and does not affect the Matlab environment.

Oh ok.


Also, does the other program (SyncWrite.m) get past that same point (loadlibrary(...))?

No :sad: it gets the same problem.

tician
07-20-2011, 10:06 AM
Working fine on two WinXP 32-bit machines using Matlab 7.0.4 (after the 'loadlibrary.m' line edit), R2006a, and R2010b (7.11.0). The only thing it has complained about was the lack of an endline at the end of the header file (just a warning and not an error).

Did you add the two folders ('bin' and 'import') to the Matlab path for each version you tried? Did you try running 'mex -setup' for R2011a (I seem to remember getting this error before, but do not remember when or why)? Did you attempt the fix listed in that thread for 7.10.0 (be sure to back up the original 'loadlibrary.m' before you modify it)?

cybernetics
07-20-2011, 12:48 PM
after the 'loadlibrary.m' line edit
If you mean puting "'dynamixel.h" instead of "dxl_matlab.h", I've done it.


Did you add the two folders ('bin' and 'import') to the Matlab path for each version you tried?
Yes.


Did you try running 'mex -setup' for R2011a

This is what I've got:


mex -setup
Please choose your compiler for building external interface (MEX) files:

Would you like mex to locate installed compilers [y]/n? y

Select a compiler:
[1] Microsoft Visual C++ 2008 SP1 in C:\Program Files (x86)\Microsoft Visual 9.0

[0] None

Compiler: 1

Please verify your choices:

Compiler: Microsoft Visual C++ 2008 SP1
Location: C:\Program Files (x86)\Microsoft Visual Studio 9.0

Are these correct [y]/n? y

************************************************** ***************************
Error: Could not find the 64-bit compiler. This may indicate that the
"" or the Microsoft Windows Software
Development Kit (SDK) is not installed. To build 64-bit MEX-files
Microsoft Visual C++ 2008 requires that these two packages are
installed properly.
************************************************** ***************************

Trying to update options file: C:\Users\LiberT\AppData\Roaming\MathWorks\MATLAB\R 2010a\mexopts.bat
From template: C:\PROGRA~1\MATLAB\R2010a\bin\win64\mexopts\msvc90 opts.bat

Done . . .

************************************************** ************************
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. In the near future
you will be required to update your code to utilize the new
API. You can find more information about this at:
http://www.mathworks.com/support/solutions/en/data/1-5C27B9/?solution=1-5C27B9
Building with the -largeArrayDims option enables the new API.
************************************************** ************************

So I could install these programs: "X64 Compilers and Tools" or the Microsoft Windows Software Development Kit (SDK)

But now, I've try on a 32 bits computer (instead of a 64 bit) with Matlab R2008a (7.6.0) (instead of a newer version) and now with the two previous mentionned programs (I think) and it almost works. Here is a part of the output


Succeed to open USB2Dynamixel!
Do you want more? Y/N [Y]: Y
COMM_RXTIMEOUT: There is no status packet!
Do you want more? Y/N [Y]: Y
COMM_RXTIMEOUT: There is no status packet!
Do you want more? Y/N [Y]: N

So it opens, but for a unknown reason it doesn't seem to communicate with the servo. I've try with other servos and wires; I made sure that the ID in the program correspond with the servo I was working with; I've try the three options with USB2Dynamixel (but I think the good one is the "RS232"), and it still doesn't work.


Did you attempt the fix listed in that thread for 7.10.0 (be sure to back up the original 'loadlibrary.m' before you modify it)?
hummm... what do you mean?

ADDED (ie. edit):

I've also try to pass through my CM-510 instead of directly connecting a wire to the USB2Dynamixel, and now I get another error:


COMM_TXFAIL: Failed transmit instruction packet!

tician
07-20-2011, 01:29 PM
Sorry for even mentioning the modify 'loadlibrary.m' thing again. Your newer versions of Matlab are very unlikely to have the problem in that thread I linked to earlier about the bug and 'loadlibrary.m' not being able to handle spaces. I only asked because the error message you gave was pretty close to what I was receiving with Matlab 7.0.4. Specifically:

??? Error using ==> loadlibrary
Failed to preprocess the input file.
Output from preprocessor is:'C:\Program' is not recognized as an
internal or external command, operable program or batch file.
Since you have the x86 compiler installed, maybe try using the 32-bit version of the sdk on your 64-bit computer. Couldn't hurt to try.


The 'dynamixel' library is intended to allow a PC to interface directly with the servos over 'TTL' or 'RS-485' through a USB2Dynamixel or similar device. Using the library with AX/MX series servos, the USB2Dynamixel should be set to 'TTL' with the servos connected directly to the three pin connector. It is very important to note that the USB2Dynamixel provides no power to the servos (only connects to GND and DATA lines). So, you must supply an external power source for the servos, either an SMPS2Dynamixel or a CM-5/510/700 (just connect the three pin connector and turn it on with a battery or 12V SMPS).

cybernetics
07-21-2011, 12:03 PM
Now it works on the computer with Matlab 2008, so even it does not work on my laptop (probably because I don't have these programs: "X64 Compilers and Tools" and the Microsoft Windows Software Development Kit (SDK)), it doesn't matter.


USB2Dynamixel provides no power to the servos
oh that was one of the reasons it didn't worked

Thanks!