File size: 427 Bytes
604e535
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
"""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