Upload folder using huggingface_hub
Browse files147 unmodified lines148149150151152153154147 unmodified linesif slope != 0.0:# Rotate gravity about +y: the robot walking along +x is then walking uphill.g = float(np.linalg.norm(self._mj_model.opt.gravity))tilted = np.array([g * np.sin(slope), 0.0, -g * np.cos(slope)])self._mj_model.opt.gravity[:] = tiltedself._mjx_model = self._mjx_model.replace(opt=self._mjx_model.opt.replace(gravity=jnp.asarray(tilted)))147 unmodified lines148149150151152153154155156157158159147 unmodified linesif slope != 0.0:# Rotate gravity about +y: the robot walking along +x is then walking uphill.g = float(np.linalg.norm(self._mj_model.opt.gravity))# NEGATIVE x component: gravity pulls the robot BACK along -x while the# walking command drives +x, so positive slope_rad means walking UPHILL.# The sign was inverted first time round, which made gravity assist the command# -- passive drift measured +1.02 m downhill at 17 deg, and "slope performance"# improved with steepness because the robot was being pushed along.tilted = np.array([-g * np.sin(slope), 0.0, -g * np.cos(slope)])self._mj_model.opt.gravity[:] = tiltedself._mjx_model = self._mjx_model.replace(opt=self._mjx_model.opt.replace(gravity=jnp.asarray(tilted)))
code/snow_rl/snow_env.py+6-1