def build_platform(sensors, x_velocity): state = State(state_vector=[[0], [x_velocity], [0], [0]], timestamp=datetime.datetime(2020, 4, 1)) model_1d = ConstantVelocity(0.0) # zero noise so pure movement trans_model = CombinedLinearGaussianTransitionModel([model_1d] * 2) position_mapping = np.array([[0, 2]]) platform = MovingPlatform(states=state, sensors=sensors, transition_model=trans_model, position_mapping=position_mapping) return platform
from stonesoup.models.transition.linear import ( CombinedLinearGaussianTransitionModel, ConstantVelocity) from stonesoup.platform.base import MovingPlatform from stonesoup.types.state import State time_step = datetime.timedelta(seconds=0.1) time_init = datetime.datetime.now() transition_model = CombinedLinearGaussianTransitionModel( [ConstantVelocity(1.), ConstantVelocity(1.), ConstantVelocity(1.)]) red = MovingPlatform(position_mapping=[0, 2, 4], velocity_mapping=[0, 2, 4], states=State([50., 0., -50., 10., 0., 0.], timestamp=time_init), transition_model=transition_model) # %% # Move target for s in range(1, 100): red.move(time_init + s * time_step) # %% # Measure target states # ^^^^^^^^^^^^^^^^^^^^^ # The states are measured with and without noise to show the real position with the measured one. measurements = [] noiseless_measurements = []
# \end{bmatrix} # First import the Moving platform from stonesoup.platform.base import MovingPlatform # Define the initial platform position, in this case the origin initial_loc = StateVector([[0], [0], [0], [50], [8000], [0]]) initial_state = State(initial_loc, start_time) # Define transition model and position for 3D platform transition_model = CombinedLinearGaussianTransitionModel( [ConstantVelocity(0.), ConstantVelocity(0.), ConstantVelocity(0.)]) # create our fixed platform sensor_platform = MovingPlatform(states=initial_state, position_mapping=(0, 2, 4), velocity_mapping=(1, 3, 5), transition_model=transition_model) # %% # With our platform generated we now need to build a set of sensors which will be mounted onto the platform. In this # case we will exploit a :class:`~.RadarElevationBearingRangeRate` and a :class:`~.PassiveElevationBearing` sensor # (e.g. an optical sensor, which has no capability to directly measure range). # # First we will create a radar which is capable of measuring bearing (:math:`\phi`), elevation (:math:`\theta`), range # (:math:`r`) and range-rate (:math:`\dot{r}`) of the target platform. # Import a range rate bearing elevation capable radar from stonesoup.sensor.radar.radar import RadarElevationBearingRangeRate # Create a radar sensor radar_noise_covar = CovarianceMatrix(np.diag(
# First import the Moving platform from stonesoup.platform.base import MovingPlatform # Define the initial platform position, in this case the origin initial_loc = StateVector([[0], [0], [0], [50], [8000], [0]]) initial_state = State(initial_loc, start_time) # Define transition model and position for 3D platform transition_model = CombinedLinearGaussianTransitionModel( [ConstantVelocity(0.), ConstantVelocity(0.), ConstantVelocity(0.)]) # create our fixed platform sensor_platform = MovingPlatform(states=initial_state, position_mapping=(0, 2, 4), velocity_mapping=(1, 3, 5), transition_model=transition_model) # %% # With our platform generated we now need to build a set of sensors which will be mounted onto the platform. In this # case we will exploit a :class:`~.RadarElevationBearingRangeRate` and a :class:`~.PassiveElevationBearing` sensor # (e.g. an optical sensor, which has no capability to directly measure range). # # First we will create a radar which is capable of measuring bearing (:math:`\phi`), elevation (:math:`\theta`), range # (:math:`r`) and range-rate (:math:`\dot{r}`) of the target platform. # Import a range rate bearing elevation capable radar from stonesoup.sensor.radar.radar import RadarElevationBearingRangeRate # Create a radar sensor radar_noise_covar = CovarianceMatrix(