RaiSim World Configuration File¶
We provide a few examples here.
The following describes the RaiSim world configuration xml convention. The (optional) tag means that the element is optional given the parent. If the element is not marked (optional), it must exist given that the parent exist. The (multiple) tag means that there can be multiple elements for the same parent.
- raisim: Top most node.
<attribute>
version
: Describes the version of RaiSim that created the configuration file. The file might be read by different version.- <child> (optional)
material
For more information and examples, check out here. - <child> (optional)
default
If it doesn’t exist, the default parameters are as described here. <attribute>
friction
[float]<attribute>
restitution
[float]<attribute>
restitution_threshold
[float]
- <child> (optional)
- <child> (optional, multiple)
pair_prop
<attribute>
name1
[string]<attribute>
name2
[string]<attribute>
friction
[float]<attribute>
restitution
[float]<attribute>
restitution_threshold
[float]
- <child> (optional, multiple)
- <child> (optional)
- <child> (optional)
gravity
<attribute>
value
[Vec<3>]: default={0, 0, -9.81}
- <child> (optional)
- <child> (optional)
timestep
<attribute>
value
[float]: default = 0.005
- <child> (optional)
- <child> (optional)
erp
For experts only. It is a spring and damper term to the error dynamics. <attribute>
erp
: spring term [float]<attribute>
erp2
: damping term [float]
- <child> (optional)
<child>
objects
: described in “Object XML Description”- <child>
wire
DESCRIPTION, EXAMPLES <attribute>
name
[string]: wire name<attribute>
type
[string]: wire type. “stiff”, “compliant”, or “custom”<attribute>
stretch_type
[string]: stretch type- <child>
object1
andobject2
the object to which the wire is attached First option 1. <attribute>
local_index
[int]: The body index for the wire attachment. 0 for singleBodyObject. 2. <attribute>pos
[Vec<3>]: The position in the local body frame to where the wire is attached. Second option, for articulated system only 1. <attribute>frame
[string]: The name of the frame to where the wire is attached.
- <child>
- <child>
Object XML Description¶
Collision groups and masks can be written as collision[1]
or collision[1|4|6]
.
The first one represents the collision group 1.
The second one is a collision mask that collides with the collision group 1, 4 and 6.
The collision mask collision[-1]
means that it can collide with any collision group (note that the collision is AND logic and two mask and group pairs should agree).
sphere¶
attributes: (optional, default=1) collision_group
[uint64_t], (optional, default=-1) collision_mask
[uint64_t], (optional) appearance
[string], (optional) body_type
[string]: one of {dynamic, kinematic, static}, (optional) name
[string], mass
[float]
<child> (optional, default=From geometry assuming uniform density)
inertia
: <attribute>xx
[float],xy
[float],xz
[float],yy
[float],yz
[float],zz
[float]<child> dim: <attribute> radius[float]
<child> state: <attribute>
pos
[Vec<3>], (optional, default=1,0,0,0)quat
[Vec<4>], (optional, default=0,0,0)lin_vel
[Vec<3>], (optional, default=0,0,0)ang_vel
[Vec<3>]
capsule and cylinder¶
attributes: (optional, default=1) collision_group[uint64_t], (optional, default=-1) collision_mask[uint64_t], (optional) appearance[string], (optional) body_type[string]: one of {dynamic, kinematic, static}, (optional) name[string], mass[float]
<child> (optional, default=From geometry assuming uniform density)
inertia
: <attribute>xx
[float],xy
[float],xz
[float],yy
[float],yz
[float],zz
[float]<child> dim: <attribute>
radius
[float],height
[float]<child> state: <attribute>
pos
[Vec<3>], (optional, default=1,0,0,0)quat
[Vec<4>], (optional, default=0,0,0)lin_vel
[Vec<3>], (optional, default=0,0,0)ang_vel
[Vec<3>]
box¶
attributes: (optional, default=1) collision_group
[uint64_t], (optional, default=-1) collision_mask
[uint64_t], (optional) appearance
[string], (optional) body_type
[string]: one of {dynamic, kinematic, static}, (optional) name
[string], mass
[float]
<child> (optional, default=From geometry assuming uniform density)
inertia
: <attribute>xx
[float],xy
[float],xz
[float],yy
[float],yz
[float],zz
[float]<child> dim: <attribute>
x
[float],y
[float],z
[float]<child> state: <attribute>
pos
[Vec<3>], (optional, default=1,0,0,0)quat
[Vec<4>], (optional, default=0,0,0)lin_vel
[Vec<3>], (optional, default=0,0,0)ang_vel
[Vec<3>]
compound¶
attributes: (optional, default=1) collision_group
[uint64_t], (optional, default=-1) collision_mask
[uint64_t], (optional) appearance
[string], (optional) body_type
[string]: one of {dynamic, kinematic, static}, (optional) name
[string], com
[Vec<3>], mass
[float]
- <child> (optional, default=From geometry assuming uniform density)
inertia
attributes:
xx
[float],xy
[float],xz
[float],yy
[float],yz
[float],zz
[float]
- <child> (optional, default=From geometry assuming uniform density)
- <child>
children
Common attributes of the children:
appearance
[string]- <child> (optional, multiple)
sphere
- <child> dim
<attribute>
radius
[float]
<attribute> (optional, default=default)
material
- <child> (optional, multiple)
- <child> (optional, multiple)
cylinder
- <child>
dim
<attribute> radius[float]
<attribute> height[float]
- <child>
<attribute> (optional, default=default)
material
- <child> (optional, multiple)
- <child> (optional, multiple)
capsule
- <child>
dim
<attribute>
radius
[float]<attribute>
height
[float]
- <child>
<attribute> (optional, default=default)
material
- <child> (optional, multiple)
- <child> (optional, multiple)
box
- <child>
dim
<attribute>
x
[float]<attribute>
y
[float]<attribute>
z
[float]
- <child>
<attribute> (optional, default=default)
material
- <child> (optional, multiple)
- <child>
- <child> state
attributes:
pos
[Vec<3>], (optional, default=1,0,0,0)quat
[Vec<4>], (optional, default=0,0,0)lin_vel
[Vec<3>], (optional, default=0,0,0)ang_vel
[Vec<3>]
mesh¶
attributes: (optional, default=1) collision_group
[uint64_t], (optional, default=-1) collision_mask
[uint64_t], (optional) appearance
[string], (optional) body_type
[string]: one of {dynamic, kinematic, static}, (optional) name
[string], mass
[float], file_name
[string], com
[Vec<3>], scale
[Vec<3>]
- <child> (optional, default=From geometry assuming uniform density)
inertia
attributes:
xx
[float],xy
[float],xz
[float],yy
[float],yz
[float],zz
[float]
- <child> (optional, default=From geometry assuming uniform density)
- <child>
state
attributes:
pos
[Vec<3>], (optional, default=1,0,0,0)quat
[Vec<4>], (optional, default=0,0,0)lin_vel
[Vec<3>], (optional, default=0,0,0)ang_vel
[Vec<3>]
- <child>
ground¶
attributes: (optional, default=-1) collision_mask
[uint64_t], (optional) appearance
[string], (optional) name
[string], (optional, default=0) height
[float]
heightmap¶
Options
attributes: (optional, default=-1)
collision_mask
[uint64_t], (optional)appearance
[string], (optional, default=default)material
[string], (optional)name
[string],x_sample
[size_t],y_sample
[size_t],x_size
[float],y_size
[float],center_x
[float],center_y
[float],height
[std::vector<float>]attributes: (optional, default=-1)
collision_mask
[uint64_t], (optional)appearance
[string], (optional, default=default)material
[string], (optional)name
[string],x_sample
[size_t],y_sample
[size_t],x_size
[float],y_size
[float],center_x
[float],center_y
[float],z_scale
[float],z_offset
[float],png
[string]attributes: (optional, default=-1)
collision_mask
[uint64_t], (optional)appearance
[string], (optional, default=default)material
[string], (optional)name
[string],center_x
[float],center_y
[float],text
[string]- attributes: (optional, default=-1)
collision_mask
[uint64_t], (optional)appearance
[string], (optional, default=default)material
[string], (optional)name
[string],x_sample
[size_t],y_sample
[size_t],x_size
[float],y_size
[float],center_x
[float],center_y
[float] - <child>
terrain_properties
attributes:
z_scale
[float],fractal_octaves
[size_t],fractal_lacunarity
[float],fractal_gain
[float],step_size
[float],frequency
[float],seed
[size_t]
- <child>
- attributes: (optional, default=-1)
articulated_system¶
attributes: (optional, default=1) collision_group
[uint64_t], (optional, default=-1) collision_mask
[uint64_t], (optional) name
[string], (optional, default=the URDF directory) res_dir
[string], urdf_path
[string]
- <child>
state
attributes:
qpos
[VecDyn], (optional, default=zeros)qvel
[VecDyn]
- <child>
Configuration Template¶
Configuration templates can be useful to systematically create a world. An example can be found here.
You can include other configuration files using tag include
.
This can be useful if you have subworlds and want to create multiple combinations of them.
You can denote parameters prefixed by @@
.
Variables can be either specified in the script using params
.
An example can be found here.
This can be useful if you want to change the world at runtime or create multiple versions of the configuration file.
You can use tag array
to create forloop in the configuration file.
An example can be found in here.
You have to give attribute idx
, start
, end
, and increment
.
The last three should be integers.
You can also write math expressions inside the configuration file.
An example can be found in the same file.
You have to use {}
to encapsulate the equation part.
You can use simple binary functions such as sin
, cos
, exp
, and log
.
You have to use ()
for functions and closing expressions just like in C++.
Objects can have an attribute exist
.
This allows you to remove objects at runtime using parameters.
An example file can be found here.