- Make the robot code with the Mecademic Portal (self explanatory)
- make a final version that can run the correct part nicely
- Convert robot script into python code (see below)
- Send it to Danny for review :)
install mecademicpy (might already be installed)
pip install mecademicpy
Any program that's written in the browser or mecademic portal can easily be converted into it's python equivalent
Robot Script (192.168.0.100)
MoveJoints(90,0,0,0,0,0)
This is the equivalent code in the correct location:
EDITTHIS.py
class TemplateClass:
...
def pressButton(self):
##########################################################################################
# FIRST BLOCK EXECTUED BY main.py
##########################################################################################
self.rbt.MoveJoints(90,0,0,0,0,0)
...
Notes:
- each method is there only for organization purposes.
- the __init__(...) method should not have any instructions
- Yes, all you need to do add "self.rbt." to make it into valid python code
The vacuum sensor is meant to confirm that a part is either on or off the robot at a specific stage. The two most useful commands are:
Python
# Assert that the robot should have a part ON at the moment. Otherwise, the robot will stop movement.
self.switch.assert_on()
# Asserts that there should be no part on. Same effect as the other method.
self.switch.assert_off()