Generalized Dynamics and Simulation

The goal of this project for me was to do a deep dive into the dynamics and simulation of robots. I have had to setup several simulations, through both classes and research, but wanted to get a better understanding for the underlying principles. All of the code for this project is available on the github page.

DH simulating gif


The goals of this project were

  • Generate and visualize kinematics from dh parameters in realtime
  • Automatically calculate governing equations of motion of a system from dh parameters
  • Simulate the developed equations of motion in realtime
  • Bonus: Be able to do this all in one session

Project Setup

I have accomplished each of these components separately through either research or through working on personal projects in my free time, but I would say that all of these tools are very useful for someone getting into robotics. I am not claiming that any of this was done in the most effective way, but the first goal was to get everything working, and then to improve it from there.

The tools and languages I used for this project were

  • Unity
    • C#
    • Python experimental package
  • Python
    • sympy
    • numpy
  • C++
    • Eigen library
    • cmake

In order to understand how this project works, there are some fundamental concepts that need to be understood, and I will assume readers have this understanding.

  • kinematics knowledge
    • matrix math
    • transforation matrices
    • forward kinematics principles
  • dynamics knowledge
    • equations of motion
    • Newton’s/Lagrange’s methods
  • knowledge of robotics
    • terminology (end effector, joint, actuator)
    • dh convention
    • pd controllers

I am very happy with how everything turned out, but there are still a lot of improvements that can be made. Some general things that I want to improve are

  • add ability to change orientation of base coordinate frame
  • add support for prismatic joints as well as rotational
  • add gui for updating params and/or better way to communicate with unity
  • add general pd controllers for controlling robots after sim starts

I plan on writing different sections detailing how I handled Kinematics, Dynamics, as well as how I think this could be useful. Stay tuned!