I have a custom model XML and I'm trying to tune the parameters. I need to change the material density and joint friction values. However, changing these values seem to have no effect whatsoever on the simulation.
This is my code
from roboschool.gym_mujoco_xml_env import RoboschoolMujocoXmlEnv
from roboschool.gym_forward_walker import RoboschoolForwardWalker
import numpy as np
class ForwardServoWalker(RoboschoolForwardWalker):
def apply_action(self, a):
assert(np.isfinite(a).all())
for n,j in enumerate(self.ordered_joints):
an = float(np.clip(a[n], -1, +1))
# j.set_motor_torque( self.power*j.power_coef*an )
cp = j.current_position()[0]
label = j.name.split('_')[0]
low, high, pwm = self.servo_settings[label]
p = (an + 1) / 2.0 * (high - low) + low
j.set_servo_target(p, 0.1, 0.01, self.power*pwm)
class ForwardServoWalkerMujocoXML(ForwardServoWalker, RoboschoolMujocoXmlEnv):
def __init__(self, fn, robot_name, action_dim, obs_dim, power):
RoboschoolMujocoXmlEnv.__init__(self, fn, robot_name, action_dim, obs_dim)
ForwardServoWalker.__init__(self, power)
class MiKoBot(ForwardServoWalkerMujocoXML):
foot_list = ['front_left_foot', 'front_right_foot', 'left_back_foot', 'right_back_foot']
servo_settings = {'hip': (-np.pi/2, np.pi/2, 1), 'ankle': (0, 0.35, 1)}
def __init__(self):
ForwardServoWalkerMujocoXML.__init__(self, "miko.xml", "torso", action_dim=8, obs_dim=28, power=14)
def alive_bonus(self, z, pitch):
return +1 if z > 0.4 else -1
I have a custom model XML and I'm trying to tune the parameters. I need to change the material density and joint friction values. However, changing these values seem to have no effect whatsoever on the simulation.
This is my code
And this is my model: