Usage¶
Commandline options¶
simtrans¶
Convert robot simulation model from one another.
usage: simtrans [-h] [-i FILE] [-o FILE] [-f FORMAT] [-c] [-b] [-t FORMAT] [-p PREFIX] [-s] [-e SPGR] [-v]
-
-h
,
--help
¶
show this help message and exit
-
-i
<file>
,
--input
<file>
¶ convert from FILE
-
-o
<file>
,
--output
<file>
¶ convert to FILE
-
-f
<format>
,
--from
<format>
¶ convert from FORMAT (optional)
-
-c
,
--use-collision
¶
use collision shape when converting to VRML
-
-b
,
--use-both
¶
use both visual and collision shape when converting to VRML (only supported on most recent version of Choreonoid)
-
-t
<format>
,
--to
<format>
¶ convert to FORMAT (optional)
-
-p
<prefix>
,
--prefix
<prefix>
¶ prefix given to mesh path (e.g. package://packagename, optional)
-
-s
,
--skip-validation
¶
skip validation of model data
-
-e
<spgr>
,
--estimatemass
<spgr>
¶ estimate mass and inertia from bounding box of the shape given the sp.gr. (optional)
-
-v
,
--verbose
¶
verbose output
Convert URDF model to VRML format¶
For example, PR2 robot model can be converted as follows.
$ rosrun xacro xacro.py `rospack find pr2_description`/robots/pr2.urdf.xacro > /tmp/pr2.urdf
$ simtrans -i /tmp/pr2.urdf -o /tmp/pr2.wrl
To open the project using hrpsys-simulator.
$ gnome-terminal -x openhrp-model-loader
$ hrpsys-simulator /tmp/pr2-project.xml
Convert VRML model to SDF format¶
For example, PA10 robot model can be converted as follows.
$ simtrans -i /usr/local/share/OpenHRP-3.1/sample/model/PA10/pa10.main.wrl -o ~/.gazebo/models/pa10.world
To open the project using gazebo.
$ gazebo ~/.gazebo/models/pa10.world
Validate all the models in the folder¶
For example, we can check JVRC task models as follows.
$ git clone https://github.com/jvrc/model.git jvrcmodels
$ simtrans-checker jvrcmodels/tasks/*/*.wrl
Visualize joint structure using graphviz¶
For example, PR2 robot model can be visualized as follows.
$ rosrun xacro xacro.py `rospack find pr2_description`/robots/pr2.urdf.xacro > /tmp/pr2.urdf
$ simtrans -i /tmp/pr2.urdf -o /tmp/pr2.dot
$ dot -Tx11 /tmp/pr2.dot