Scikit-Robot is a lightweight pure-Python library for robotic kinematics, motion planning, visualization and control.
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]
Scikit-robot provides a unified command-line interface through the skr
command, which consolidates all robot-related tools into a single entry point.
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
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
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
Running these commands should open a viewer displaying your robot's 3D model. Below is a sample image of what you should expect.
If you want to build your own robot from scratch, you can refer to the How to Create URDF from CAD Software documentation.
- Loading robot model from URDF (examples/robot_models.py)
- Forward and inverse kinematics (examples/trimesh_scene_viewer.py examples/pr2_inverse_kinematics.py)
- Collision detection
- Interactive viewer (examples/trimesh_scene_viewer.py)
- Pybullet and ROS command interface (examples/pybullet_robot_interface.py)
- Forward and inverse dynamics
- Path planning (examples/collision_free_trajectory.py)