Functions Move, Tool, IO
Import the library:
from robot_library import Move, Tool, IO
Robot move functions
Declare the move function:
robot = Move()
MoveJ
robot.MoveJ(pos = list, v = float, a = float)
MoveJ is used to move the robot arm from one position to another position when the movement does not has to be a straight line.
- Pos: Joint positions
- v: Speed of the movement
- a: Joint acceleration
MoveL
robot.MoveL(pos = list, v = float, a = float)
MoveL is used to move the robot arm in a straight line.
- Pos: Joint positions
- v: Speed of the movement
- a: Joint acceleration
OffsetJ
robot.OffsetJ(pos = list, v = float, a = float)
OffsetJ is used to move the robot from it’s position to another position by giving it an offset.
- Pos: Joint positions
- v: Speed of the movement
- a: Joint acceleration
OffsetL
robot.OffsetL(pos = list, v = float, a = float)
OffsetL is used to move the robot from it’s position to another position by giving it an offset in a straight line.
- Pos: Joint positions
- v: Speed of the movement
- a: Joint acceleration
Robot tool functions
Declare the tool function:
Tool_name = Tool(‘tool’)
- tool: is the name of the tool
moveTo
Tool_name.moveTo(pos = int)
moveTo is used for tool where the servo option is selected. this function move the servo in the tool to the given position.
- Pos: Joint positions
- v: Speed of the movement
- a: Joint acceleration
state
Tool_name.state(state = boolean)
state is used for tools where the relay option is selected in the settings. state will turn the tool on or off.
- state: tool state True or False
Robot IO functions
Declare the IO function:
Input_output = IO(number = int, type = string)
- number: Number of the IO, see robot settings number 1…10
- type: If it is an input or output signal (“INPUT”, “OUTPUT”)
digitalRead
Input_output.digitalRead()
digitalRead will return True or False
digitalWrite
Input_output.digitalWrite(state = boolean)
digitalWrtie will set the IO pin to HIGH or LOW
- state: “HIGH” or “LOW”