Sub-Project 2: Inverse Kinematics and Coordinate Systems
In sub-project 2, each group should make a system able to:
- Steer the claw on a robotic arm to a requested position on the workbench in front of the robotic arm by setting appropriate joint angles.
- Be able to tell, from an image of the workbench, at which coordinates there are Lego bricks.
- “Pick up” the Lego bricks, in some suitable (reasonably fast) order.
Sub-project 2 is carried out in a robot simulator that has been developed for the course.
Robot simulator
Insanely brief instruction
- Install Blender (works extremely poorly on Raspberry Pi — use another computer). Note: There seems to be a problem with v3.4 and later, so stick with v3.3 for now.
- Download the robot simulator and the client script.
- Start Blender from a terminal, to see potential errors or to see what is printed using
print()
orcapture()
. -
Open
robot.blend
in Blender, press the play button in the text editor. A text at the centre bottom of the Blender window will start blinking, indicating that the server is running. It is not possible to use the program to anything else while this is running. If you want to change view in the 3D window, you have to stop the server using ESC or the left mouse button. - Start the client separately, e.g. from another terminal or IDE on the same computer.
In the 3D window
- Rotate using the middle mouse button + move.
- Pan using shift + middle mouse button + move.
- Zoom using the scroll wheel.
- Set the camera (for the rendering) to the current view using Ctrl+Alt+Num 0.
If something stops working, restart Blender. (This is the easiest way.)
Hints for sub-project 2
- The client script communicates with the robot arm in Blender through a local network socket, which is often silently blocked by firewalls and antivirus programs on Windows and Mac.
-
It is possible to use
state()
from the client script to find out the position of the claw. This can be exploited to determine the lengths of the different segments! - Before attempting the inverse kinematics (3D position → angles), first make sure that you understand the forward kinematics (angles → 3D position).
- It will be difficult before lecture 2 to handle images taken at an angle, so for simplicity, start with images taken straight from above.
- The Lego bricks in the robot simulator might require different thresholds than the ones you used in project 1. Don't lose the values you used in project 1 — they will soon be needed again, in project 3!