Closed DOPEMANdd closed 10 months ago
From my understanding "multi-scenario-v0"
does not exist in 1.4
. Is there a particular reason why you want that environment?
Consider some of the following gymnasium
environments:
These environments are located here: https://github.com/huawei-noah/SMARTS/tree/master/smarts/env/gymnasium
@DOPEMANdd "driving-smarts-v2022"
is the most similar environment. Do note it is a gymnasium
environment.
@Gamenot Thank you for your reply, because I have been using this environment before, and now I want to use it again, but the error was reported.I will try "driving-smarts-v2022". thanks again.
@Gamenot I have one more question: how do I convert the obs of the current dictionary type to the data type of the previous Observation wrapper. just like this: {'Agent_0': {'active': 1, 'steps_completed': 2, 'distance_travelled': 0.2, 'ego_vehicle_state': {'angular_velocity': array([-0.12299206, 1.5635582 , 0. ], dtype=float32), 'box': array([3.68, 1.47, 1.4 ], dtype=float32), 'heading': -1.4137963, 'lane_id': 'edge-west-WE_0', 'lane_index': 0, 'linear_velocity': array([11.488274 , 1.8186262, 0. ], dtype=float32), 'position': array([-74.77532766, -0.6 , 0. ]) convert to {'Agent_0': Observation(dt=0.1, step_count=169, steps_completed=1, elapsed_sim_time=17.0, events=Events(collisions=[], off_road=False, off_route=False, on_shoulder=False, wrong_way=False, not_moving=False, reached_goal=False, reached_max_episode_steps=False, agents_alive_done=False), ego_vehicle_state=EgoVehicleObservation(id='Agent_0-bc8960a9', position=array([ 8.16, -3.2 , 0. ])
@DOPEMANdd Sorry, just a follow-up that the scenarios that used to be in the multi-scenario are listed here:
@Gamenot I have one more question: how do I convert the obs of the current dictionary type to the data type of the previous Observation wrapper
Are using HiWayEnvV1
? (because driving-smarts-v2022
should already return Observation
) If you are using HiWayEnvV1
, observations can be formatted or unformatted as demonstrated by the environment formatting configuration example:
Unformatted will give you the Observation
object style observations.
@Gamenot thanks a lot! I will try this
High Level Description
Traceback (most recent call last): File "/data/zhangdi/anaconda3/envs/smart/lib/python3.8/site-packages/gym/envs/registration.py", line 150, in spec return self.env_specs[id] KeyError: 'multi-scenario-v0'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "train_ppo.py", line 67, in
env = gym.make("smarts.env:multi-scenario-v0", scenario="3lane_merge_single_agent", # 可以场景迭代
File "/data/zhangdi/anaconda3/envs/smart/lib/python3.8/site-packages/gym/envs/registration.py", line 184, in make
return registry.make(id, **kwargs)
File "/data/zhangdi/anaconda3/envs/smart/lib/python3.8/site-packages/gym/envs/registration.py", line 105, in make
spec = self.spec(path)
File "/data/zhangdi/anaconda3/envs/smart/lib/python3.8/site-packages/gym/envs/registration.py", line 167, in spec
raise error.UnregisteredEnv("No registered env with id: {}".format(id))
gym.error.UnregisteredEnv: No registered env with id: multi-scenario-v0
Version
1.4
Operating System
No response
Problems
No response