Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set the spectator on the agent #59

Open
Panshark opened this issue Mar 11, 2022 · 1 comment
Open

How to set the spectator on the agent #59

Panshark opened this issue Mar 11, 2022 · 1 comment

Comments

@Panshark
Copy link

Panshark commented Mar 11, 2022

Hi @praveen-palanisamy ,

I am now working on a multi-agent project, and I want to set the env spectator on the agent vehicle. For example, from the rear of the car, a fixed third-person view to the vehicle. Do you know how to do that? Really thanks a lot!

Besides, when the code throws this exception in line 999 of multi_env.py:

except Exception:
            print("Error during step, terminating episode early.",
                  traceback.format_exc())
            self._clear_server_state()

My training step in the code will get cannot unpack non-iterable NoneType object error. I know why it could happen since the step function doesn't have a normal return this time, but I don't know how to handle it. Could you give me some examples about How do people normally deal with this error?

Best regards

@Panshark
Copy link
Author

Panshark commented Mar 11, 2022

I used this to fix the second problem:

            self.last_obs_dict = obs_dict
            self.last_reward_dict = reward_dict
            self.last_info_dict = info_dict
            
            return obs_dict, reward_dict, self._done_dict, info_dict
        except Exception:
            print("Error during step, terminating episode early.",
                  traceback.format_exc())
            if not self._done_dict[actor_id]:
                self._done_dict[actor_id] = True
            self._dones.add(actor_id)
            self._clear_server_state()
            return self.last_obs_dict, self.last_reward_dict, self._done_dict, self.last_info_dict

However, I still can see this error:

RuntimeError: time-out of 10000ms while waiting for the simulator, make sure the simulator is ready and connected to localhost:59735

I don't think this mistake is important, isn't it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant