This article refer to a deprecated version of the Python API. For the new version and its documentation, please visit our github page.
Mecademic Python API is a python module designed for Robot products from Mecademic. The module offers tools that give access to all the features of the Mecademic Robots such as MoveLin and MoveJoints. The module can be started from a terminal or a python application and controls the Mecademic Products.
Supported Robots
- Meca500 R3
Prerequisites
To be able to use the module without unexpected errors, the user must have a copy of python installed on their machine and it is recommended to use python version 3.6 or higher. Python can be installed from its main website (a reboot will be require after the installation to complete the setup).
Getting Started
To download and install the module, please refer to the Github page for step by step instructions.
Program
The RobotController class is used to send the robot commands and read the responses on Port 10000. An example of a script for a Mecademic Robot would be:
import MecademicRobot
robot = MecademicRobot.RobotController('192.168.0.100')
robot.Connect()
robot.Activate()
robot.Home()
robot.SetBlending(0)
robot.SetJointVel(100)
while True:
robot.MoveJoints(0,0,0,170,115,175)
robot.MoveJoints(0,0,0,-170,-115,-175)
robot.MoveJoints(0,-70,70,0,0,0)
robot.MoveJoints(0,90,-135,0,0,0)
robot.GripperClose()
robot.MoveJoints(0,0,0,0,0,0)
robot.MoveJoints(175,0,0,0,0,0)
robot.MoveJoints(-175,0,0,0,0,0)
robot.MoveJoints(175,0,0,0,0,0)
robot.GripperOpen()
robot.MoveJoints(0,0,0,0,0,0)
This will make the Robot perform a repetitive task until the program is terminated.
The RobotFeedback class is used for reading the position feedback data and robot status on Port 10001. An example for how to use the RobotFeedback module is as follows:
import MecademicRobot
feedback = MecademicRobot.RobotFeedback('192.168.0.100', '8.1.7')
feedback.Connect()
while(True):
feedback.getData()
print(feedback.joints)
print(feedback.cartesian)
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article