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

Bug : Motor and pin won't work #27

Open
Hrishi1999 opened this issue Jan 10, 2017 · 6 comments · May be fixed by #59
Open

Bug : Motor and pin won't work #27

Hrishi1999 opened this issue Jan 10, 2017 · 6 comments · May be fixed by #59

Comments

@Hrishi1999
Copy link

Hello,
I was just using Physics and I found a strange bug. Now, make a machine and erase everything. Make another machine again, stop, and then add a pin and a motor to an object. Then play, you will see that nor the motor would work nor the object would be stuck at the same place. Using physics 31

@quozl
Copy link
Collaborator

quozl commented Jan 11, 2017

What does "make a machine" mean? I do see three of the four Show sample projects do not work and the fourth slows down and stops.

@Hrishi1999
Copy link
Author

A machine (here) like for example use circle tool and add a motor.

@quozl
Copy link
Collaborator

quozl commented Jan 11, 2017

Okay, thanks, I've reproduced the problem from your description; there's a lot more to it;

  • stop the world, ctrl+space,
  • select circle tool, ctrl+c,
  • draw a circle,
  • select motor tool, ctrl+m,
  • place a motor in the centre of the circle,
  • start the world, ctrl+space,
  • observe spinning circle,
  • erase all, ctrl+a,
  • stop the world, ctrl+space,
  • select circle tool, ctrl+c,
  • draw a circle,
  • select motor tool, ctrl+m,
  • place a motor in the centre of the circle,
  • start the world, ctrl+space,
  • observe circle is not spinning and falls with gravity.

At this point, the erase all button is not sensitive.

Workaround is to restart Physics, however a Keep Error happens during Stop.

1484166694.100760 ERROR root: Error saving activity object to datastore
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/sugar3/activity/activity.py", line 1087, in _prepare_close
    self.save()
  File "/usr/lib/python2.7/dist-packages/sugar3/activity/activity.py", line 896, in save
    self.write_file(file_path)
  File "/usr/share/sugar/activities/Physics.activity/activity.py", line 127, in write_file
    self.game.write_file(file_path)
  File "/usr/share/sugar/activities/Physics.activity/physics.py", line 89, in write_file
    self.world.json_save(path, additional_data, serialize=True)
  File "/usr/share/sugar/activities/Physics.activity/myelements/elements.py", line 481, in json_save
    worldmodel = self.get_world_model(additional_vars, serialize)
  File "/usr/share/sugar/activities/Physics.activity/myelements/elements.py", line 547, in get_world_model
    modeljoint['body1'] = joint.bodyA.userData['saveid']
TypeError: 'NoneType' object has no attribute '__getitem__'

Another workaround is to use erase ctrl+e instead of erase all ctrl+a.

@Hrishi1999
Copy link
Author

Hrishi1999 commented Jan 12, 2017

I am aware of the workaround but this gets annoying sometimes.
(sorry for reopening issue, my phone screen is a bit broken and it accidentally pressed close issue:()

@quozl
Copy link
Collaborator

quozl commented Jan 12, 2017

No worries, I wasn't documenting the two workarounds for you only, but also for everybody else. It is common for the workaround(s) of a problem to go some way toward explaining the cause.

@quozl
Copy link
Collaborator

quozl commented May 1, 2020

12c5f70 fixes the traceback mentioned above, but not the other problems.

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 a pull request may close this issue.

2 participants