O'Reilly logo

Learning Robotics using Python - Second Edition by Lentin Joseph

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Python script of the robot model

The following is the Python script of the robot model that we will design:

  1. Before starting the Python script in Blender, we must import the bpy module. The bpy module contains all the functionalities of Blender and it can only be accessed from inside the Blender application:
import bpy 
  1. The following function will draw the base plate of the robot. This function will draw a cylinder with a radius of 5 cm and cut a portion from the opposite sides so that motors can be connected using the Boolean modifier inside Blender:
#This function will draw base plate 
def Draw_Base_Plate(): 
  1. The following two commands will create two cubes with a radius of 0.05 meters on either side of the base plate. The purpose of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required