This repository has been archived by the owner on Dec 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fixes #7. Accelerometers' data converted to angles. SDK initiali…
…zes from accelerometers and doesn't require a specific pose upon initialization any more (which wasn't feasible and repeatable anyway). Calibration instructions and tool created.
- Loading branch information
1 parent
fbfeb28
commit bfb7e1e
Showing
7 changed files
with
118 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#! /usr/bin/env python | ||
|
||
""" | ||
open-dobot Calibration Tool. | ||
This tool continuously reports accelerometers and angles from those. | ||
Use this tool to find offsets for your accelerometers: | ||
1. Turn off power on the arm and disconnect USB cable | ||
2. Remove accelerometers from the arm and put them on a flat surface that has no inclination | ||
3. Connect USB cable | ||
4. Enable accelerometers reporting mode | ||
4.1. Push and "sensor Calibration" button | ||
4.2. Push and release "Reset" button | ||
4.3. Start this tool (still holding "Sensor Calibration" button) | ||
4.4. Wait for the accelerometer data to start flowing on your console/whatever_you_use_to_start_this_tool | ||
4.5. Release the "Sensor Calibration" button | ||
5 Gently push the accelerometers so that they are evenly on the surface. Don't touch any contacts/leads. | ||
You can push them one by one, not necessary to push both at the same time | ||
6. Note the "Raw" data from accelerometers reported on the console. Those are your accelerometers' offsets | ||
7. Turn off power on the arm, disconnect USB cable, mount accelerometers back onto the arm | ||
Author: maxosprojects (March 18 2016) | ||
Additional Authors: <put your name here> | ||
Version: 0.4.0 | ||
License: MIT | ||
""" | ||
import math | ||
|
||
from DobotDriver import DobotDriver | ||
|
||
driver = DobotDriver('/dev/tty.usbmodem1421', 115200) | ||
driver.Open() | ||
|
||
# Offsets must be found using this tool for your Dobot once | ||
# (rear arm, forearm) | ||
offsets = (1024, 1024) | ||
|
||
def toEndEffectorHeight(rear, fore): | ||
return 88.0 - 160.0 * math.sin(fore) + 135.0 * math.sin(rear) | ||
|
||
while True: | ||
ret = driver.GetAccelerometers() | ||
print "Rear arm: {0:10f} | Forearm: {1:10f} | End effector height: {2:10f} | Raw rear arm: {3:4d} | Raw forearm: {4:4d}".format(\ | ||
driver.accelToAngle(ret[1], offsets[0]), driver.accelToAngle(ret[2], offsets[1]),\ | ||
toEndEffectorHeight(driver.accelToRadians(ret[1], offsets[0]), driver.accelToRadians(ret[2], offsets[1])),\ | ||
ret[1], ret[2]) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.