Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

## [2.0.0] - 2024-07-30
### Changed
- BREAKING: Migrated from gym to gymnasium.

### Added
- Add py.typed marker for mypy
- screenshot_mode.py to run simulation without visualisations (for nicer screenshots).
Expand All @@ -31,6 +34,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- trifinger_simulation does no longer maintain a copy of the robot model files for the
pure-Python installation. Instead it depends on robot_properties_fingers now for both
installation types (colcon and pure Python).
- The example Gym environments have been removed. They still depended on the old gym,
which is not working anymore with recent Python versions. Since they anyway where
mostly meant as examples and are not directly used in our code base, they were simply
removed. If you actually depend on them, you can easily retrieve them from an earlier
version of the code and maintain them in a separate package.


## [1.4.1] - 2022-06-24
Expand Down
48 changes: 0 additions & 48 deletions demos/demo_load_gym_env.py

This file was deleted.

46 changes: 0 additions & 46 deletions demos/demo_random_policy.py

This file was deleted.

4 changes: 1 addition & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ install_requires =
# pinocchio
pin >=2.4.7
pybullet >=3.0.8
gym >=0.23.1
gymnasium >=1.2.0
opencv-python >=4.2.0.34
pyyaml >=5.3.1
robot_properties_fingers>=2.0.2
Expand All @@ -42,9 +42,7 @@ scripts =
demos/demo_cameras.py
demos/demo_control.py
demos/demo_inverse_kinematics.py
demos/demo_load_gym_env.py
demos/demo_plain_torque_control.py
demos/demo_random_policy.py
demos/demo_trifinger_platform.py
scripts/check_position_control_accuracy.py
scripts/profiling.py
Expand Down
33 changes: 0 additions & 33 deletions tests/test_cube_env.py

This file was deleted.

53 changes: 0 additions & 53 deletions tests/test_determinism.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
import unittest
import numpy as np

import gym

import trifinger_simulation.gym_wrapper # noqa
from trifinger_simulation.sim_finger import SimFinger


Expand Down Expand Up @@ -44,56 +41,6 @@ def run():
np.testing.assert_array_equal(first_run.position, second_run.position)
np.testing.assert_array_equal(first_run.velocity, second_run.velocity)

def test_reach_rollouts(self):
smoothing_params = {
"num_episodes": 10,
# ratio of total training time after which smoothing starts
"start_after": 3.0 / 7.0,
# smoothing coeff. that shall be reached at end of training
"final_alpha": 0.975,
"stop_after": 5.0 / 7.0,
}

num_samples = 10
horizon = 100

env = gym.make(
"reach-v0",
control_rate_s=0.02,
enable_visualization=False,
finger_type="fingerone",
smoothing_params=smoothing_params,
)

start_position = [0.5, -0.7, -1.5]

plans = -1.0 + 2.0 * np.random.rand(horizon, num_samples, 3)

def run():
states = []
rewards = []

for i in range(num_samples):
env.reset()
env.finger.reset_finger_positions_and_velocities(
start_position
)
for t in range(horizon):
state, reward, _, _ = env.step(plans[t, i])
states.append(state)
rewards.append(reward)
states = np.array(states)
rewards = np.array(rewards)
return states, rewards

first_states, first_rewards = run()
second_states, second_rewards = run()

np.testing.assert_array_equal(first_states.all(), second_states.all())
np.testing.assert_array_equal(
first_rewards.all(), second_rewards.all()
)


if __name__ == "__main__":
unittest.main()
21 changes: 0 additions & 21 deletions trifinger_simulation/gym_wrapper/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +0,0 @@
from gym.envs.registration import register

register(
id="reach-v0",
entry_point="trifinger_simulation.gym_wrapper.envs.trifinger_reach:TriFingerReach",
)
register(
id="push-v0",
entry_point="trifinger_simulation.gym_wrapper.envs.trifinger_push:TriFingerPush",
)

register(
id="real_robot_challenge_phase_1-v1",
entry_point="trifinger_simulation.gym_wrapper.envs.cube_env:CubeEnv",
)


register(
id="cube_trajectory-v1",
entry_point="trifinger_simulation.gym_wrapper.envs.cube_trajectory_env:CubeTrajectoryEnv",
)
Empty file.
Loading
Loading