Mlahoud / pybullet-kinematics-dynamics-control

A simple code to do kinematics, dynamics and control of robots in PyBullet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kinematics, dynamics and control of robotic systems in Pybullet

This repository will help in kinematic and dynamic analysis of robotic systems. Some of the examples for solving forward and inverse position and velocity kinematics, forward and inverse dynamics simulations have been kept in the examples folder. User can take their help to simulate different robotic systems. In addition, it has capability to incorporate any control algorithm and trajectory planner with utmost ease. Computed torque control and impedence control has been implemented as an example.

How to run the code ?

To make the program easy to use, RobotController class has been written to perform all kind of simulations. The class has folllowing inputs:

1. robot_type: specify urdf file initials eg. if urdf file name is 'ur5.urdf', specify 'ur5'

2. controllable_joints: joint indices of controllable joints. If not specified, by default all joints indices except first joint (first joint is fixed joint between robot stand and base)

3. end-eff_index: specify the joint indices for end-effector link. If not specified, by default the last controllable_joints is considered as end-effector joint

4. time_Step: time step for simulation

The example for doing inverse dynamic simulation using this class is shown below:

robot = RobotController(robot_type='ur5')
robot.createWorld(GUI=True)

# Inverse dynamic simulation
# Input: numpy array of joint angles
thi = np.array([0, 0, 0, 0, 0, 0]) # initial joint angles
thf = np.array([-1.5, -1.0, 1.0, -1.57, -1.57, -1.57]) # final joint nagles
robot.setJointPosition(thi)
robot.doInverseDynamics(thi, thf)

Tested on various robotic systems

1-link, 2-link, 3-link robots with rotary joints, Universal Robots UR5

Joint and task space velocity control

ur5-ee ur5-joint

Free-fall under gravity simulation

1-link
2-link 3-link ur5

Inverse Dynamics Simuilation

ur5

Computed Torque Control

ur5

Impedence Control

ur5

The details regarding the various control techniques and their implementation in pybullet is available in appendix

About

A simple code to do kinematics, dynamics and control of robots in PyBullet


Languages

Language:Python 100.0%