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

Don't _propogate_scene_tree() for None objects #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tdamsma
Copy link

@tdamsma tdamsma commented Apr 26, 2024

When an object is removed, it is set to None, and thus doesn't have the _propogate_scene_tree() method.

Example of what is not wokring now

from swift import Swift
from spatialgeometry import Sphere
from spatialmath import SE3

backend = Swift()
backend.launch()
shp1 = Sphere(radius=1, base=SE3(0, 0, 0))
backend.add(shp1)
backend.remove(shp1)
backend.step()
File [swift/swift/Swift.py:227], in Swift.step(self, dt, render)
    [225]# Update world transform of objects
    [226]for obj in self.swift_objects:
--> [227]     obj._propogate_scene_tree()
    [229]# Adjust sim time
    [230]self.sim_time += dt

AttributeError: 'NoneType' object has no attribute '_propogate_scene_tree'

When an object is removed, it is set to None, and thus doesn't have the _propogate_scene_tree() method.
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.

None yet

1 participant