Skip to content

Commit

Permalink
Merge pull request #114 from diegoferigo/update_models
Browse files Browse the repository at this point in the history
Update models and worlds
  • Loading branch information
diegoferigo authored Dec 22, 2019
2 parents 01a5123 + b1ed6b6 commit 5b5bc5f
Show file tree
Hide file tree
Showing 20 changed files with 396 additions and 1,232 deletions.
6 changes: 3 additions & 3 deletions gym_ignition/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
max_episode_steps=5000,
kwargs={'task_cls': pendulum_swingup.PendulumSwingUp,
'robot_cls': sim.gazebo.pendulum.PendulumGazeboRobot,
'model': "Pendulum/Pendulum.sdf",
'model': "Pendulum/Pendulum.urdf",
'world': "DefaultEmptyWorld.world",
'rtf': max_float,
'agent_rate': 1000,
Expand All @@ -67,7 +67,7 @@
max_episode_steps=5000,
kwargs={'task_cls': cartpole_discrete.CartPoleDiscrete,
'robot_cls': sim.gazebo.cartpole.CartPoleGazeboRobot,
'model': "CartPole/CartPole.sdf",
'model': "CartPole/CartPole.urdf",
'world': "DefaultEmptyWorld.world",
'rtf': max_float,
'agent_rate': 1000,
Expand All @@ -81,7 +81,7 @@
max_episode_steps=5000,
kwargs={'task_cls': cartpole_continuous.CartPoleContinuous,
'robot_cls': sim.gazebo.cartpole.CartPoleGazeboRobot,
'model': "CartPole/CartPole.sdf",
'model': "CartPole/CartPole.urdf",
'world': "DefaultEmptyWorld.world",
'rtf': max_float,
'agent_rate': 1000,
Expand Down
2 changes: 1 addition & 1 deletion gym_ignition/gympp/cartpole.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _plugin_metadata(self) -> bindings.PluginMetadata:
md.setLibraryName("CartPolePlugin")
md.setClassName("gympp::plugins::CartPole")
md.setWorldFileName("DefaultEmptyWorld.world")
md.setModelFileName("CartPole/CartPole.sdf")
md.setModelFileName("CartPole/CartPole.urdf")

md.setAgentRate(1000)

Expand Down
170 changes: 0 additions & 170 deletions gym_ignition_data/CartPole/CartPole.sdf

This file was deleted.

31 changes: 11 additions & 20 deletions gym_ignition_data/CartPole/CartPole.urdf
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,39 @@
<!-- | This document was autogenerated by xacro from CartPole.urdf.xacro | -->
<!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | -->
<!-- =================================================================================== -->
<robot name="cartpole_xacro" xmlns:xacro="http://www.ros.org/wiki/xacro">
<robot name="cartpole_xacro">
<!-- CartPole properties match the OpenAI Gym CartPole-v1 environment -->
<!-- https://github.com/openai/gym/blob/master/gym/envs/classic_control/cartpole.py -->
<!-- ====== -->
<!-- COLORS -->
<!-- ====== -->
<material name="black">
<color rgba="0 0 0 0.8"/>
<color rgba="0 0 0 1"/>
</material>
<material name="white">
<color rgba="1 1 1 0.8"/>
<color rgba="1 1 1 1"/>
</material>
<material name="grey">
<color rgba="0.2 0.2 0.2 0.8"/>
<color rgba="0.2 0.2 0.2 1"/>
</material>
<gazebo reference="rail">
<visual>
<material>
<ambient>0 0 0 0.8</ambient>
<diffuse>0 0 0 0.8</diffuse>
<specular>0 0 0 0.8</specular>
<emissive>0 0 0 0.8</emissive>
<diffuse>0 0 0 1</diffuse>
</material>
</visual>
</gazebo>
<gazebo reference="cart">
<visual>
<material>
<ambient>0.2 0.2 0.2 0.8</ambient>
<diffuse>0.2 0.2 0.2 0.8</diffuse>
<specular>0.2 0.2 0.2 0.8</specular>
<emissive>0.2 0.2 0.2 0.8</emissive>
<diffuse>0.2 0.2 0.2 1</diffuse>
</material>
</visual>
</gazebo>
<gazebo reference="pole">
<visual>
<material>
<ambient>1 0 0 0.8</ambient>
<diffuse>1 0 0 0.8</diffuse>
<specular>1 0 0 0.8</specular>
<emissive>1 0 0 0.8</emissive>
<diffuse>1 0 0 1</diffuse>
</material>
</visual>
</gazebo>
Expand All @@ -64,7 +55,7 @@
</geometry>
<origin rpy="1.57079632679 0 0" xyz="0 0 0"/>
<material name="black">
<color rgba="0 0 0 0.8"/>
<color rgba="0 0 0 1"/>
</material>
</visual>
</link>
Expand All @@ -80,7 +71,7 @@
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
<material name="grey">
<color rgba="0.2 0.2 0.2 0.8"/>
<color rgba="0.2 0.2 0.2 1"/>
</material>
</visual>
<collision>
Expand All @@ -102,7 +93,7 @@
</geometry>
<origin rpy="0 0 0" xyz="0 0 0.5"/>
<material name="red">
<color rgba="1 0 0 0.8"/>
<color rgba="1 0 0 1"/>
</material>
</visual>
<collision>
Expand All @@ -111,7 +102,7 @@
</geometry>
<origin rpy="0 0 0" xyz="0 0 0.5"/>
<material name="red">
<color rgba="1 0 0 0.8"/>
<color rgba="1 0 0 1"/>
</material>
</collision>
</link>
Expand Down
11 changes: 4 additions & 7 deletions gym_ignition_data/CartPole/CartPole.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

<xacro:property name="epsilon" value="1e-09"/>

<xacro:property name="rgba_black" value="0 0 0 0.8"/>
<xacro:property name="rgba_white" value="1 1 1 0.8"/>
<xacro:property name="rgba_grey" value="0.2 0.2 0.2 0.8"/>
<xacro:property name="rgba_red" value="1 0 0 0.8"/>
<xacro:property name="rgba_black" value="0 0 0 1"/>
<xacro:property name="rgba_white" value="1 1 1 1"/>
<xacro:property name="rgba_grey" value="0.2 0.2 0.2 1"/>
<xacro:property name="rgba_red" value="1 0 0 1"/>

<xacro:macro name="box_inertia" params="mass dimx dimy dimz xyz rpy">
<inertial>
Expand Down Expand Up @@ -62,10 +62,7 @@
<gazebo reference="${reference}">
<visual>
<material>
<ambient>${rgba}</ambient>
<diffuse>${rgba}</diffuse>
<specular>${rgba}</specular>
<emissive>${rgba}</emissive>
</material>
</visual>
</gazebo>
Expand Down
6 changes: 3 additions & 3 deletions gym_ignition_data/CartPole/model.config
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0"?>
<model>
<name>CartPole World for Ignition</name>
<name>CartPole</name>

<version>1.0</version>
<sdf version='1.6'>CartPole.sdf</sdf>
<sdf version='1.6'>CartPole.urdf</sdf>

<author>
<name>Diego Ferigo</name>
<email>[email protected]</email>
</author>

<description>
World for the CartPole.
SDF model of a simple cartpole.
</description>
</model>
Loading

0 comments on commit 5b5bc5f

Please sign in to comment.