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

Changing a platform's movement_controller doesn't change a sensor's movement_controller. #1025

Open
gawebb-dstl opened this issue May 23, 2024 · 3 comments

Comments

@gawebb-dstl
Copy link
Contributor

I think it is rare that the movement_controller property on a platform is changed. However it is worth noting that changing a platform's movement_controller doesn't change the attached sensors' movement_controller. I've a pasted a snippet below which demostrates this.

timestamp = datetime.datetime.now()
fixed_state = State(np.array([[2], [2], [0]]),
                    timestamp)
fixed = FixedMovable(states=fixed_state, position_mapping=(0, 1, 2))
platform = MovingPlatform(movement_controller=fixed)

platform.add_sensor(DummySensor())
assert platform.movement_controller is sensor.movement_controller

moving_state = State(np.array([[2], [1], [2], [-1], [2], [0]]), timestamp)
moving = MovingMovable(states=moving_state, position_mapping=(0, 2, 4), transition_model=None)

platform.movement_controller = moving

assert platform.movement_controller is sensor.movement_controller  # This fails/
@gawebb-dstl
Copy link
Contributor Author

gawebb-dstl commented May 23, 2024

Option 1: Make the movement_controller property read only.

I currently prefer this option. If the platform had already started moving, replacing the movement_controller would be rewriting the platform's history.

@gawebb-dstl
Copy link
Contributor Author

Option 2: Add a setter for the movement_controller property.

@gawebb-dstl
Copy link
Contributor Author

What are your thoughts @erogers-dstl ?

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

No branches or pull requests

1 participant