You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 22, 2022. It is now read-only.
This fixes#7. Accelerometers' data converted to angles. SDK initializes 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.
Copy file name to clipboardExpand all lines: application/fpga/python/DobotInverseKinematics.py
+21-12Lines changed: 21 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,19 @@
22
22
algorithm
23
23
24
24
xy plane is paralell to surface dobot is on. z is perpendicular
25
-
1. first get distance, in xy plane, to current point from origin using forward kinematics, known angles, and pythagoreas thm. This is your radius. Your angle can be defined to be theta original. You now have your starting point in polar coordinates.
26
-
2. Ignore the desired z position data for now. Get the polar coordinates for the desired point. The radius is not important now. The angle is though. Subtracting the desired angle from the current angle gives you the number of degrees and direction to rotate the base.
27
-
3. The radius from step 1 (starting radius) gives you your current horizontal position (imagine it as x or y, doesn't matter). You also already know your current z position (potentially from step 1).
28
-
4. The radius from step 2 (desired radius) gives you your desired horizontal position (imagine it as x or y, doesn't matter). Of course, the user has already input the desired z position. This is now a 2D problem with two arms that each rotate (2 degrees of freedom)
29
-
5: use IK, see ik 2d video, to find number of degrees and direction to rotate rear and fore arms. Note that there are often two solutions. One (elbow down) is not possible.
25
+
1. first get distance, in xy plane, to current point from origin using forward kinematics, known angles,
26
+
and pythagoreas thm. This is your radius. Your angle can be defined to be theta original. You now have your
27
+
starting point in polar coordinates
28
+
2. Ignore the desired z position data for now. Get the polar coordinates for the desired point. The radius is
29
+
not important now. The angle is though. Subtracting the desired angle from the current angle gives you the
30
+
number of degrees and direction to rotate the base
31
+
3. The radius from step 1 (starting radius) gives you your current horizontal position (imagine it as x or y,
32
+
doesn't matter). You also already know your current z position (potentially from step 1)
33
+
4. The radius from step 2 (desired radius) gives you your desired horizontal position (imagine it as x or y,
34
+
doesn't matter). Of course, the user has already input the desired z position. This is now a 2D problem with
35
+
two arms that each rotate (2 degrees of freedom)
36
+
5: use IK, see ik 2d video, to find number of degrees and direction to rotate rear and fore arms. Note that there
37
+
are often two solutions. One (elbow down) is not possible.
30
38
6. Check that move is valid (e.g. not out of range, etc...)
31
39
7. move
32
40
@@ -58,7 +66,7 @@ def _debug(self, *args):
58
66
#cartesian (x,y,z) coordinate
59
67
#robot dimensions
60
68
#output:
61
-
#angles for robot arm base, rear, and fore arms in degree
69
+
#angles for robot arm base, rear, and fore arms in degrees
62
70
defconvert_cartesian_coordinate_to_arm_angles(self, x, y, z):
63
71
64
72
# do a general check to see if even a maximally stretched arm could reach the point
# can read the angles from the IMU and empirically determine the radius and angle - I'm using this approach since it should account for any build up in error, assuming accelerometers
167
-
#are accurate!!!!
168
-
#alternatively can just use pythagorean thm on theoretical current x,y data
173
+
#get polar coordinates for the current point
174
+
#radius is simply given by the base angle
175
+
# can read the angles from the IMU and empirically determine the radius and angle - I'm using this approach
176
+
# since it should account for any build up in error, assuming accelerometers are accurate!!!!
177
+
#alternatively can just use pythagorean thm on theoretical current x,y data
0 commit comments