Common JAKA Robot Arm APIs

This note summarizes frequently used JAKA robot arm APIs for power control, motion control, state querying, and tool management, along with their basic usage.

Power On/Off

import jkrc

robot = jkrc.RC("192.168.0.110") # Returns a robot object
robot.login()
robot.power_on() # Power on
robot.enable_robot() # Enable robot

robot.disable_robot() # Disable robot
robot.power_off() # Power off
robot.shut_down() # Control cabinet shutdown

Drag Mode

robot.drag_mode_enable(True)
ret = robot.is_in_drag_mode()
print(ret)
a = input()
robot.drag_mode_enable(False)
ret = robot.is_in_drag_mode()
print(ret)

Move Robot Joints to the Target Position

ABS = 0  # Absolute motion
INCR = 1  # Incremental motion

joint_move(joint_pos, move_mode, is_block, speed)

# Example: robot.joint_move(joint_pos, ABS, True, 0.1)
  • joint_pos: Target position for robot joint motion.
  • move_mode: 0 indicates absolute motion, and 1 indicates relative motion.
  • is_block: Sets whether the API is blocking. TRUE means blocking, and FALSE means non-blocking. Blocking means a return value is provided only after robot motion completes; non-blocking means a return value is provided immediately after API invocation.
  • speed: Robot joint motion speed, unit: rad/s.

Move Robot TCP Linearly to the Target Position

linear_move(end_pos, move_mode, is_block, speed)
  • end_pos: Target position for robot end-effector motion.
  • move_mode: 0 indicates absolute motion, and 1 indicates relative motion.
  • is_block: Sets whether the API is blocking. TRUE means blocking, and FALSE means non-blocking. Blocking means a return value is provided only after robot motion completes; non-blocking means a return value is provided immediately after API invocation.
  • speed: Robot linear motion speed, unit: mm/s, default: 500 mm/s.

Get Current Six Joint Angles of the Robot

get_joint_position()
  • Successful return: (0, joint_pos). joint_pos is a tuple with 6 elements (j1, j2, j3, j4, j5, j6), representing the angle values of joints 1 through 6.

Get Current TCP Pose Under the Current Tool Setting

get_tcp_position()
  • Successful return: (0, cartesian_pose). cartesian_pose is a tuple with 6 elements (x, y, z, rx, ry, rz), representing the robot tool center point pose values.

Query the Currently Used Tool ID

get_tool_id()
  • Successful return: (0, id). id ranges from 0 to 15, where 0 represents the end flange (already used by the controller).