Yaskawa Motoman NX100工業機器人遙控Python庫。該庫最初是為機器視覺控制開發項目開發的。在YouTube演示視頻中查看更多信息。
開發文件
這些視頻是文檔的一部分。
- Do changes with your own risk! in case you brick your robot or your setup is different and it doesn't work. I cannot help. System info -> Security -> Select Management Mode ->
But do not enter Management Mode password but instead Yaskawa emperor password.
FD078 => bit set to 1 (Ethernet WWW)
LAN0 (next to serial COM port)

1. Power off NX100 -> press down pendant "MAIN MENU" button while powering on NX100
2. Release "MAIN MENU" after seeing Motoman screen on pendant.
3. Login with Yaskawa emperor password from System -> Security.
4. SYSTEM -> SETUP -> OPTION FUNCTION -> TCP -> "USED"
5. SYSTEM -> SETUP -> OPTION FUNCTION -> NETWORK -> Give details.
6. Under network also find HOST SETUP -> Provide address details.
7. See that your changes have been saved.
8. Reboot NX100 and ping your NX100 ip address.
9. Test out this library.
pip install nx100-remote-control
pip install --upgrade nx100-remote-control import nx100_remote_control
nx100_remote_control . NX100_IP_ADDRESS = '192.168.2.28'
nx100_remote_control . NX100_TCP_PORT = 80
nx100_remote_control . MOCK_RESPONSE = False http://localhost:8080/打開,在下面的圖像中看起來像這樣。 import nx100_remote_control
from nx100_remote_control . module import WebServer
nx100_remote_control . MOCK_RESPONSE = True
WebServer . run ( addr = "localhost" , port = 8080 )
必須已經安裝: pip install flake8 pytest
棉絨: flake8 ./nx100_remote_control --count --select=E9,F63,F7,F82 --show-source --statistics
測試: pytest
構建: python -m build
Testing.py =>用於開發和測試單個命令。
XboxController.py =>如下所述,可以使用控制器來控制機器人,只是演示。請注意,運動很笨拙,因為NX100不支持實時控制。
MOVL命令的快速示例使用機器人進行線性運動。有關更多詳細信息,請參見Movel對像或閱讀Ethernet Server Function Manual 。
from nx100_remote_control . module import Commands , Utils
from nx100_remote_control . objects import MoveL
Commands . write_linear_move ( MoveL . MoveL (
MoveL . MoveL . motion_speed_selection_posture_speed ,
5 ,
MoveL . MoveL . coordinate_specification_base_coordinate ,
353.769 , 202.779 , 120.658 ,
- 1.34 , 35.78 , 27.84 ,
Utils . binary_to_decimal ( 0x00000001 ),
0 , 0 , 0 , 0 , 0 , 0 , 0
))使用movel.movel對象查看motion_speed_selection_的選項和coordinate_specification_
然後等待移動完成,您可以將回調函數用作示例:
from nx100_remote_control . module import Commands , Utils
from nx100_remote_control . objects import MoveL
def callback_success ():
print ( 'MoveL position has been reached' )
def callback_failed ():
print ( 'MoveL error or position not reached on given timeout' )
move_l = MoveL . MoveL (
MoveL . MoveL . motion_speed_selection_posture_speed ,
5 ,
MoveL . MoveL . coordinate_specification_base_coordinate ,
353.769 , 202.779 , 120.658 ,
- 1.34 , 35.78 , 27.84 ,
Utils . binary_to_decimal ( 0x00000001 ),
0 , 0 , 0 , 0 , 0 , 0 , 0
)
Commands . robot_in_target_point_callback (
move_l = move_l , timeout = 10 , _callback_success = callback_success , _callback_failed = callback_failed
)因此,如果在給定超時到達或運行_callback_failed位置(如果不是)中,這將執行_callback_success 。
另一個指揮官課程
from nx100_remote_control . module import LinearMove , Utils
from nx100_remote_control . objects import MoveL
move_l = MoveL . MoveL (
MoveL . MoveL . motion_speed_selection_posture_speed ,
5 ,
MoveL . MoveL . coordinate_specification_base_coordinate ,
352.769 , 202.779 , 120.658 ,
- 1.34 , 35.78 , 27.84 ,
Utils . binary_to_decimal ( 0x00000001 ),
0 , 0 , 0 , 0 , 0 , 0 , 0
)
linear_move = LinearMove . LinearMove ()
linear_move . go ( move_l = move_l , wait = True , poll_limit_seconds = 10 )
print ( 'finished' ) MOVJ命令的快速樣本與機器人進行聯合運動。閱讀Ethernet Server Function Manual以獲取有關MOVJ的更多詳細信息
- !!! BE CAREFUL WITH MOVJ COMMAND AND IT'S SPEED SETTING !!! from nx100_remote_control . module import JointMove , Utils
from nx100_remote_control . objects import MoveJ
move_j = MoveJ . MoveJ (
25 , # speed %
MoveJ . MoveJ . coordinate_specification_base_coordinate ,
352.769 , 202.779 , 120.658 ,
- 1.34 , 35.78 , 27.84 ,
Utils . binary_to_decimal ( 0x00000001 ),
0 , 0 , 0 , 0 , 0 , 0 , 0
)
linear_move = JointMove . JointMove ()
linear_move . go ( move_j = move_j , wait = True , poll_limit_seconds = 10 )
print ( 'finished' )Arduino文件夾包含用於NX100 Motoman的自定義抓手的代碼和草圖。
NX100梯子配置默認為GRP表示分組信號,因此必須取消組以訪問輸出繼電器#30052 
在這裡的想法是,我需要能夠控制帶有庫存#10022通用輸出信號的繼電器#30052,但也需要使用網絡輸入#22012信號,並且對於兩種情況,這都需要STR +無法處理(請參見Image Ladder Line 0359)
與抓手一起工作。
from nx100_remote_control . module import Gripper
Gripper . write_gripper_close ()
Gripper . write_gripper_open ()
Gripper . read_gripper_closed_command_register ()
Gripper . read_gripper_acknowledge ()
Gripper . read_gripper_hit ()明顯的位是一個輸入和兩個輸出。硬件決策無關緊要,可以相應地更改代碼。

自定義零件來源
- Remember to increment setup.cfg version before release tag!