Robot Arm Guide

Robotic Hand Python Start Guide

NOTE:
For Python3.9 or newer versions
For more guidance about other environments, please ask our agent to provide it.

0 Receive Package from Us

To receive your complete package, please contact our service team.

1 Preparation

Note: Recommended use Python 3.9 or newer versions

pip install -r requirements.txt 

Connect the robotic arm to your computer using a network cable, then implement the following code.

from Robotic_Arm.rm_robot_interface import *

# Initialization
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)
# RM_SINGLE_MODE_E: Single-thread mode, non-blocking, waits for data return in a single thread.
# RM_DUAL_MODE_E: Dual-thread mode, adds a receiving thread to monitor data in the queue.
# RM_TRIPLE_MODE_E: Triple-thread mode, builds on dual-thread mode by adding a thread to monitor UDP interface data.

# Create Robotic Arm Connections
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
# change the ip address to yours
print(handle.id) 

2 Main Guidance

2.1 Get information

# Get arm status
print(arm1.rm_get_current_arm_state())
# Get arm current joint degree
print(arm.rm_get_joint_degree())

# Get arm information
print(arm.rm_get_robot_info())

# Get API information
print("\nAPI Version: ", rm_api_version(), "\n")

# Get Real/Simulate Mode
print(arm.rm_set_arm_run_mode(0))
# 0 Simulate; 1 Real 

# Set Real/Simulate Mode
arm.rm_set_arm_run_mode(0) # Simulate 
arm.rm_set_arm_run_mode(1) # Real 

# Save logs to files
arm.rm_set_log_save("/home/aisha/work/rm_log.txt") 

2.2 Angle Movement Method

rm_movej([joint], v, r, connect, block)

Note: When using single-thread blocking mode, please set a timeout to ensure the trajectory completes and returns within the specified time.
Note: The blend radius only takes effect when the trajectory_connect parameter is set to 1. If set to 0, the blend radius will not be applied.

# Example move [0, 20, 70, 0, 90, 0]
print(arm.rm_movej([0, 20, 70, 0, 90, 0], 20, 0, 0, 1)) 

2.3 Line Movement Method

rm_movel([pose], v, r, connect, block)

Note: When using single-thread blocking mode, please set a timeout to ensure the trajectory completes and returns within the specified time.
Note: The blend radius only takes effect when the trajectory_connect parameter is set to 1. If set to 0, the blend radius will not be applied.

# Example move [0.3, 0, 0.4, 3.141, 0, 0]
print(arm.rm_movel([0.3, 0, 0.4, 3.141, 0, 0], 20, 0, 0, 1)) 

2.4 Returned Parameters

3 For Multiple Robotic Arms

For multiple robotic arm connections, only the parameters for the first arm need to be initialized.

# Initialization
arm1 = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)
arm2 = RoboticArm()

# Create Robotic Arm Connections
handle1 = arm1.rm_create_robot_arm("192.168.1.18", 8080)
print(handle1.id)
handle2 = arm2.rm_create_robot_arm("192.168.1.19", 8080) 

3.1 Get Arm Status

print(arm1.rm_get_current_arm_state())
print(arm2.rm_get_current_arm_state()) 

3.2 Example: Executing Instructions

demo_movej(robot1)
demo_movej(robot1, [0, 20, 70, 0, 90, 0])
demo_movej_p(robot1, [0.3, 0, 0.3, 3.141, 0, 0])
demo_movel(robot1, [0.2, 0, 0.3, 3.141, 0, 0])
demo_movec(robot1, [0.25, 0.05, 0.3, 3.141, 0, 0], [0.25, -0.05, 0.3, 3.141, 0, 0], loop=2)


demo_movej(robot2)
demo_movej(robot2, [0, 20, 70, 0, 90, 0])
demo_movej_p(robot2, [0.3, 0, 0.3, 3.141, 0, 0])
demo_movel(robot2, [0.2, 0, 0.3, 3.141, 0, 0])
demo_movec(robot2, [0.25, 0.05, 0.3, 3.141, 0, 0], [0.25, -0.05, 0.3, 3.141, 0, 0], loop=2)


# Disconnect arm
disconnect_robot(robot1)
disconnect_robot(robot2) 

4 Force Sensor

The RM65-6F robotic arm is equipped with an integrated six-dimensional force sensor at its end effector, eliminating the need for external wiring. Users can directly operate the six-dimensional force via the protocol to obtain the force data.

#Get force
print(arm.rm_get_force_data()) 

Professional Robotics Solution

© 2024 Oceantrix

[email protected]
No.6688 HH Industrial Park. WF. 261000