The main focus of this week’s project was inverse kinematics. We were assigned to use the previous week’s robotic arm and certain elements from the previous week’s code to work on inverse kinematics; i.e., using given positions of the end effector to calculate where the robotic motors should move to.
The first challenge was to use the previous week’s code and essentially reverse it. While the previous week had the robot calculate its end effector position from given motor positions, this week’s code took that resulting position, calculated appropriate angles from given formulae, and moved the motors to those positions; in essence, this challenge was an exercise in performing mathematical operations in Python and confirming that they matched the expected inputs.
The second challenge is similar to the first in its actions, the only difference being the number of executions. Furthermore, a new variable is introduced: whether or not the “wrist” is down and the writing utensil is touching the surface. The input values are stored in three separate arrays: one for X positions, one for Y positions, and one for wrist positions (i.e., up vs down). This allows the robot to draw disconnected lines, allowing more flexibility in execution.
We had some issues in completing Challenge 2. We used print statements to know when to position the robotic arm, and to what the program had calculated for the positions, and to see what the error was. The first issue we ran into was that the print statements would not execute, so we weren't sure when the robot was doing each task. However, even without the print statements, the for loops would often stop before completing entirely, and without print statements we couldn't figure out why this was. Challenge 1 executes well, but the video for Challenge 2 demonstrates these issues.
Photos and videos