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

Cherry pick regen road functionality #8

Closed
wants to merge 1 commit into from

Conversation

tleyden
Copy link

@tleyden tleyden commented May 19, 2019

Cherry pick this functionality from https://github.com/tawnkramer/sdsandbox/blob/master/src/predict_server.py#L120-L134 to send a directive to the simulator to regenerate the road.

Usage example:

    donkeyEnv = env.envs[0].env
    donkeyEnv.regen_road(rand_seed=int(time.time()))

Copy link
Owner

@araffin araffin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR, I think it would be better to do a bit more change to expose that feature more easily

'rand_seed': rand_seed.__str__(),
'turn_increment': turn_increment.__str__()}

self.sock.queue_message(msg)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not self.queue_message(msg)?

@@ -315,6 +315,22 @@ def send_control(self, steer, throttle):
msg = {'msg_type': 'control', 'steering': steer.__str__(), 'throttle': throttle.__str__(), 'brake': '0.0'}
self.queue_message(msg)

def send_regen_road(self, road_style=0, rand_seed=0, turn_increment=0.0):
'''
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use double quotes and follow the docstring style ;) (:param road_style: (int) ...)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will rework this PR according to https://github.com/hill-a/stable-baselines

@araffin
Copy link
Owner

araffin commented Jun 9, 2019

Hello,

I added those changes in my new PR #9 (which require master version of stable-baselines, that's why I did not merge it yet)
I finally made it working, in fact it came from my computer language, see tawnkramer/sdsandbox#27

@tleyden
Copy link
Author

tleyden commented Jun 10, 2019

Great! Closing this PR since it looks to be redundant.

@tleyden tleyden closed this Jun 10, 2019
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

Successfully merging this pull request may close these issues.

2 participants