cccat6's picture
Initial FlowMo-WM public code release
604e535 verified
raw
history blame
427 Bytes
"""Known boat dynamics model without external flow."""
import numpy as np
def predict_next_state(state, action, config):
next_state = np.asarray(state, dtype=np.float32).copy()
theta = float(next_state[2])
speed = 0.04 * float(np.mean(action[:2]))
next_state[0] += speed * np.cos(theta)
next_state[1] += speed * np.sin(theta)
next_state[2] += 0.03 * float(action[0] - action[1])
return next_state