Next: About this document ...
Up: Robot definition
Previous: Robot definition files (.rob)
Hard-coded robots
Hard-coded robots offer the possibility to define arbitrary
parameterizations, but adding a new hard-coded robot requires
recompiling the MPK library and all programs that use it. By default,
only two hard-coded robots are defined: The type DEMOROBOT (see
mpkDemoRobot.cpp,.H) demonstrates how arbitrary parameterizations can
be realized. The other type, FREEFLYINGOBJECT (also see
mpkFreeFlyingObject.cpp,.H), is to make definition of free-flying
objects more comfortable: compare the two alternatives shown in the
file 'scenes/demo1.iv'. Using the hard-coded type FREEFLYINGOBJECT, it
is only necessary to specify the file name of the collision model
('FreeFlyingObjects/rod.iv' in the example). With the other
alternative, the '.rob' file must include both the kinematics
description and the name of the collision model (see
'robots/freeflyingL.rob').
To add a new hard-coded robot type 'mpkNewRob' to the MPK library,
perform the following steps (replace 'NewRob' by the name you would
like to give the robot):
- Create a subdirectory ivmodels/NewRob and copy all inventor link
models of the new robot into this directory.
- Create files robots/mpkNewRob.cpp and robots/mpkNewRob.H (cf
mpkDemoRobot.cpp and mpkDemoRobot.H). In the robot definition, make
sure that you refer to the link models that you copied into the
'ivmodels/NewRob' directory just before.
- Edit the file basic/mpk_robot_type.h and add:
- #include "mpkNewRob.H"
- MPKNEWROB to 'mpk_robot_type'
- Edit file basic/Robot.cpp and add:
- SO_NODE_DEFINE_ENUM_VALUE(mpk_robot_type, MPKNEWROB) to
the mpkRobot constructor
- a 'case MPKNEWROB' for the new robot type to the switch
statement in Robot::init()
- Unix: In the 'robots/Makefile', add mpkNewRob.cpp to the SRC
list and then call 'make' from the MPK home directory. Windows: Add
mpkNewRob.cpp to the current visual studio project and rebuild it.
Next: About this document ...
Up: Robot definition
Previous: Robot definition files (.rob)
Mitul Saha
2003-03-10