<!-- ======================================================
	This file is part of MuJoCo.     
	Copyright 2009-2016 Roboti LLC.
	
	Model 		:: Cartpole
		
	Mujoco		:: Advanced physics simulation engine
		Source		: www.roboti.us
		Version		: 1.31
		Released 	: 23Apr'16
		
	Author		:: Vikash Kumar
		Contacts 	: kumar@roboti.us
		Last edits 	: 30Apr'16, 30Nov'15, 10Oct'15
====================================================== -->
<mujoco model="cart-pole (v1.31)">
	<size njmax="6"/>
    <compiler inertiafromgeom="true" angle="radian"/>
	<option	timestep="0.01"/>
	
	<asset>
		<material name="MatViz" specular="1" shininess=".1" reflectance="0.5" rgba=".8 .7 .5 1"/>
		<material name="MatGnd" specular="1" shininess=".3" reflectance="0.5" rgba=".5 .55 .5 1"/>
	</asset>
	
    <default>
        <geom contype="0" margin="0.01" material="MatViz" />
		<joint limited="true" damping="0.05" armature=".001" margin="0.01" frictionloss="0.001"/>
    </default>
		
    <worldbody>
		<light directional="true" cutoff="4" exponent="20" diffuse="1 1 1" specular="0 0 0" pos="0 .3 2.5" dir="0 -.3 -2.5 "/>
		
		<geom name="ground" type="plane" pos="0 0 -.7" contype="1" conaffinity="1" size="4 4 16" material="MatGnd"/>
        <geom name="rail1" type="capsule" pos="0 0.1 0" quat="0.707 0 0.707 0" size="0.02 1" rgba="0.3 0.3 0.3 1" />
		<geom name="rail2" type="capsule" pos="0 -.1 0" quat="0.707 0 0.707 0" size="0.02 1" rgba="0.3 0.3 0.3 1" />
		
        <body name="cart" pos="0 0 0">
            <joint name="slider" type="slide" pos="0 0 0" axis="1 0 0" range="-1 1"/>
            <geom name="cart" type="box" pos="0 0 0" quat="0.707 0 0.707 0" size="0.05 0.15 .3" />
            <body name="pole" pos="0 0 0">
                <joint name="hinge" type="hinge" pos="0 0 0" axis="0 1 0" limited="false" />
                <geom name="pole" type="capsule" fromto="0 0 0 0.01 0 0.6" size="0.05 0.3" />
            </body>
        </body>
    </worldbody>
	
    <actuator>
        <motor name="slide" joint="slider" gear="100" ctrllimited="true" ctrlrange="-3 3"/>
    </actuator>
	
</mujoco>
