Control UR5e with Python/ Execute a .script file with Python

Hi, I have the end goal of trying to use the UR5e with my D435i Depth camera for pick and place tasks with object detection. I am trying to approach this step-by-step as I don’t have a lot of experience with the UR5e outside of using the Teach Pendant. I have just started exploring the TCP/IP Socket communication method and am able to make the cobot move to a particular position (using the moveL) command, but I’m trying to understand a few things:

  1. The coordinate system from the robot frame, world frame, camera frame, etc. What are the coordinates that I am passing into my moveL command, and also, would this take into account the joint limits of my robot?

  2. I have attached the Hand E Gripper, I asked the cobot to move to a particular pose and it was about to cause a collision with the gripper, so does the moveL command not take into account that the gripper is present? Should I be using a different movement control command so it takes into account joint limits + added geometry of the camera?

  3. I am currently embedding the URScript command inside a variable and calling it with the python script, but how do I send multiple movement commands? I tried adding a time.sleep step between each moveL command but it still causes issues with the movement - is there a better way to do this?

  4. Finally, I made a pick&place program on the TP and I got it out of the TP and onto my laptop with the SFTP method, I am now trying to invoke this program with a python script from my laptop - can this be done? If so, can someone provide some resources/code snippets that could help me?

Thanks a lot, super excited to learn more!