Skip to main content

A Flexible Framework for Robot Control in Python

Project description

scikit-robot: A Flexible Framework for Robot visualization and programming in Python

PyPI Python Versions Build Status Open In Colab

Documentation | Installation | Quick Start | Python API | Contribute

Scikit-Robot is a lightweight pure-Python library for robotic kinematics, motion planning, visualization and control.

Installation

You may need to install some dependencies by apt-get install:

sudo apt-get update
sudo apt-get install libspatialindex-dev freeglut3-dev libsuitesparse-dev libblas-dev liblapack-dev

Then,

pip install scikit-robot

If you would like to use Pybullet Interface, open3d and fast-simplification for mesh simplification,

pip install scikit-robot[all]

Command Line Tools

Scikit-robot provides a unified command-line interface through the skr command, which consolidates all robot-related tools into a single entry point.

Using the skr Command

You can use the skr command with various subcommands:

# View all available commands
skr --help

# Visualize URDF models
skr visualize-urdf ~/.skrobot/pr2_description/pr2.urdf --viewer trimesh

# Convert URDF mesh files
skr convert-urdf-mesh robot.urdf --output converted_robot.urdf

# Change URDF root link
skr change-urdf-root robot.urdf new_root_link output.urdf

# Calculate URDF hash
skr urdf-hash robot.urdf

# Modularize URDF files
skr modularize-urdf robot.urdf --output modular_robot.urdf

# Visualize mesh files
skr visualize-mesh mesh_file.stl

# Convert wheel collision models
skr convert-wheel-collision robot.urdf --output converted.urdf

# Generate robot class from URDF geometry
skr generate-robot-class robot.urdf --output MyRobot.py

Legacy Commands (still supported)

For backward compatibility, the original commands are still available:

# These commands work the same as their skr equivalents
visualize-urdf ~/.skrobot/pr2_description/pr2.urdf --viewer trimesh
convert-urdf-mesh robot.urdf --output converted_robot.urdf

Visualize URDF

To visualize a URDF model and inspect your robot's configuration:

skr visualize-urdf ~/.skrobot/pr2_description/pr2.urdf --viewer trimesh

If you experience performance issues with the default viewer, try pyrender for smoother visualization:

skr visualize-urdf ~/.skrobot/pr2_description/pr2.urdf --viewer pyrender

For a web-based viewer with interactive joint angle sliders, use viser:

skr visualize-urdf ~/.skrobot/pr2_description/pr2.urdf --viewer viser

Running these commands should open a viewer displaying your robot's 3D model. Below is a sample image of what you should expect.

Viewer Example

The viser viewer opens in your browser and provides GUI sliders for manipulating joint angles in real-time:

Viser Viewer

The viser viewer also supports interactive inverse kinematics (IK). Drag the transform controls at each end-effector to solve IK in real-time:

https://github.com/user-attachments/assets/1294307e-a901-4f5f-aa4e-433cfbfacd03

Create Your Own Robot Model (URDF)

If you want to build your own robot from scratch, you can refer to the How to Create URDF from CAD Software documentation.

Create URDF from Solidworks

Try it in Google Colab!

You can try scikit-robot directly in your browser without any installation:

Open In Colab

This interactive notebook demonstrates:

  • Multiple robot models (Kuka, Fetch, Nextage, PR2, Panda) with synchronized animation
  • Grasp and pull manipulation task with inverse kinematics
  • 3D visualization in Jupyter/Colab with smooth updates

Jupyter Notebook Viewer

Scikit-robot includes JupyterNotebookViewer for interactive 3D visualization in Jupyter notebooks and Google Colab:

import skrobot

# Create robot and viewer
robot = skrobot.models.PR2()
viewer = skrobot.viewers.JupyterNotebookViewer(height=600)
viewer.add(robot)

# Display and animate
viewer.show()

for _ in range(10):
    robot.rarm.angle_vector([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7])
    viewer.redraw()  # Smooth updates without flickering

See examples/notebooks/ for more examples.

Features

Project details


Release history Release notifications | RSS feed

This version

0.3.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scikit_robot-0.3.1.tar.gz (933.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scikit_robot-0.3.1-py3-none-any.whl (962.5 kB view details)

Uploaded Python 3

File details

Details for the file scikit_robot-0.3.1.tar.gz.

File metadata

  • Download URL: scikit_robot-0.3.1.tar.gz
  • Upload date:
  • Size: 933.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for scikit_robot-0.3.1.tar.gz
Algorithm Hash digest
SHA256 40fde16826b1c04d19b40c53a4d2fad9738f972ffb11649810951a0e9cc5edb0
MD5 f097840d1e1673ad19c3cacfa49d064d
BLAKE2b-256 03c1e5457587a579268747e9cbf5cad7b197338701603239a9a8d4fc8c814b02

See more details on using hashes here.

File details

Details for the file scikit_robot-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: scikit_robot-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 962.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for scikit_robot-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c78c8a4c88f8738b77441dc323c94145b46813c35cfcc898009f98104138e12b
MD5 22d1c80e76ac4b6105bf3d7bc68c893e
BLAKE2b-256 6130bc216862e1b8ff77dad5ffe75ab22a5fbc1dbe05f8cf2f70afe03750fa53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page