(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Model file conversion

Description: This tutorials is for adding new robots and environments models and model conversion

Tutorial Level: INTERMEDIATE

Write own your model files

Write own your model files as VRML file

Model Documentation (Japanese) Sample Model Description (Japanese) Model Documentation (English) Sample Model Description (English)

Model conversion in RTM-ROS system

Conversion overview

VRML, COLLADA, Euslisp, URDF

rtmros_common provides functionality for converting VRML model files into COLLADA, Euslisp, and URDF model files.

- export-collada in the openhrp3 package performs VRML => COLLADA conversion.

- The euscollada package provides COLLADA => Euslisp conversion.

Converting VRML files to Euslisp files

Change directory into your catkin workspace source folder:

cd ~/catkin_ws/src

Create a new package for converting VRML files into Euslisp files. Our package will depend on the hrpsys_ros_bridge package:

catkin_create_pkg robot_model_converter hrpsys_ros_bridge

Create a models folder in our package to hold our robot model files:

cd robot_model_converter 
mkdir models

Copy your robot VRML file and YAML file into the models folder:

cp <robot VRML file> models/robot.wrl
cp <robot YAML file> models/MyRobot.yaml

Edit the CMakeList.txt to include the following line:

compile_openhrp_model(${PROJECT_SOURCE_DIR}/models/robot.wrl MyRobot)

Now we're ready to make the package:

cd ~/catkin_ws
catkin_make

If you inspect the model folder, you will find a set of files generated, including the myrobot.l Euslisp file converted from the VRML file.

The Euslisp file can then be loaded by executing:

cd ~/catkin_ws/src/robot_model_converter/models
rosrun roseus roseus myrobot.l
> myrobot
> objects *myrobot*

Wiki: rtmros_common/Tutorials/ModelFileConversion (last edited 2015-04-01 05:55:40 by WesleyChan)