- Download V-REP from here
- Run the installer (make sure you have the recommended disk space)
- In the models tree, open Robots → non-mobile
- Scroll Down to find the UR3 robot.
- Drag two UR3 robots to the platform.
- In the pane on the left most side of the window, click on the scripts button.
- This will open a window that shows all scripts that will be run when you hit the play button
- While the simulation is stopped, double-click on each of the robots' scripts to open and edit it
- Copy the code for each robot into the corresponding script
- Close the script editing windows and the "script" windows
- Click "Play" on the top bar and watch as your robots come to life and mirror each other in real time!
- Install Python from here
- You will also need two use an IDE for Python, we used PyCharm but you can use whatever you like
- Connecting Python to the V-REP simulator are is a onetime process that you will have to do before you can run the provided Python code
- There is an excellent video that you can use to achieve this that explains it much better than any README file could. Link to video.
- With that, here are some things to look out for when following the instructions in the video a. Make sure you have the right version of V-REP installed. We used educational version. If you have the player version installed then you will not be successful. b. Make sure you have the right version of Python installed. We use Python 3 and there may be potential incompatibilities using Python 2
-
The schematics for the KUKA robot are available in this PDF. The joint locations and orientations are located on page 10, and relevant robot dimensions are located on page 13. If you want, the maximum and minimum angle restrictions are available on page 12.
-
From these diagrams and measurements, you can sketch a similar schematic to that shown in "ForwardKinematics.pdf", drawn in the style of ECE470 homework assignments.
-
To derive forward kinematics, write a quick Python program in Jupyter Notebook, with your expert knowledge of forward kinematics. With this program, you can derive a spatial screw of the robot, which you can then matrix multiply by an array of thetas representing each joint angle, to derive a predicted end position frame for the robot's end effector.
-
Now that you have calculated out the forward kinematics, use the derived screw in the Python code connected to the V-REP simulator to draw a predicted end effector frame when given a certain set of theta joint angles
Our code consists of three main components. First, the VREP API is used to connect to the simulation session through Python. This is done by starting a simulation server, then requesting a clientID for the session.
Next, we enumerate the Kuka's joints by requesting handlers for each joint. All joints are initialized to zero. Next, the user is prompted for a set of seven joint angles for the final pose. These angles are then used to calculate the forward kinematics of the robot.
In addition to this, a dummy object is used to visualize the frame object
- Install Python from here
- You will also need two use an IDE for Python, we used PyCharm but you can use whatever you like
- Connecting Python to the V-REP simulator are is a onetime process that you will have to do before you can run the provided Python code
- There is an excellent video that you can use to achieve this that explains it much better than any README file could. Link to video.
- With that, here are some things to look out for when following the instructions in the video a. Make sure you have the right version of V-REP installed. We used educational version. If you have the player version installed then you will not be successful. b. Make sure you have the right version of Python installed. We use Python 3 and there may be potential incompatibilities using Python 2
We calculate inverse kinematics through an iterative, numerical method. The rough steps are as follows:
- Make first theta guess of robot position
- Find the current pose of the robot end effector given the current theta guess
- Determine a spatial twist to align the robot end effector frame with the desired frame with 1 second
- Find the space Jacobian as a function of current theta
- Perform the inverse velocity kinematics, and find thetadot. Use the new algorithm which works on robots with more/less than 6 joints!
- Calculate the new set of theta angles for the robot joints by applying our calculated thetadot for 1 second
- Repeat steps 2-6 until the norm of our spatial twist is below a specified cutoff! The exact functions and code are found in the inverse_kinematics.py file in this folder.
Our code consists of several major components. First, as in the previous week, use the VREP API to start a simulation server and connect to the simulation session through Python. First, the VREP API is used to connect to the simulation session through Python. Next, grab handlers for each of the Kuka's joints, as well as the user-movable dummy. All the Kuka's joints are initialized to zero. The user may now click on the generated dummy to select it and change its position and orientation. This is the robot's new desired pose. The robot will, in realtime, attempt to calculate a set of thetas to move its end effector to the user-selected destination, as the user moves the dummy around. If the destination position and orientation are unreachable, the robot will alert you that "I'm sorry Tim, I'm afraid I can't do that."
- Install Python from here
- You will also need two use an IDE for Python, we used PyCharm but you can use whatever you like
- Connecting Python to the V-REP simulator are is a onetime process that you will have to do before you can run the provided Python code
- There is an excellent video that you can use to achieve this that explains it much better than any README file could. Link to video.
- With that, here are some things to look out for when following the instructions in the video a. Make sure you have the right version of V-REP installed. We used educational version. If you have the player version installed then you will not be successful. b. Make sure you have the right version of Python installed. We use Python 3 and there may be potential incompatibilities using Python 2
Our code consists of three main components. First, the VREP API is used to connect to the simulation session through Python. This is done by starting a simulation server, then requesting a clientID for the session.
Next, we enumerate the KUKA's joints by requesting handlers for each joint. All joints are initialized to zero. Next, the user is prompted for a set of seven joint angles for the final pose. These angles are then used to calculate the forward kinematics of the robot.
In addition to this, a dummy object is used to visualize the frame object
Click on the sphere to select it. You can now drag it around to represent the desired end position and orientation (pose) of the robot. The robot should follow the sphere to the new location. In case the sphere is posed out of bounds, the robot just remains in the last position while an error message is printed to the terminal.
To demonstrate object collision detection, we used 5 different dummy objects to represent external objects. Click on a dummy and then click on move object tool. The dummy can be dragged to any position and released. The robot can then be moved using the method described above. Once moved, if the robot is in collision with any of the movable, external obstacles, a collision will be reported.
When the robot is moved to a new position, it will not only check for collisions with external objects, but also check for collisions with itself. The robot has a bounding sphere at each joint. If that bounding sphere comes in contact with another joint bounding sphere, the robot is in self collision. A warning is printed to the terminal. For simplicity each joint is checked against every other joint.
- Install Python from here
- You will also need two use an IDE for Python, we used PyCharm but you can use whatever you like
- Connecting Python to the V-REP simulator are is a onetime process that you will have to do before you can run the provided Python code
- There is an excellent video that you can use to achieve this that explains it much better than any README file could. Link to video.
- With that, here are some things to look out for when following the instructions in the video a. Make sure you have the right version of V-REP installed. We used educational version. If you have the player version installed then you will not be successful. b. Make sure you have the right version of Python installed. We use Python 3 and there may be potential incompatibilities using Python 2
Our code consists of three main components. First, the VREP API is used to connect to the simulation session through Python. This is done by starting a simulation server, then requesting a clientID for the session.
Next, we enumerate the KUKA's joints by requesting handlers for each joint. All joints are initialized to zero. Next, the user is prompted for a set of seven joint angles for the final pose. These angles are then used to calculate the forward kinematics of the robot.
In addition to this, a dummy object is used to visualize the frame object
Click on the sphere to select it. You can now drag it around to represent the desired end position and orientation (pose) of the robot. The robot should follow the sphere to the new location. In case the sphere is posed out of bounds, the robot just remains in the last position while an error message is printed to the terminal.
To demonstrate object collision detection, we used 5 different dummy objects to represent external objects. Click on a dummy and then click on move object tool. The dummy can be dragged to any position and released. The robot can then be moved using the method described above. Once moved, if the robot is in collision with any of the movable, external obstacles, a collision will be reported.
When the robot is moved to a new position, it will not only check for collisions with external objects, but also check for collisions with itself. The robot has a bounding sphere at each joint. If that bounding sphere comes in contact with another joint bounding sphere, the robot is in self collision. A warning is printed to the terminal. For simplicity each joint is checked against every other joint.
We start by acquiring the current position of the robot and using inverse kinematics to figure out the θstart set.
The Guiding Sphere(TM) then indicates the X Y Z coordinates of our target location. We again use Inverse Kinematics to turn this into a θgoal set.
We perform the following steps in a loop till we successfully find a path from θstart to θgoal.
- Generate a random θ set
- check if the θ set would be in collision a. if in collision go back to step 1 and repeat. b. once you find a valid θ set go to step 3
- Check the distance of the current θ set and the last node in θ
startand θgoal. - Add the θ set to θ
startor θgoal, whichever one has the shorter distance.
As we add theta in our configuration-space to either the start or end trees, we will visualize the position of the end-effector that corresponds to these thetas, with either a green sphere (attached to the goal tree), or a red sphere (attached to the starting tree) Finally, once we discover a path from the start-theta tree to the end-theta tree, the robot will iterate through the waypoints that represent this path, until it reaches the goal pose. The user will then be able to move the guidance sphere and hit 'enter' to indicate to the robot to repeat the above process