This is my Capstone project for the Udacity C++ Nanodegree Program.
In this project, I have integrated the concepts I have learnt throughout this course with my Research Project that I had executed in Matlab. The project is a Pick-and-Place Parallel Robot (2RPR). The aim of this implementation is to integrate my learnings from this course with my existing knowledge in Matlab. For this project, I also learnt OOP in Matlab and expanded my skill sets by learning the Matlab Coder application. Writing Matlab code for Controlling dynamical systems keeping in mind its software implementation in C++ is the most important takeawy for me from this project.
No additional libraries are required to run this project.
Project Description
The Project is a simulation of 2RPR planar parallel robot executing a a pick and place task. The robot 'picks' from the inital location given by coordinates[0] and coordinates[1] in the main_PR.cpp file. The robot 'places' the article at the target location given by coordinates[6] and coordinates[7] which are the corresponding x and y coordinates. The Initial and Target coordiantes can be altered by the User. The project is planned to be extended in the future to accomodate a GUI for user input and viewing the robot operation. Also, multiple target locations will be given for the robot to track consecutively. The controller used here is a simple Proportional - Derivative (PD) controller.
A demo of the Pick and Place task. The x denotes the Target location and o is the initial position.
- main_PR.cpp is the main file where the execution takes place. The executable is a position error plot in the x-coordinate and can be found in the build folder. This plot can be validated by generating a similar plot in Matlab through the main_sys in the src_matlab folder.
- Robot_2RPR is the file where the system is executed. It has the method executeSystem which performs the following functions
- The method CalcVars returns the system variables such as the initial state vector for the Parallel robot. This initial state vector and the time span is defined in the class ClassSysVars.cpp.
- Ode45 is a solver solves/integrates the differential equations of motion that is obtained from ParallelRobotSys.cpp
- The method extractPosn computes the current posiion of the parallel robot platform or the 'arm'.
- The other .cpp files are generated by the Matlab coder and are necessary for execution.
Expected Output : When the program executes without any errors, it means that the Pick and Place Simulation task was achieved. The following message is displayed: Pick and place task executed. Please compare the error plots from Matlab to the x_error_plot.png in the build folder for validation
A error plot can be found in the build folder.
Addressing Rubric Points:
- The Code is designed in a modular fashion. It is clearly organized into Classes and Functions where possible for the purpose of Data Abstraction and modularity. All class members are explicitly specified as public, private or protected.
- The project writes data to a file - The error plot which is constructed through an external library - pbPlots.
- The project applies concepts like pass-by-reference and pointers
- cmake >= 3.7
- All OSes: click here for installation instructions
- make >= 4.1 (Linux, Mac), 3.81 (Windows)
- Linux: make is installed by default on most Linux distros
- Mac: install Xcode command line tools to get make
- Windows: Click here for installation instructions
- gcc/g++ >= 5.4
- Linux: gcc / g++ is installed by default on most Linux distros
- Mac: same deal as make - install Xcode command line tools
- Windows: recommend using MinGW
- Clone this repo.
- Make a build directory in the top level directory:
mkdir build && cd build
- Compile:
cmake .. && make
- Run it:
./ParallelRobot
.