FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit e4213f90 authored by CK Lee's avatar CK Lee
Browse files

Fixed odrives. Now working.

parent fb3fdd26
No related branches found
No related tags found
No related merge requests found
......@@ -38,8 +38,8 @@ flippers_rear_offset = 605
flippers_scale = 2 * pi/1024.0
# TODO: Set these as parameters
odrives_cpr = 8192
tracks_gear_ratio = 5
odrives_cpr = 8192.0
tracks_gear_ratio = 32.0
# Service callbacks for flippers_front_...
......@@ -92,7 +92,7 @@ def tracks_left_read(req):
def tracks_left_write(req):
if tracks.is_connected():
# WRITE AXIS0
vel_cmd = (req.cmd.data/(2*pi))*odrives_cpr*tracks_gear_ratio
vel_cmd = -(req.cmd.data/(2*pi))*odrives_cpr*tracks_gear_ratio
tracks.write_velocity_axis0(vel_cmd);
tracks_left_res.vel.data = req.cmd.data
return WriteHardwareResponse(True)
......@@ -116,7 +116,7 @@ def tracks_right_write(req):
if tracks.is_connected():
# WRITE AXIS1
vel_cmd = (req.cmd.data/(2*pi))*odrives_cpr*tracks_gear_ratio
tracks.write_velocity_axis1(req.cmd.data)
tracks.write_velocity_axis1(vel_cmd)
tracks_right_res.vel.data = req.cmd.data
return WriteHardwareResponse(True)
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment