Skip to content

Commit

Permalink
Fixed conversion to meters instead of millimeters.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudolph Peter z003n7ht authored and OTL committed Feb 20, 2017
1 parent a27a646 commit 73618a1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nodes/cozmo_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,10 @@ def _publish_tf(self, update_rate):
# Note: Sign for linear velocity is taken from commanded velocities!
# Note: The angular velocity can also be taken from gyroscopes!
delta_pose = self._last_pose - self._cozmo.pose
self._lin_vel = np.sqrt(delta_pose.position.x**2
+ delta_pose.position.y**2
+ delta_pose.position.z**2) * update_rate * np.sign(self._cmd_lin_vel)
dist = np.sqrt(delta_pose.position.x**2
+ delta_pose.position.y**2
+ delta_pose.position.z**2) / 1000.0
self._lin_vel = dist * update_rate * np.sign(self._cmd_lin_vel)
self._ang_vel = -delta_pose.rotation.angle_z.radians * update_rate

# publish odom_frame -> footprint_frame
Expand Down

0 comments on commit 73618a1

Please sign in to comment.