Differential Drive Forward Kinematics
Implement diff_drive_velocity(r, L, omega_left, omega_right) returning the array [v, omega].
Examples
Both wheels at the same speed: straight ahead, no turn
- Input
- diff_drive_velocity(0.1, 0.5, 10, 10)
- Output
- [1, 0]
Equal and opposite: a spin on the spot, no forward motion
- Input
- diff_drive_velocity(0.1, 0.5, -10, 10)
- Output
- [0, 4]
Left wheel stopped: the base pivots about it
- Input
- diff_drive_velocity(0.1, 0.5, 0, 10)
- Output
- [0.5, 2]
Hints
Hint 1
Convert the input with before doing elementwise work.
Hint 2
A common slip here: divided the turn rate by 2L instead of L.
Requirements
r: wheel radiusL: distance between the wheelsomega_left: left wheel angular velocity, rad/somega_right: right wheel angular velocity, rad/sReturn (2,) array [v, omega]: forward speed and turn rate
Constraints
Allowed library: NumPy only
Time limit: 200 ms, Memory: 64 MB
Try similar problems(4)
Industrial Robotics: Kinematics and Control · ~12 min
Industrial Robotics: Kinematics and Control · ~12 min
Industrial Robotics: Kinematics and Control · ~10 min
Industrial Robotics: Kinematics and Control · ~14 min
Where this shows up
6 employers weight this skill
4 autonomy companies, 2 defense companies. Top match scores 93.
import numpy as np
def diff_drive_velocity(r, L, omega_left, omega_right):
"""
Body velocity of a differential-drive base from its wheel speeds.
Args:
r: wheel radius
L: distance between the wheels
omega_left: left wheel angular velocity, rad/s
omega_right: right wheel angular velocity, rad/s
Returns:
(2,) array [v, omega]: forward speed and turn rate
"""
# YOUR CODE HERE
pass