-
Notifications
You must be signed in to change notification settings - Fork 463
Robot models
Peter Corke edited this page Jun 16, 2020
·
1 revision
The RTB folder models
contains files named mdl_ROBOT.m
where ROBOT
is the name of a particular robot, eg. mdl_puma560.m
. The mdl_
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
SerialLink
type as well as some other variables which define some joint configurations, typically at leastqz
which 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
SerialLink
object to a user-specified variable. The joint configurations are defined within theSerialLink
object 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 file ROBOT.py
in the folder models
. Each file defines a class which subclasses SerialLink
and provides the appropriate initialisation.
ROBOT.py:
import roboticstoolbox
class ROBOT(SerialLink):
def __init(self):
# create the links and add them
# set up configurations, eg.
self.qz = [0, 0, 0, 0, 0, 0]
- Frequently asked questions (FAQ)
- Documentation Style Guide
- Typing Style Guide
- Background
- Key concepts
- Introduction to robot and link classes
- Working with Jupyter
- Working from the command line
- What about Simulink?
- How to contribute
- Common Issues
- Contributors