CNCLgithub / GalileoEvents

Galileo + Events
MIT License
2 stars 0 forks source link

creating billiard dataset #21

Closed belledon closed 4 years ago

belledon commented 4 years ago

Hey @jeffzma2000 ,

I added the two classes BilliardWorld and BilliardSim which should handle similarly to the 3ball stuff.

can you please create a script called scripts/stimuli/billiard_dataset.sh/py that makes some trials that we discussed today?

I imagine there might be some bugs but you should be able to render it with scripts/stimuli/render_billiard.py

belledon commented 4 years ago

thanks for the patience @jeffzma2000 ,

I ironed a few bugs after playing with your script. You should be able to take it form here. (pull and update submodules)

The current error should be

Traceback (most recent call last):
  File "scripts/stimuli/create_billiard_dataset.py", line 161, in <module>
    main()
  File "scripts/stimuli/create_billiard_dataset.py", line 128, in main
    init_pos_transformed, init_vels)
  File "scripts/stimuli/create_billiard_dataset.py", line 42, in make_scene
    scene.add_object(str(name), obj, x=pos[0], y=pos[1], vel = vel)
IndexError: invalid index to scalar variable.

Basically positions need to be treated a little differently now. The are objective XY so no conversions should be needed.

jeffzma2000 commented 4 years ago

https://github.com/CNCLgithub/galileo-ramp/blob/e93c5fbb7b47daa168cc4b462176679b86d850c9/scripts/stimuli/create_billiard_dataset.py#L44-L54

When I render the blend file, it looks like the second ball moves first with this script. I'm not sure why this is happening. @belledon

jeffzma2000 commented 4 years ago

Never mind, they were just too close together.