Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. Once you are familiar with the CopperliaSim environment, you will design a 2 degree of freedom robotic arm as shown in Figure 1
2. Once you are familiar with the CopperliaSim environment, you will design a 2 degree of freedom robotic arm as shown in Figure 1 in CopperliaSim. The scene will be called RBT4801_2DOF.ttt. Parameters of the robot are: L = 0.5 m, L2 = 0.4 m. N L2 92 X COM 91 Figure 1: Two DOF robot Each Center of Mass (COM) is aligned with each segment and located at a distance k = Li 0.5 and i = 1,2 from the corresponding joint centre carrying the segment. Each segment has a mass M = 2 Kg and M2 = 1 kg. The segment inertias are defined in the plane as I = k M for each segment. 3 Step 3: Python - CorpeliaSim co-simulation Accessing CoppeliaSim via Python's APIs. 1. Create a working directory (Folder where you'll be working in) 2. Navigate to your CoppeliaSim installation folder (e.g "C:\Program Files\Coppelia Robotics\ Coppelia SimEdu") 3. Navigate into the programming emoteApiBindings\python\python 4. Copy all the .py files into your working folder 5. Navigate into the programming emoteApiBindings\lib\\lib\ 6. Copy the .dll file to your working directory. Setting up a Server Now, on CoppeliaSim your scene needs to start a server so that the python scripts can connect to it. To start the server you have to add a threaded script to an object in your scene that will start the server. 1. Open your 2DOF scene 2. Click on Add Associated Child Script Threaded Script 3. Open the script by double clicking on the "file" icon next to "Base" 4. Find the function "sysCall_init()" 5. Write the following as the only line in that method: "simRemoteApi.start(19999) 6. Find the function "sysCall_actuation()" 7. Delete everything inside that method, but not the method itself. 8. Close the script, save the scene and start the simulation. Setting up the Client Switch to Python (Spyder, Terminal or your favourite IDE). Open a new file and immediately save it to your working directory as 2DOF.py Once the connection is established, you can now control the scene from the python script. More information about the APIs can be found at https://www.coppeliarobotics.com/ helpFiles/en/remoteApiFunctionsPython.htm 4 Step 4: Python - CorpeliaSim co-simulation and con- trol law Implement a PID controller in Python to control the robot joints.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started