To fully exploit the advantages of human-robot collaboration the robot must be allowed to move when the human is close to it or even in contact with it. This thesis presents the development of a collision avoidance system which addresses the safety problem for the case of one person sharing a workspace with a robot manipulator. The system consists of a depth camera that measures both the colour and depth of the scene near to the robot, a laptop computer and several software algorithms. A human modeling algorithm generates a plane model and union of spheres model from the point cloud. Sphere-swept lines are used to geometrically model each link of the robot. Their position and orientation in space are calculated using the robot’s joint position measurements and its kinematic model. Two collision avoidance algorithms are presented for controlling the robot’s trajectory based on the geometric models for the human and robot, and the robot’s desired task. The first collision avoidance algorithm solves the inverse kinematics problem and avoids collisions using an expanded version of the manipulator Jacobian matrix. A second collision avoidance algorithm using nonlinear model predictive control is developed as an alternative approach. The algorithms have been implemented in a simulated environment which includes a human working in the shared workspace with a simple planar robot and with an Elfin 5 industrial robot. A variety of scenarios are simulated and the results are compared. The simulation results showed that the first collision avoidance algorithm may be computed fast enough to be applied in real-time and worked well for static or slowly moving obstacles. The second collision avoidance algorithm had superior performance when the obstacle was moving and when the simulated robot had a realistic time delay. However, its computation time was too long to be used in real-time.