next up previous
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):

  1. Create a subdirectory ivmodels/NewRob and copy all inventor link models of the new robot into this directory.

  2. 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.

  3. Edit the file basic/mpk_robot_type.h and add:

  4. Edit file basic/Robot.cpp and add:

  5. 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 up previous
Next: About this document ... Up: Robot definition Previous: Robot definition files (.rob)
Mitul Saha 2003-03-10