Stone-Soup icon indicating copy to clipboard operation
Stone-Soup copied to clipboard

Changing a platform's `movement_controller` doesn't change a sensor's `movement_controller`.

Open gawebb-dstl opened this issue 9 months ago • 3 comments

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 avatar May 23 '24 11:05 gawebb-dstl