Dead-Reckoning Odometry Step
Implement odometry_step(pose, v, omega, dt), where pose is [x, y, theta], returning the new [x, y, theta].
Examples
Straight ahead: the zero-omega branch, no division by zero
- Input
- odometry_step([0, 0, 0], 1, 0, 2)
- Output
- [2, 0, 0]
A quarter circle: the arc lands short of the Euler step in x and off the axis in y
- Input
- odometry_step([0, 0, 0], 1, 1.5707963267948966, 1)
- Output
- [0.63662, 0.63662, 1.5708]
A spin on the spot: the heading turns, the position does not
- Input
- odometry_step([1, 2, 0], 0, 1, 1)
- Output
- [1, 2, 1]
Hints
Hint 1
Convert the input with before doing elementwise work.
Hint 2
Watch for this: integrated with a straight line euler step at the old heading.
Requirements
pose: (3,) array [x, y, theta]v: forward speedomega: turn rate: time step
Return (3,) array [x, y, theta], heading wrapped into (-pi, pi]
Constraints
Allowed library: NumPy only
Time limit: 200 ms, Memory: 64 MB
Try similar problems(4)
Industrial Robotics: Kinematics and Control · ~16 min
Industrial Robotics: Kinematics and Control · ~14 min
Industrial Robotics: Kinematics and Control · ~16 min
Industrial Robotics: Kinematics and Control · ~18 min
Where this shows up
6 employers weight this skill
4 autonomy companies, 2 defense companies. Top match scores 92.
import numpy as np
def odometry_step(pose, v, omega, dt):
"""
One exact arc integration of a differential-drive pose.
Args:
pose: (3,) array [x, y, theta]
v: forward speed
omega: turn rate
dt: time step
Returns:
(3,) array [x, y, theta], heading wrapped into (-pi, pi]
"""
# YOUR CODE HERE
pass