/PybulletRobotics

Pybullet codes for robotics

Primary LanguageJupyter NotebookMIT LicenseMIT

PybulletRobotics

日本語のREADMEはこちら

This repository contains “code for learning robotics algorithms” that can be executed with pybullet.

(The English documentation and comments on code in this repository are translated by ChatGPT.)


Features:

  • Code to help you understand the algorithms of robotics.
  • A physics simulation that can be run in the Python environment only.
    • Can be run in the Python environment only, making it easy to build an environment and concentrate on learning the algorithm.

Notes:

Since the code is for understanding algorithms, it may not be suitable for practical use, such as “optimizing processing speed” or “excessive comments on the code”.

table of contents

Installation

The following steps outline how to install the necessary libraries for running robotics simulations with pybullet.

The versions of each library used during the verification process are noted as comments next to each command.

Verified environment: Ubuntu (WSL is also acceptable)

sudo apt update
sudo apt install python3-pip
pip3 install pybullet # version 3.2.6
pip3 install numpy # version 1.24.3
pip3 install matplotlib # version 3.5.1
pip3 install opencv-contrib-python # version 4.5.4
pip install scipy # version 1.11.3

General

Basic Usage of Pybullet

Here, we introduce the basic usage of pybullet in robotics.

  • Creating an environment
  • Loading a robot from a URDF file
  • Running a simulation

For details, refer to "pybullet_basic.ipynb".

Detection of AR Marker Position and Orientation

This section introduces how to detect the position and orientation of AR markers from images captured by a camera.


For details, refer to "ar_marker_detect.ipynb".

Mobile Robot

Basics

Basic Control of a Mobile Robot

We introduce simple code to move a two-wheeled mobile robot.

For details, refer to "mobile_robot_basic.ipynb".

Using Sensors in a Mobile Robot

We introduce how to use the following sensors in a two-wheeled mobile robot.

  • Ultrasonic sensor
  • Camera
  • LiDAR
  • Fall prevention sensor
  • Bumper


Ultrasonic sensor


Camera


LiDAR


Fall prevention sensor


Bumper

For details, refer to "mobile_robot_sensor.ipynb".

Line Trace

We introduce how to perform line tracing using the bottom camera of a two-wheeled mobile robot.

For details, refer to "mobile_robot_line_trace.ipynb".

Position Estimation using Wheel Odometry

We introduce how to perform position estimation using wheel odometry in a two-wheeled mobile robot.

For details, refer to "mobile_robot_wheel_odometry.ipynb".

Position Estimation Using Particle Filter

This section introduces how to perform position estimation using a particle filter for a two-wheeled mobile robot.

For more details, refer to "mobile_robot_particle_filter.ipynb".

Other Planned Content

  • Path Planning
  • Kalman Filter
  • SLAM
  • Line Tracing with Supervised Learning
  • Reinforcement Learning (Q-Learning)

Robot Arm

Basics

Basic Control of a Robot Arm

We introduce simple code to control a two-axis robot arm (position control, velocity control, torque control).

position control


velocity control


torque control

For details, refer to "robot_arm_basic.ipynb".

Using Sensors in a Robot Arm

We introduce how to use the following sensors in a two-axis robot arm.

  • End-effector camera
  • End-effector force sensor


End-effector camera


End-effector force sensor

For details, refer to "robot_arm_sensor.ipynb".

Collision Detection

We introduce how to perform collision detection between a robot arm and objects.

For details, refer to "robot_arm_collision_check.ipynb".

Kinematics

Forward Kinematics using Trigonometric Functions

We introduce forward kinematics of a robot arm using trigonometric functions.

For details, refer to "robot_arm_trigonometric_forward_kinematics.ipynb".

Forward Kinematics using Homogeneous Transformation Matrix

We introduce forward kinematics of a robot arm using homogeneous transformation matrix.

For details, refer to "robot_arm_homogeneous_matrix_forward_kinematics.ipynb".

Inverse Kinematics using Analytical Methods

Introducing inverse kinematics for robot arms using analytical methods.

For more details, refer to "robot_arm_analytical_inverse_kinematics.ipynb".

Inverse Kinematics using Jacobian Matrix with Numerical Methods

Introducing inverse kinematics for robot arms using numerical methods.

For more details, refer to "robot_arm_jacobian_inverse_kinematics.ipynb".

Object Position Estimation using Eye-to-Hand

We introduce how to perform object position estimation using eye-to-hand.

For details, refer to "robot_arm_eye_to_hand.ipynb".

Object Position Estimation using Eye-in-Hand

We introduce how to perform object position estimation using eye-in-hand.

For details, refer to "robot_arm_eye_in_hand.ipynb".

Image-Based Visual Servo(IBVS)

We introduce how to perform image-based visual servoing.

For details, refer to "robot_arm_image_based_visual_servo.ipynb".

Other Planned Content

  • PID Control
  • Motion Planning using Configuration Space
  • Force Control
  • Hybrid Position and Force Control
  • Compliance Control

reference

site

  • pybullet_quickstart_guide:This is a quick start guide summarizing the functions available in pybullet (official).
  • PythonRobotics:This repository compiles robotics algorithms implemented in Python. It includes various algorithms, making it an excellent resource for studying robotics.

Created by the Author (written in Japanese)