Difference between revisions of "CORO Software Development Environment"

From David Vernon's Wiki
Jump to: navigation, search
 
(36 intermediate revisions by the same user not shown)
Line 1: Line 1:
This guide provides a step-by-step guide to downloading, installing, and using the software required to submit an assignment for course 04-801 Cognitive Robotics. This environment is required to ensure that software developed by students can be compiled directly by the course instructor after it has been submitted.
+
This page provides a step-by-step guide to downloading, installing, and using the software required to run the robot vision and robot manipulation demonstration software [http://www.vernon.eu/cognitive_robotics/index.htm Introduction to Cognitive Robotics] on a physical Lynxmotion AL5D robot and a USB camera. This software runs on Windows 10.  
  
=== Operating System ===
+
There is a separate guide for the software that runs on Ubuntu and uses robot simulators, i.e. the mobile robot, robot manipulation, robot vision, and CRAM software using ROS.
  
I assume you are running Windows 7.
+
<span style="color:#FF0000"> Follow these instructions exactly as they are stated. Do not be tempted to skip through them, assuming that you will be able to figure it out yourself.  You might, but it is more likely you will miss something small but important and it won't work as required.  Take your time, follow these instructions carefully, and everything will work.
 +
 
 +
 
 +
=== Operating System ===
  
I strongly recommend you turn off the option in Windows Explorer to hide file extensions. To do this, from Windows Explorer menu bar select Tools > Folder Options > View and make sure the tick box labelled Hide extensions for known file types is not ticked. If it is ticked, you will have problems identifying certain files later on (e.g. invoking the example.sln solution file to launch the C++ compiler).
+
I assume you are running Windows 10.  
  
If the Windows Explorer menu bar isn't visible, select Organize > Layout > Menu bar
+
I strongly recommend you turn off the option in Windows Explorer to hide file extensions. To do this, open File Explorer, click the View tab and click on the file name extensions checkbox so that it shows a tick. If it is ticked, you will have problems identifying certain files later on (e.g. invoking the <code>example.sln</code> solution file to launch the C++ compiler).
  
 
=== C/C++ Compiler ===  
 
=== C/C++ Compiler ===  
Line 17: Line 20:
 
Run the installer and follow the instructions.
 
Run the installer and follow the instructions.
  
Some versions of Windows 7 may need the the Microsoft Visual Studio 2010 Service Pack 1 to be installed.  If you have problems with CMake (see below) this is almost certainly the cause.  Download and install Service Pack 1 by from [http://www.vernon.eu/downloads/VS10sp1-KB983509.exe here].  You can check to see whether or not you have Service Pack 1 by checking the your version number:  from the Microsoft Visual C++ 2010 Express menu, select ''Help > About Visual C++ 2010 Express''.  You will see a message on the top right something like the following.
+
You will need to register Visual C++ 2010 Express to continue using beyond the initial 30-day evaluation period. To do this, from the Microsoft Visual C++ 2010 Express menu, select ''Help > Register Product''.  A pop-up will be displayed. Click on the Obtain a registration key online buttonYou will then have to log in to your Microsoft account, if you have one, or create a new one, if you don't. After filling in some forms you will receive the product key which you enter into the dialogue box that popped up when you selected ''Help > Register Product''.  If you see an error message as shown below, click on the Microsoft icon on the top left corner of the page. This will redirect you to the Microsoft’s login page. Log into your Microsoft account from here and begin the process again, i.e. select ''Help > Register Product''For more detailed instructions, see [http://www.vernon.eu/DSA/Registration_Key_Error_Resolution.pdf here].
 
+
  Microsoft Visual Studio 2010
+
Version 10.0.40219.1 RTMRel
+
Microsoft .NET Framework
+
Version 4.0.30319 RTMRel
+
 
+
The <code>RTMRel</code> means <code>Release To Manufacturing</code>.  If you have Service Pack 1 installed you would see something like the following.
+
 
+
Microsoft Visual Studio 2010
+
Version 10.0.40219.1 SP1Rel
+
  Microsoft .NET Framework
+
Version 4.0.30319 SP1Rel
+
  
 
=== CMake ===
 
=== CMake ===
Download CMake binaries from [http://www.cmake.org/download/ here].  At time of writing the latest version is 3.7.1.
+
Download CMake binaries from [http://www.cmake.org/download/ here].  At time of writing the latest version is 3.16.2.
 
<!-- Download CMake 2.8.10-RC3 binaries from [https://cmake.org/files/v2.8/cmake-2.8.10-rc3-win32-x86.exe here] -->
 
<!-- Download CMake 2.8.10-RC3 binaries from [https://cmake.org/files/v2.8/cmake-2.8.10-rc3-win32-x86.exe here] -->
  
You can opt for either the WIN32 installer (cmake-3.7.1-win32-x86.msi) or the Windows zip file.  The installer has the advantage that it gives you the option to update your system path automatically (which you should take by clicking the appropriate radio button during the installation process). If you choose the installer option, note that if you already have CMake version 3.4 or earlier you much uninstall it first.
+
You can opt for either the WIN32 installer (cmake-3.16.2-win32-x86.msi) or the Windows zip file.  The installer has the advantage that it gives you the option to update your system path automatically (which you should take by clicking the appropriate radio button during the installation process). If you choose the installer option, note that if you already have CMake version 3.4 or earlier you much uninstall it first.
 
+
  
 
=== OpenCV ===
 
=== OpenCV ===
Download and install OpenCV from [https://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.4.9/ here]. Choose the version 2.4.9 self-installer, download it, and execute it, and extract the library to <code>C:</code>.
+
Download and install OpenCV from [https://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.4.10/ here]. Choose the version 2.4.10 self-installer, download it, and execute it, and extract the library to <code>C:</code> so that you have a directory <code>C:\opencv</code>.  If you have problems downloading this version from SourceForge site, you can download version 2.4.10 from [http://www.vernon.eu/downloads/opencv-2.4.10.exe here].
  
 
Add <code>C:\opencv\build\x86\vc10\bin</code> to the <code>PATH</code> environment variable and add a new environment variable <code>OPENCV_DIR</code> with the value <code>C:\opencv\build</code>, as follows.
 
Add <code>C:\opencv\build\x86\vc10\bin</code> to the <code>PATH</code> environment variable and add a new environment variable <code>OPENCV_DIR</code> with the value <code>C:\opencv\build</code>, as follows.
  
From Windows 7 toolbar, select ''Control Panel > System and Security > System > Advanced System Settings''
+
* From Windows 10 toolbar, select ''Settings''
Click ''Environment Variables''
+
* Type ''Environment Variables''  in the ''Find a Setting'' dialogue box. This will bring up a new ''Systems Properties'' window.
Select '<code>Path'</code> from ''System Variables''
+
* Click the ''Environment Variables ...'' button. This will bring up a new ''Environment Variables'' window.
Click ''Edit''
+
* Select ''Path'' from ''System Variables''. Click ''Edit''.  Click ''New'' and insert <code>C:\opencv\build\x86\vc10\bin</code>. Click ''OK''. 
Add <code>C:\opencv\build\x86\vc10\bin</code> (be sure to separate different paths with a semi-colon)
+
* Under ''User variables'', click ''New''. Insert <code>OPENCV_DIR</code> in the ''Variable name'' box and <code>C:\opencv\build</code> in the ''Variable value'' box. Click ''OK''. 
Under ''User variables'', click ''New''
+
* Click ''OK'' in the ''Environment Variables'' window.
Insert <code>OPENCV_DIR</code> in the ''Variable name'' box and <code>C:\opencv\build</code> in the ''Variable value'' box
+
* Click ''OK'' in the ''Systems Properties'' window.
Click ''OK''
+
  
 +
=== CORO Repository ===
  
=== 04-801 Data Structures and Algorithms for Engineers Repository ===
+
Copy the CORO repository to the <code>C:</code>  drive:
  
Copy the 04-801 repository to the <code>C:</code> drive:
+
* Download a zip archive with all the files from  [http://www.vernon.eu/cognitive_robotics/CORO.zip here].
 +
* Copy it to <code>C:</code> drive and unzip it so that you have a directory called <code>C:\CORO</code>.
  
* Download a zip archive with all the files from [http://www.vernon.eu/downloads/04-801.zip here].
+
<code>C:\CORO</code> has with a sub-directory structure explained in the course notes. For our purposes here, there is an <code>C:\CORO\assignments</code>  directory and it will contain an example <code>C:\CORO\assignments\assignment0</code> sub-directory. Later on, you will generate <code>C:\CORO\assignments\assignment1</code> and <code>C:\CORO\assignments\assignment2</code>, and so on.
* Copy it to <code>C:</code> drive and unzip it so that you have a directory called <code>C:\04-801</code>.
+
  
 +
There is also a <code>C:\CORO\lectures</code> sub-directory. This has code from the lectures: the source code is in the <code>C:\CORO\lectures\src</code> sub-directory and test data is in the <code>C:\CORO\lectures\data</code> sub-directory.
  
<code>C:\04-801</code> has with a sub-directory structure explained in class. For our purposes here, there is an  <code>C:\04-801\assignments</code>  directory and it will contain an example <code>C:\04-801\assignments\assignment0</code> sub-directory. Later on, you will generate <code>C:\04-801\assignments\assignment1</code> and <code>C:\04-801\assignments\assignment2</code>, and so on.
+
The next step is to build a MSVC++ <code>.sln</code> solution file so that you can compile the CORO assignment0 executable. To do this, you need to run CMake against the <code>C:\CORO\assignments\assignment0</code> directory (where you will find the main <code>CMakeLists.txt</code> file).    We use <code>assignment0</code> because it is a dummy assignment but you will follow exactly the same procedure for all the real assignments.
  
There is also a <code>C:\04-801\lectures</code> sub-directory. Later, I will make available the code from the lectures together with instructions on how to add it to the repository: the source code will go in the <code>C:\04-801\lectures\src</code> sub-directory and test data will go in the <code>C:\04-801\lectures\data</code> sub-directory.
+
* Launch the CMake GUI from the Windows 10 toolbar.
  
 +
* In the ''Where is the source code:'' type (or browse to)  <code>C:\CORO\assignments\assignment0</code>
  
The next step is to build a MSVC++ <code>.sln</code> solution file so that you can compile the 04-801 assignment0 executable. To do this, you need to run CMake against the <code>C:04-801\assignments\assignment0</code> directory (where you will find the main <code>CMakeLists.txt</code> file).    We use <code>assignment0</code> because it is a dummy assignment but you will follow exactly the same procedure for all the real assignments.
+
* In the ''Where to build the binaries:'' type (or browse to) <code>C:\CORO\assignments\assignment0\build</code>
  
* Launch the CMake GUI from the Windows 7 toolbar.
+
* Select ''File > Delete Cache'' from the top menu (you '''must''' do this the first time in case there is an old invalid configuration in the CORO directory)
 
+
* In the ''Where is the source code:'' type (or browse to)  <code>C:\04-801\assignments\assignment0</code>
+
 
+
* In the ''Where to build the binaries:'' type (or browse to) <code>C:\04-801\assignments\assignment0\build</code>
+
 
+
* Select ''File > Delete Cache'' from the top menu (you '''must''' do this the first time in case there is an old invalid configuration in the 04-801 directory)
+
  
 
* Click ''Configure''
 
* Click ''Configure''
  
* Select Visual Studio 10 (2010) from the drop-down menu as the generator for the project
+
* Select ''Visual Studio 10 2010'' from the drop-down menu as the generator for the project
  
 
* Click ''Finish'' and watch CMake configure your project.  The dialogue box will still highlighted in red, so ...
 
* Click ''Finish'' and watch CMake configure your project.  The dialogue box will still highlighted in red, so ...
Line 84: Line 70:
 
* Click ''Configure'' two more times and everything should be fine.  
 
* Click ''Configure'' two more times and everything should be fine.  
  
* Click ''Generate''  to create the MSVC++ <code>assignment0.sln</code> file in the <code>C:\04-801\assignments\assignment0\build</code> directory.
+
* Click ''Generate''  to create the MSVC++ <code>assignment0.sln</code> file in the <code>C:\CORO\assignments\assignment0\build</code> directory.
  
  
Now you are ready to launch MSVC++ and build the 04-801 assignment0 executable.   
+
Now you are ready to launch MSVC++ and build the CORO assignment0 executable.   
  
* Go to the <code>C:\04-801\assignments\assignment0\build</code> directory and double-click the <code>assignment0.sln</code> file.  This launches Microsoft Visual C++ 2010 Express.
+
* Go to the <code>C:\CORO\assignments\assignment0\build</code> directory and double-click the <code>assignment0.sln</code> file.  This launches Microsoft Visual C++ 2010 Express. The first time, you may be presented with a pop-up window that asks you how you want to open the file. Select ''Microsoft Visual C++ 2010 Express'' and click on the checkbox to always use this application to open this file type.
  
* Select <code>Release</code> in the ''Solutions Configuration'' box.
+
* Select <code>Release</code> in the ''Solutions Configuration'' box (this is located left of centre on the toolbar and defaults to <code>Debug</code>).
  
 
* Select ''Build > Build Solution'' from the top menu, (if you don't see this and you see  ''Debug > Build Solution'' instead, it's probably because your IDE is set to basic settings. To change this, select ''Tools > Settings > Expert Settings'').
 
* Select ''Build > Build Solution'' from the top menu, (if you don't see this and you see  ''Debug > Build Solution'' instead, it's probably because your IDE is set to basic settings. To change this, select ''Tools > Settings > Expert Settings'').
  
This will compile and link the programs in the the <code>C:\04-801\assignments\assignment0\src</code> sub-directory and install then in the <code>C:\04-801\assignments\assignment0\bin</code> directory.  
+
This will compile and link the programs in the the <code>C:\CORO\assignments\assignment0\src</code> sub-directory and install then in the <code>C:\CORO\assignments\assignment0\bin</code> directory.  
  
  
Check to see that the example  <code>Vernon.exe</code> executable is there.  If it is not, then select  ''Build > Configuration Manager'' from the menu and make sure the ''INSTALL'' check-box is ticked.  Now rebuild the project again.   
+
Check to see that the example  <code>dvernon.exe</code> executable is there.  If it is not, then select  ''Build > Configuration Manager'' from the menu and make sure the ''INSTALL'' check-box is ticked.  Now rebuild the project again.   
  
 
'''Note that you will have to tick this check-box every time you rebuild the <code>.sln</code> solution file with CMake.'''  If you don't do this, then your new executable won't be installed in the <code>bin</code> directory and you'll end up becoming very confused because none of the changes you make to your source code will be reflected in the executable you run from the <code>bin</code> directory (because its an old version from a previous compilation).
 
'''Note that you will have to tick this check-box every time you rebuild the <code>.sln</code> solution file with CMake.'''  If you don't do this, then your new executable won't be installed in the <code>bin</code> directory and you'll end up becoming very confused because none of the changes you make to your source code will be reflected in the executable you run from the <code>bin</code> directory (because its an old version from a previous compilation).
  
  
Good!  Now you are now ready to run the example <code>Vernon.exe</code>  application that is provided with the 04-801 release. To do this, double click the< code>Vernon.exe</code> executable in <code>C:\04-801\assignments\assignment0\bin</code>.  Open <code>input.txt</code> file in <code>C:\04-801\assignments\assignment0\data</code>and, after running <code>Vernon.exe</code>, open the <code>output.txt</code> file, also in the <code>C:\04-801\assignments\assignment0\data</code> directory.
+
Good!  Now you are now ready to run the example <code>dvernon.exe</code>  application that is provided with the CORO release. To do this, double click the <code>dvernon.exe</code> executable in <code>C:\CORO\assignments\assignment0\bin</code>.  Open <code>input.txt</code> file in <code>C:\CORO\assignments\assignment0\data</code> and, after running <code>dvernon.exe</code>, open the <code>output.txt</code> file, also in the <code>C:\CORO\assignments\assignment0\data</code> directory.
  
  
 
Try creating your own (dummy) assignment program. To do this, follow the following steps.
 
Try creating your own (dummy) assignment program. To do this, follow the following steps.
  
* Create a directory with your name, e.g.  <code>C:\04-801\assignments\assignment0\src\Mylastname</code>
+
* Create a directory with your student Id, e.g.  <code>C:\CORO\assignments\assignment0\src\mystudentid</code>
* Copy the source files (<code>.c, .cpp, .h</code>) from the <code>Vernon</code> directory to the directory with your name.
+
* Copy the source files (<code>.c, .cpp, .h</code>) and the <code>CMakeLists.txt</code> file from the <code>dvernon</code> directory to the mystudentid directory.
* Edit the <code>C:\04-801\assignments\assignment0\src\CMakeLists.txt</code> file and replace <code>ADD_SUBDIRECTORY(Vernon)</code> with <code>ADD_SUBDIRECTORY(Mylastname)</code>, where <code>Mylastname</code> is your last name.   
+
* Edit the <code>C:\CORO\assignments\assignment0\src\CMakeLists.txt</code> file and replace <code>ADD_SUBDIRECTORY(dvernon)</code> with <code>ADD_SUBDIRECTORY(mystudentid)</code>, where <code>mystudentid</code> is your student number. 
 +
* Edit the <code>C:\CORO\assignments\assignment0\src\mystudentid\CMakeLists.txt</code> file and replace <code>dvernon</code> with <code>mystudentid</code>, where <code>mystudentid</code> is your student number.   
 
* Run CMake again.   
 
* Run CMake again.   
* Re-open the <code>assignment0.sln</code> file (remember, it's in the <code>C:\04-801\assignments\assignment0\build</code> directory).  
+
* Re-open the <code>assignment0.sln</code> file (remember, it's in the <code>C:\CORO\assignments\assignment0\build</code> directory).  
* Your files should now be visible (and the Vernon ones will no longer be there) and you can now compile your code and install it in the <code>bin</code> directory by selecting ''Build > Build Solution'' from the top menu.   
+
* Your files should now be visible (and the dvernon ones will no longer be there) and you can now compile your code and install it in the <code>bin</code> directory by selecting ''Build > Build Solution'' from the top menu.   
* Make sure that the ''INSTALL'' check-box is ticked when you select ''Build > Configuration Manager'' from the menu to ensure that your executable is installed in the <code>C:\04-801\assignments\assignment0\bin</code> directory.     
+
* Make sure that the ''INSTALL'' check-box is ticked when you select ''Build > Configuration Manager'' from the menu to ensure that your executable is installed in the <code>C:\CORO\assignments\assignment0\bin</code> directory.     
* Finally, run your program in the <code>C:\04-801\assignments\assignment0\bin</code> directory. You might like to change the contents of <code>input.txt</code> in the  <code>C:\04-801\assignments\assignment0\data</code> directory and re-run your program to convince yourself that everything is working properly.
+
* Finally, run your program in the <code>C:\CORO\assignments\assignment0\bin</code> directory. You might like to change the contents of <code>input.txt</code> in the  <code>C:\CORO\assignments\assignment0\data</code> directory and re-run your program to convince yourself that everything is working properly.
  
  
For your first assignment, you will simply copy the <code>assignment0</code> directory to <code>assignment1</code> and follow a similar procedure, writing new assignment-specific code, of course.  There are just one thing you need to do:  edit the <code>C:04-801\assignments\assignment1\CMakeLists.txt</code> and change the project name from <code>assignment0</code> to <code>assignment1</code>, viz:
+
For your first assignment, you will simply copy the <code>assignment0</code> directory to <code>assignment1</code> and follow a similar procedure, writing new assignment-specific code, of course.  There is just one thing you need to do:  edit the <code>C:CORO\assignments\assignment1\CMakeLists.txt</code> and change the project name from <code>assignment0</code> to <code>assignment1</code>, viz:
  
 
   ##############################################
 
   ##############################################
Line 131: Line 118:
  
  
When submitting an assignment, all you have to do is submit a zipped version of your <code>Mylastname</code> directory with your three source code files.
+
When submitting an assignment, all you have to do is submit a zipped version of your <code>mystudentid</code> directory with your three source code files.
 +
 
 +
The instructor simply has to unzip it and add it to the <code>src</code> directory on her or his computer, along with all the other students and her or his own solution, run CMake, launch the <code>.sln</code> file, compile, install, and check each executable in <code>bin</code> against the test data file in her or his <code>data</code> directory.  Because we build the solutions the same way, you are guaranteed that your code will compile, provided you have followed this procedure.
 +
 
 +
 
 +
The final step is to build a MSVC++ <code>.sln</code> solution file so that you can compile the DSA lectures executables. To do this, you need to run CMake against <code>C:\CORO\lectures</code> and <code>C:\CORO\lectures\build</code>, launch <code>C:\CORO\lectures\build\lectures.sln</code>, build the solution, making sure that the ''INSTALL'' check-box is ticked when you select ''Build > Configuration Manager'' from the menu to ensure that the demo executables are installed in the <code>C:\CORO\lectures\bin directory</code>.
 +
 
  
I simply unzip it and add it to the <code>src</code> directory on my computer, along with the all the other students and my own solution, run CMake, launch the <code>.sln</code> file, compile, install, and check each executable in <code>bin</code> against the test data file in my <code>data</code> directory.  Because we build the solutions the same way, you are guaranteed that your code will compile, provided you have followed this procedure.
+
----
 +
Back to [[Cognitive Robotics]]

Latest revision as of 12:21, 24 January 2021

This page provides a step-by-step guide to downloading, installing, and using the software required to run the robot vision and robot manipulation demonstration software Introduction to Cognitive Robotics on a physical Lynxmotion AL5D robot and a USB camera. This software runs on Windows 10.

There is a separate guide for the software that runs on Ubuntu and uses robot simulators, i.e. the mobile robot, robot manipulation, robot vision, and CRAM software using ROS.

Follow these instructions exactly as they are stated. Do not be tempted to skip through them, assuming that you will be able to figure it out yourself. You might, but it is more likely you will miss something small but important and it won't work as required. Take your time, follow these instructions carefully, and everything will work.


Operating System

I assume you are running Windows 10.

I strongly recommend you turn off the option in Windows Explorer to hide file extensions. To do this, open File Explorer, click the View tab and click on the file name extensions checkbox so that it shows a tick. If it is ticked, you will have problems identifying certain files later on (e.g. invoking the example.sln solution file to launch the C++ compiler).

C/C++ Compiler

Download the Microsoft Visual C++ Express compiler, version 10.0 (also known as Visual C++ 2010 or MSVC++ 2010). It is important to use this version; earlier versions are no longer supported by Microsoft and later versions cause problems with some libraries.

You can download the required installer from here.

Run the installer and follow the instructions.

You will need to register Visual C++ 2010 Express to continue using beyond the initial 30-day evaluation period. To do this, from the Microsoft Visual C++ 2010 Express menu, select Help > Register Product. A pop-up will be displayed. Click on the Obtain a registration key online button. You will then have to log in to your Microsoft account, if you have one, or create a new one, if you don't. After filling in some forms you will receive the product key which you enter into the dialogue box that popped up when you selected Help > Register Product. If you see an error message as shown below, click on the Microsoft icon on the top left corner of the page. This will redirect you to the Microsoft’s login page. Log into your Microsoft account from here and begin the process again, i.e. select Help > Register Product. For more detailed instructions, see here.

CMake

Download CMake binaries from here. At time of writing the latest version is 3.16.2.

You can opt for either the WIN32 installer (cmake-3.16.2-win32-x86.msi) or the Windows zip file. The installer has the advantage that it gives you the option to update your system path automatically (which you should take by clicking the appropriate radio button during the installation process). If you choose the installer option, note that if you already have CMake version 3.4 or earlier you much uninstall it first.

OpenCV

Download and install OpenCV from here. Choose the version 2.4.10 self-installer, download it, and execute it, and extract the library to C: so that you have a directory C:\opencv. If you have problems downloading this version from SourceForge site, you can download version 2.4.10 from here.

Add C:\opencv\build\x86\vc10\bin to the PATH environment variable and add a new environment variable OPENCV_DIR with the value C:\opencv\build, as follows.

  • From Windows 10 toolbar, select Settings.
  • Type Environment Variables in the Find a Setting dialogue box. This will bring up a new Systems Properties window.
  • Click the Environment Variables ... button. This will bring up a new Environment Variables window.
  • Select Path from System Variables. Click Edit. Click New and insert C:\opencv\build\x86\vc10\bin. Click OK.
  • Under User variables, click New. Insert OPENCV_DIR in the Variable name box and C:\opencv\build in the Variable value box. Click OK.
  • Click OK in the Environment Variables window.
  • Click OK in the Systems Properties window.

CORO Repository

Copy the CORO repository to the C: drive:

  • Download a zip archive with all the files from here.
  • Copy it to C: drive and unzip it so that you have a directory called C:\CORO.

C:\CORO has with a sub-directory structure explained in the course notes. For our purposes here, there is an C:\CORO\assignments directory and it will contain an example C:\CORO\assignments\assignment0 sub-directory. Later on, you will generate C:\CORO\assignments\assignment1 and C:\CORO\assignments\assignment2, and so on.

There is also a C:\CORO\lectures sub-directory. This has code from the lectures: the source code is in the C:\CORO\lectures\src sub-directory and test data is in the C:\CORO\lectures\data sub-directory.

The next step is to build a MSVC++ .sln solution file so that you can compile the CORO assignment0 executable. To do this, you need to run CMake against the C:\CORO\assignments\assignment0 directory (where you will find the main CMakeLists.txt file). We use assignment0 because it is a dummy assignment but you will follow exactly the same procedure for all the real assignments.

  • Launch the CMake GUI from the Windows 10 toolbar.
  • In the Where is the source code: type (or browse to) C:\CORO\assignments\assignment0
  • In the Where to build the binaries: type (or browse to) C:\CORO\assignments\assignment0\build
  • Select File > Delete Cache from the top menu (you must do this the first time in case there is an old invalid configuration in the CORO directory)
  • Click Configure
  • Select Visual Studio 10 2010 from the drop-down menu as the generator for the project
  • Click Finish and watch CMake configure your project. The dialogue box will still highlighted in red, so ...
  • Click Configure two more times and everything should be fine.
  • Click Generate to create the MSVC++ assignment0.sln file in the C:\CORO\assignments\assignment0\build directory.


Now you are ready to launch MSVC++ and build the CORO assignment0 executable.

  • Go to the C:\CORO\assignments\assignment0\build directory and double-click the assignment0.sln file. This launches Microsoft Visual C++ 2010 Express. The first time, you may be presented with a pop-up window that asks you how you want to open the file. Select Microsoft Visual C++ 2010 Express and click on the checkbox to always use this application to open this file type.
  • Select Release in the Solutions Configuration box (this is located left of centre on the toolbar and defaults to Debug).
  • Select Build > Build Solution from the top menu, (if you don't see this and you see Debug > Build Solution instead, it's probably because your IDE is set to basic settings. To change this, select Tools > Settings > Expert Settings).

This will compile and link the programs in the the C:\CORO\assignments\assignment0\src sub-directory and install then in the C:\CORO\assignments\assignment0\bin directory.


Check to see that the example dvernon.exe executable is there. If it is not, then select Build > Configuration Manager from the menu and make sure the INSTALL check-box is ticked. Now rebuild the project again.

Note that you will have to tick this check-box every time you rebuild the .sln solution file with CMake. If you don't do this, then your new executable won't be installed in the bin directory and you'll end up becoming very confused because none of the changes you make to your source code will be reflected in the executable you run from the bin directory (because its an old version from a previous compilation).


Good! Now you are now ready to run the example dvernon.exe application that is provided with the CORO release. To do this, double click the dvernon.exe executable in C:\CORO\assignments\assignment0\bin. Open input.txt file in C:\CORO\assignments\assignment0\data and, after running dvernon.exe, open the output.txt file, also in the C:\CORO\assignments\assignment0\data directory.


Try creating your own (dummy) assignment program. To do this, follow the following steps.

  • Create a directory with your student Id, e.g. C:\CORO\assignments\assignment0\src\mystudentid
  • Copy the source files (.c, .cpp, .h) and the CMakeLists.txt file from the dvernon directory to the mystudentid directory.
  • Edit the C:\CORO\assignments\assignment0\src\CMakeLists.txt file and replace ADD_SUBDIRECTORY(dvernon) with ADD_SUBDIRECTORY(mystudentid), where mystudentid is your student number.
  • Edit the C:\CORO\assignments\assignment0\src\mystudentid\CMakeLists.txt file and replace dvernon with mystudentid, where mystudentid is your student number.
  • Run CMake again.
  • Re-open the assignment0.sln file (remember, it's in the C:\CORO\assignments\assignment0\build directory).
  • Your files should now be visible (and the dvernon ones will no longer be there) and you can now compile your code and install it in the bin directory by selecting Build > Build Solution from the top menu.
  • Make sure that the INSTALL check-box is ticked when you select Build > Configuration Manager from the menu to ensure that your executable is installed in the C:\CORO\assignments\assignment0\bin directory.
  • Finally, run your program in the C:\CORO\assignments\assignment0\bin directory. You might like to change the contents of input.txt in the C:\CORO\assignments\assignment0\data directory and re-run your program to convince yourself that everything is working properly.


For your first assignment, you will simply copy the assignment0 directory to assignment1 and follow a similar procedure, writing new assignment-specific code, of course. There is just one thing you need to do: edit the C:CORO\assignments\assignment1\CMakeLists.txt and change the project name from assignment0 to assignment1, viz:

 ##############################################
 PROJECT(assignment0)
 ############################################## 

becomes

 ##############################################
 PROJECT(assignment1)
 ############################################## 


When submitting an assignment, all you have to do is submit a zipped version of your mystudentid directory with your three source code files.

The instructor simply has to unzip it and add it to the src directory on her or his computer, along with all the other students and her or his own solution, run CMake, launch the .sln file, compile, install, and check each executable in bin against the test data file in her or his data directory. Because we build the solutions the same way, you are guaranteed that your code will compile, provided you have followed this procedure.


The final step is to build a MSVC++ .sln solution file so that you can compile the DSA lectures executables. To do this, you need to run CMake against C:\CORO\lectures and C:\CORO\lectures\build, launch C:\CORO\lectures\build\lectures.sln, build the solution, making sure that the INSTALL check-box is ticked when you select Build > Configuration Manager from the menu to ensure that the demo executables are installed in the C:\CORO\lectures\bin directory.



Back to Cognitive Robotics