December 3, 2012
- Also added a BlueTooth connection to Henkie (next to Ada).
- Performed COM_OpenNXT('C:\cygwin\home\arnoud\matlab\RWTHMindstormsNXT\tools\bluetooth.ini'), as suggested by , but the result is that the Remote ID is invalide (NXT-MAC=00:16:53:0a:9d:b3). Maybe I should specify the channel (currently 1, while the com-port is 4). For Henkie the mac-address is 00:16:53:0d:a3:c2 and the com-port 6).
- Tried it again based on name only. This time the call succeeds, but returns that there is no open bluetooth connection available with name Ada (and channel 4).
- Read the help about BlueTooth. Did a call to instrhwinfo('BlueTooth'). Received that the RemoteNames are 'Ada' and 'Henkie' and the RemoteIDs 'btspp://0016530A9DB3' and 'btspp://0016530DA3C2'. Because the string 'btspp://' is catenated in front of the ID, the ID of Ada and Henkie should be 0016530A9DB3 and 0016530DA3C2. With this ID (and Channel 1) I got connection to Ada:
.
- Example_4_NextGenerationUltrasound needs an USB connection, but Example_5_MoveUpAndDown works with BlueTooth.
- The Example_6_MultiNxt uses one USB and two Bluetooth robots. Edited Example_6 with correct Bluetooth IDs (didn't find USB MAC yet).
- Performed COM_CloseNXT('all'), followed by COM_OpenNXT with DebugMode on. Result:
>> COM_OpenNXT
Opening USB connection...
- Loading library "libusb"... done.
. initializing libusb.
- Browsing USB busses
. finding busses... done.
. finding devices... done.
. getting root bus object... done.
- Enumerating busses and devices
No NXT found using "libusb".
Trying to load "Fantom" instead.
Please make sure that "libusb" is present and your NXT is installed correctly.
- Loading library "fantom"... failed.
- Running Example_5 results that only Ada turns here arm (not that strange, because the USB-one doesn't have an arm and Henkie is gone to sleep). Also Example_1_Playtone doesn't work anymore (also not on Henkie).
- The ID of the third robot (NXT) is 00165311B9B3.
- Only COM_OpenNXT('C:\cygwin\home\arnoud\matlab\RWTHMindstormsNXT\tools\bluetooth_ada.ini') works, connecting to _henkie or _nxt fails.
- Maybe I should restart MatLab / my labtop :-).
November 29, 2012
- Checked my PATH on nb-udk. Suspicious about twice a .Net\Framework (both v4.0 and v3.5). This is set in VS2010\VC\bin\vcvars32.bat and seems intended. The user PATh is last (starting with the current directory '.'. The user-PATH is last (starting with the current directory '.'). The system-PATH starts with NVIDIA.
- Looked for libusb_win32. libusb.lib exist in libusb-win32-bin-1.2.6.0 and libusb0.dll exist at several places.
- Tested COM_OpenNXT in Matlab. The trick with the inf-wizard seems to have worked:
- Continue with the Installation step Try de examples. PlayTone gives atone and returns voltage=7657. ReadSoundSensor gives 104 dB (just airconditioner) vs 415 dB (hitting ring on table). I passed a copycup three times in front of the ultrasound sensor (on a distance of ~20 cm):
The fifth demo swings the arm around (instead of UpAndDown as intended by RWTH).
- For the sixth demo I need Bluetooth. Checked installation instructions and checked that I have the Instrument Control Toolbox (by typing instrhwinfo):
- Introduced the Abe Bluetooth Dongle. Supports Bluetooth v2.0+EDR, was recognized as Bluetooth v3.0 device. Device installation needed a restart, but installation didn't continue (device didn't start). Checked Bluetooth instructions at mindstorm. Removing the device and searching agian to a new device solved the issue:
- I have the feeling that nb-udk has already Bluetooth (Intel Centrino). Tried to install Generic Radio from Cambridge (which is the supported chipset according to mindstorms). Still device didn't start up. Tried Microsoft Bluetooth transiever v2.0 (same result). With v1.0 it works. After some tries with the exchanging the code I finally got connection (on COM4 and COM5). Checking BlueTooth operations, I see the address 00:16:53:0a:9d:b3 for Ada.
November 26, 2012
- Starting with addpath '\cygwin\home\arnoud\matlab\RWTHMindstormsNXT\demos'. COM_OpenNXT was not known yet. Also added RWTHMindstormsNXT\. and RWTHMindstormsNXT\tools. Now COM_OpenNXT fails on 'The "libusb_win32" library could not be loaded.'
- Checked installation in C:\Packages with instructions on libusb wiki. Run the inf-wizard, but the NXT was not recognized as device and installing the drivers with the inf created by the inf-wizard were not recognized as the correct ones.
- Following the instruction from the FAQ, I downloaded the 64-bit driver from RoboTC. Running from the DeviceManager didn't work, but running the autorun.exe form RoboTC solved the issue. Yet, running TestLibUsb didn't show any devices:
- Rerun the inf-wizard, but still same response. Reread documentation and rerun inf-wizard, this time selecting the Nxt (recognizable because I installed the 64bits driver from RoboTC). This time the TestLibUsb shows the Nxt device:
November 25, 2012
- vp_api_start_thread_tab is part of C:\svn\ARdroneMap\cpp\ardrone_slam\Release\ARDroneAPI-2.0.lib. Try to build a Win32 verion of ARDroneAPI.lib
- FFMPEG_SUPPORT has to be defined for video_decoder_config_t.
- Added C:\src\libpgm-5.1.118\openpgm\pgm\include to the include-list (74 errors left).
- Added C:\svn\ARdroneMap\ARDrone_SDK_2_0\ARDroneLib\FFMPEG\ffmpeg-20120708-git-299387e-win64-dev\include. Succesfull build C:\svn\ARdroneMap\cpp\ardrone_slam\Win32\Release\ARDroneAPI-2.0.lib
- Should also made a Win32 version of ardronewin32 (102 errors left). Added FFMPEG_SUPPORT and C:\svn\ARdroneMap\ARDrone_SDK_2_0\ARDroneLib\FFMPEG\ffmpeg-20120708-git-299387e-win64-dev\include (1 error left).
- Could build ardronewin32, but got some missing references and some conflicts (245 errors):
1>ardronewin32.lib(ardrone_tool_win32.obj) : error LNK2005: _ardrone_navdata_handler_table already defined in navdata.obj
1>ardronewin32.lib(ardrone_tool_win32.obj) : error LNK2005: _threadTable already defined in ardrone_autopylot.obj
1>ardronewin32.lib(ardrone_tool_win32.obj) : error LNK2005: _ardrone_tool_exit already defined in ardrone_autopylot.obj
1>ardronewin32.lib(ardrone_tool_win32.obj) : error LNK2005: _ardrone_tool_shutdown_custom already defined in ardrone_autopylot.obj
1>ardronewin32.lib(ardrone_tool_win32.obj) : error LNK2005: _ardrone_tool_init_custom already defined in ardrone_autopylot.obj
Removed ardronewin32.lib, 245 errors left.
- Added /NODEFAULTLIB:"libcmt.lib" (91 errors left).
- Downloaded ffmpeg-20120708-git-299387e-win32-dev from http://ffmpeg.zeranoe.com/builds/ (74 errors left). Used 32bits Window Kits (13 errors left).
- Two of them are about pgm, so checked instructions from openpgm.
- Finally the autopylot compiled and linked, but fails to run:
November 23, 2012
- Was able to build a Makefile which could be compiled by Nmake.
- Adding the different source-files.
- The GamePad uses linux/joystick.h. This file defines i.e. js_event. There is not really a Windows equivalent (part of DirectX and Windows SDK kit). Best solution seems the Cross Platform Utilities (CxUtils) Library.
- I will first look if I can remove the call to gamepad function.
November 22, 2012
- The autopylot project is now upgraded to version 2.0 of the AR.Drone SDK.
- Will first try to build ardrone_autopylot with Python2.7 interface. Adjusted the ardrone.makefile and called nmake -f Makefile in the VS2010 developer prompt. Fails on non-supported +-macro in Makefile.
- Corrected many parts for nmake. On the end, nothing happens because I am missing the program to be made.
- Looked at Python and Matlab scripts autopilot_agent.py and autopilot_agent.m. Strange enough both claim that they should be called by ./autopilot and not directly.
November 20, 2012
- Finally, Matlab is installed on my nb-udk.
November 15, 2012
- Searched for an AR.Drone Matlab interface. Found the package from Simon Levy, which seems to support it for Linux 64bits. The AR.Drone version is not clear (at least 1.8). The autopilot.c does the same call to the video_stage thread (NULL parameters), so it seems to be made for 1.8.
- Found a MatLab script to create connection (NAVDATA) to the AR.Drone). The first line (ARc = udp('192.168.1.1', 5556, 'LocalPort', 5556); was not recognized by Octave. Yet, the Drone v1 sends video over udp, the Drone v2 over tcp.
- Found a github projecct for .NET; yet the last update was 11 month ago, so I am afraid that it doesn't support API-2.0.
- In the Linux/Testbenches the video_stage is also called with NULL, the thread is started with params in Linux/Navigation/Sources/common/mobile_main.c. Note that this example also does START_THREAD(raw_capture, &cfg); and START_THREAD(remote_console, &cfg);. The section /*** VIDEO STAGE CONFIG ***/ is 92 lines long.
- Added VIDEO STAGE CONFIG code in a block (to be able to define new parameters). 47 errors left. Added definitions from C:\svn\ARdroneMap\ARDrone_SDK_2_0\Examples\Linux\Navigation\Sources\ihm\ihm_stages_o_gtk.h; 23 errors left. Also added gtk_funcs; 0 compilation errors left.
- 4 external functions were not defined, so added those from C:\svn\ARdroneMap\ARDrone_SDK_2_0\Examples\Linux\Navigation\Sources\ihm\ihm_stages_o_gtk.c. No linking errors left.
- Tested program with AR.Drone 2.0. Program crashes in video_com_multisocket_stage_open, because the number of sockets in the config is 3727312. Strange, because the cfg is one of the stage->cfg, which is one of the pipeline->stages. Yet the pipeline->nb_stages is 0, so the call to video_com_multisocket via function_open should never be made.
- Started to debug from ardrone_slam. Added the libraries and library-directories from ardrone_lcm_proxy, yet still I have 107 linking errors.
- Followed the suggestion of the Microsoft forum, which indicates that the __imp___CrtDbgReportW error occurs for Debug only, and could be solved by changing /MDd to /MTd (option C->Code Generation->Runtime Library). The working code has it on /MD.
- Defined _DEBUG for ardrone_slam, rebuild everything. Got unresolved symbol_fltused (1169 errors). Added msvcrt.lib again; 10 errors left. Remaining error seems to be related with hid.lib; unresolved external symbol __imp_SetupDiDestroyDeviceInfoList. Adding Setupapi.lib solved this issue. Only remaining was the CrtDbgReportW, which was removed by not longer excludin msvcrtd.lib (if msvcrt.lib is no problem, msvcrtd.lib should also be no problem).
- Program is running, but received again the ftp_client stack corrupt error.
- Seems that same dll are loaded, main difference seems to be Debug vs Release. Tried to build ardrone_slam Release|Release (19 compilation errors). Added include-directories (128 linking errors left). Added libraries and library-directories (12 errors left). Added preprocessor definitions (4 errors left). Added Setupapi.lib -> build succeeded.
- The information of the debugger of the Release code seems incorrect: a print indicates that there are 7 stages (while debugger shows a huge number. nb_stage is an uint32). I am suspisious about wifi_config_socket in function test_drone_connection of ardrone_tool_win32: the compiler gives a warning that the memory copy is too small.
- Will try to make ardrone_slam again as 32bits executable.
November 14, 2012
- Protected the second implementation of clz with an IFDEF, corrected incorrect inline in win32/intrin.h of VP_SDK. Still some old libraries were loaded, removed old ones to prevent confusion (not all x64 libs are produced in x64-directories. Finally, the ftp_client stack error is solved: now I have an access violation in config_wifi.c:
- Added protection against IPv6 address, which solves wifi_config error (together with VP_COM_NAME_MAXSIZE-1 instead of VP_COM_NAME_MAXSIZE).
- Program now continues: fails on video_stage, which is a thread which is started from adrone_tool_win32 with parameter NULL. Yet, video_stage expects a quite extensive structure in the parameter:
November 13, 2012
- I removed the errors related with __impl_yaml by adding YAML_DECLARE_STATIC to both the 64bits yaml-project and ardrone_slam (which reads the yaml.h file).
This moved the errors to some missing yaml-functions, but this was because in the configuration-manager yaml was not set to x64 (still Win32).
- Now the program works (program crashes, probably because no connection with the AR.Drone can be made). The program fails in test_drone_connection, which tries to call failwithmessage.
- Also connected to the AR.Drone the program fails, because the stack around the ftp_client is corrupted. This is the same error where I ended on June 24. This is located in ardronewin32, which is still 32bits, so I try to make x64 version of adronewin32. 52 errors (both in API-2.0 and adronewin32).
- Analyzed differences between x64 and Win32. Debug!x64 has FFMPEG_SUPPORT defined and $(ARDroneLibDir)\FFMPEG\ffmpeg-20120708-git-299387e-win64-dev\include. Release|x64 is missing NO_ARDRONE_MAINLOOP;FFMPEG_SUPPORT and has quite a number of differences in include-directories. Adding those two definition and directory solved the issues (only problem is missing ARDroneAPI.lib).
- Added same definitions and include-directory; 4 errors left.
November 12, 2012
- The new omnicam is ready, I checked the image via Dell OmniCam Central:
.
- Downloaded AR.Drone API version 2.0 from ardrone.org. The version-number is equivalent with the version released in 2009, but this file is uploaded on June 2012, so it seems to contain some updates. Yet, the size is equivalent with the file I downloaded on April 7, 2012.
- The SDK is installed in C:\svn\ARdroneMap\ARDrone_SDK_2_0 (not in Programs as version 1.8).
- Copied LcmProxy into ARdroneMap. Should replace usarSimConnection.Send commands in MessageReceived (line 817) with ARDrone commands.
- Couldn't load adrone_slam project with VS2010. Reloading projects gives error 'MSBuild does not contain a value for the "VCTargetsPath" property. According to stackoverflow, this is due to my installation of the preview of VS2011. I should repair the registry keyes as suggested on the stackoverflow forum. I added in the Wow6432Node a VCTargetsPath (and set it to $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0@VCTargetsPath). Now I get the error 'tforms root directory "$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0@VCTargetsPath)\Platforms" does not exist.' Updated the Registry Key to $(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\, which results in the error: 'C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.'. Strange, because the Default.props file does exist, precisely on that location. I will try a restart.
- Restart didn't help. My impression is that there is a problem with the space in the path. Replaced the Registry with explicit path C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\; now VS2010 loads all C-projects without problems.
- ardrone_slam's main-routine calls bot_ardrone, which calls for the real interface bot_ardrone_ardronelib. This routine starts a seperate thread:
// start thread
printf("Connecting to AR.Drone\n");
ardrone_ready = CreateEvent(NULL, false, false, NULL);
ardronewin32();
// wait untill the Drone is completely ready (communication started)
WaitForSingleObject(ardrone_ready, INFINITE);
printf("AR.Drone is ready\n");
- It looks like the control-interface (in ardrone_tool_win32) consists of three functions ardronewin32_take_off, ardronewin32_progress and ardronewin32_land.
- ardronewin32_progress is called by bot_ardrone_ardronelib::control_update, which is called by bot_ardrone::control_update.
- The control datastructure is first set, before the control_update is executed. In bot_ardrone_3dmouse the four velocities are set as follows:
control_set(BOT_ARDRONE_Velocity, BOT_ARDRONE_LinearVelocity, Mvel.at(0));
control_set(BOT_ARDRONE_Velocity, BOT_ARDRONE_LateralVelocity, Mvel.at(1));
control_set(BOT_ARDRONE_Velocity, BOT_ARDRONE_AltitudeVelocity, Mvel.at(2));
control_set(BOT_ARDRONE_Velocity, BOT_ARDRONE_RotationalVelocity, (float) pDev->allDOFs[5] / 350.0f);
Note that the vector Mvel is created by multiplication with the current rotation-matrix.
- In bot_adrone_behavior the AltitudeVelocity remains constant and the RotationalVelocity is directly calculated:
control_set(BOT_ARDRONE_Velocity, BOT_ARDRONE_LinearVelocity, Mvel.at(0));
control_set(BOT_ARDRONE_Velocity, BOT_ARDRONE_LateralVelocity, Mvel.at(1));
control_set(BOT_ARDRONE_Velocity, BOT_ARDRONE_RotationalVelocity, v_yaw);
- The keyboard interface increases/decreases the LinearVelocity (up/down), LateralVelocity (left/right), AltitudeVelocity (w/s) and RotationalVelocity (a/d) seperately.
- Made a sort of interface from LcmProxy to bot_ardrone. Should make a C#-wrapper around C-code?! Looked at some suggestions at stackoverflow forum, but writing a wrapper seems a lot of work.
- Made a very simple main, which relies on ardrone_slam as library class.
Project compiles and links, but program gives error (couldn't start (0xc000007b)). This cryptic message seems to indicate that some of the dynamic libraries are 64bits. Try again to build project as 64bits.
- Have to redefine all include and link dependencies. 26 unresolved issues left (mainly related with codecs). Added avcodec.lib from ARDroneLib/FFMPEG (16 issues left). avutil.lib (12 left). swscale.lib (9 left). Added libpgm.lib (see Imav Labbook)(8 left). Added Iphlpapi.lib (7 left). Last seven are __imp_yaml_-functions.
November 8, 2012
- Also added addpath "/home/arnoud/matlab/RWTHMindstormsNXT/demos".
- Downloaded NeXTTool and extracted tool in tools/MotorControl (as instructed by README.txt. Running this program gives no information (other than run -help for more information).
- Running COM_OpenNXT in octave gave the following error: 'libisloaded' function is not yet implemented in Octave'. See missing functions.
November 5, 2012
- Checked my old labtops. nb-unreal has MatLab 7.1, nb-avmovie has MatLab 6.5. Both need a licence-server, which is no longer available.
- libusb is already installed in C:\Packages.
- Installed octave as part of cygwin.
- Downloaded already RWTHMindstormsNXTv4.07.zip, unpacked it in /home/arnoud/matlab. Typed addpath "/home/arnoud/matlab/RWTHMindstormsNXT"and addpath "/home/arnoud/matlab/RWTHMindstormsNXT/tools".
October 29, 2012
- Looking at ROS for Windows Tutorials. Started with Microsoft Studio.
- In my PATH is C:\Programs\Python26. My version of Python2.7 is 2.7.3 (one too high), and I don't have Python27\Scripts.
- Updated PATH, installed pywin32 in Python27\Lib\site-packages.
- Installed PyYAML-3.10.
- Installed PySetupTools in Python27\Lib\site-packages.
- For Rospkg I could choose between Python26 and Python27 (choose only Python27).
- The WinRos SDK 0.1.3 was corrupted. Tried again.
- In the mean time, I installed DllExportViewer, as suggested by Debugging Tutorial. The last three lines of Windows.cmake I uncommented.
- Finally, WinRos SDK was downloaded and seems to work:
- Followed the instructions from RWTH; installed LibUSB in C:/Packages.
October 25, 2012
- The first lecture has at the end four PR2 videos: Fold towels, Fetch beer, Clean-up with cart and Navigation. Search through Davide's videos for those four.
- Looking for the different video's in Davide's Introducion. Found Shrimp_Stair.avi at Siegwart's Space Robotics presentation, but had difficulty to play the avi. Installed DivX-codec, as suggested by QuickTime. The DivX-player cannot play it, but VLC now can. Downloaded ffdshow. Still, no success inside PowerPoint (try again after restarting).
- Found a IEEE sponsored site with all video's related to this course.
Previous Labbooks