- Notifications
You must be signed in to change notification settings - Fork547
Robot models
Peter Corke edited this pageJun 16, 2020 ·1 revision
The RTB foldermodels contains files namedmdl_ROBOT.m whereROBOT is the name of a particular robot, eg.mdl_puma560.m. Themdl_ prefix is redundant but is a hangover from when there were fewer models and they all lived in the top-level folder.
There are two formats of these files:
- old style is a script that creates a variable of
SerialLinktype as well as some other variables which define some joint configurations, typically at leastqzwhich is a vector of zeros of the appropriate length. Limitations of this format:- the variable name is predefined in the script, the user cannot choose it
- the joint configuration variables can clash if multiple robot models are loaded and used simultaneously
- new style is a function that can:
- return the
SerialLinkobject to a user-specified variable. The joint configurations are defined within theSerialLinkobject as dynamic properties, eg.p560.qz. - write to the Base workspace if no output arguments are given, for backward compatibility with old-style scripts.
- return the
Propose that every robot has its own fileROBOT.py in the foldermodels. Each file defines a class which subclassesSerialLink and provides the appropriate initialisation.
ROBOT.py:
import roboticstoolboxclass ROBOT(SerialLink): def __init(self): # create the links and add them # set up configurations, eg. self.qz = [0, 0, 0, 0, 0, 0]