1 Star 0 Fork 0

超神Fork/xArm-Python-SDK

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

xArm-Python-SDK

Overview

xArm Python SDK

Caution

  • During use, people should stay away from the robot arm to avoid accidental injury or damage to other items by the robot arm.
  • Protect the arm before use.
  • Before you exercise, please make sure you don't encounter obstacles.
  • Protect the arm before unlocking the motor.

Installation

Install is not necessary, you can run examples without installation.Only Python3 is supported.

  • download

    git clone https://github.com/xArm-Developer/xArm-Python-SDK.git
    
  • install

    python setup.py install
    

Doc

Update Summary

  • 1.8.4

    • Support the Six-axis Force Torque Sensor (not a third party)
    • Add threads to handle callbacks
    • Modify the reporting processing logic and optimize the processing of sticky packets
    • Fixed frequent switching of the pause state causing the program to hang
    • Fix the program hangs when setting the mechanical claw position in speed mode
    • Fix relative movement in unsynchronized position
  • 1.8.0

    • Support for blocky code conversion and operation of xArmStudio-1.8.0
    • The Velocity interface supports the duration parameter (requires firmware 1.8.0 or higher)
    • Added identification interface (current identification and torque identification) (requires firmware 1.8.0 or higher)
    • Support linear track interface (requires firmware 1.8.0 or higher)
    • Support calling some studio APIs
  • 1.6.9

    • Support for blocky code conversion and operation of xArmStudio1.6.9
    • Support velocity control
    • Support calibrate tcp offset and user offset
  • More

Example

Note: Before running the example, please modify the ip value in the robot.conf file to the robot arm you want to control.

  • 0000-template

  • 0001-event_register
  • 0002-get_property
  • 0003-api_get
  • 0004-servo_attach_detach
  • 1001-move_line
  • 1002-move_line
  • 1003-relative_move_line
  • 1004-move_arc_line
  • 1005-move_arc_line
  • 1006-move_tool_line
  • 1007-counter
  • 1008-move_line_aa

  • 1009-cartesian_velocity_control

  • 2000-joint_velocity_control

  • 2001-move_joint --> xarm5 --- xarm6 --- xarm7
  • 2002-move_joint --> xarm5 --- xarm6 --- xarm7
  • 2003-move_joint --> xarm5 --- xarm6 --- xarm7
  • 2004-move_joint --> xarm5 --- xarm6 --- xarm7
  • 2005-move_arc_joint --> xarm5 --- xarm6 --- xarm7
  • 3001-move_circle
  • 3002-record_trajectory
  • 3003-playback_trajectory
  • 5000-set_tgpio_modbus
  • 5001-get_tgpio_digital
  • 5002-get_tgpio_analog
  • 5003-set_tgpio_digital
  • 5004-set_gripper
  • 5005-get_cgpio_digital_analog
  • 5006-set_cgpio_digital_analog
  • 5007-set_cgpio_input_output_function
  • 5008-get_cgpio_state
  • 5009-set_bio_gripper
  • 6001-set_reduced_mode
  • 6002-set_fense_mode
  • 7001-servo_j
  • 7002-servo_cartesian
  • 7003-servo_cartesian_aa
  • 8000-load_identify_current
  • 8001-force_tech
  • 8002-impedance
  • 8003-force_control
  • 8004-load_identify
  • 8005-read_force_data
  • 8006-save_force_zero
  • 8010-get_ft_sensor_config
  • 9000-set_linear_track
  • blockly_to_python
  • get_report_data_with_protocol
  • Import

    from xarm.wrapper import XArmAPI
    arm = XArmAPI('COM5')
    arm = XArmAPI('192.168.1.113')
    arm = XArmAPI('192.168.1.113', do_not_open=False)
    arm = XArmAPI('192.168.1.113', is_radian=False)
    
  • Connect/Disconnect

    arm.connect(...)
    arm.disconnect()
    
  • Move

    arm.reset(...)
    arm.set_position(...)
    arm.set_servo_angle(...)
    arm.set_servo_angle_j(...)
    arm.set_servo_cartesian(...)
    arm.move_gohome(...)
    arm.move_circle(...)
    arm.emergency_stop()
    arm.set_position_aa(...)
    arm.set_servo_cartesian_aa(...)
    arm.vc_set_joint_velocity(...)
    arm.vc_set_cartesian_velocity(...)
    
  • Set

    arm.set_servo_attach(...)
    arm.set_servo_detach(...)
    arm.set_state(...)
    arm.set_mode(...)
    arm.motion_enable(...)
    arm.set_pause_time(...)
    
  • Get

    arm.get_version()
    arm.get_state()
    arm.get_is_moving()
    arm.get_cmdnum()
    arm.get_err_warn_code()
    arm.get_position(...)
    arm.get_servo_angle(...)
    arm.get_position_aa(...)
    arm.get_pose_offset(...)
    
  • Setting

    arm.set_tcp_offset(...)
    arm.set_tcp_jerk(...)
    arm.set_tcp_maxacc(...)
    arm.set_joint_jerk(...)
    arm.set_joint_maxacc(...)
    arm.set_tcp_load(...)
    arm.set_collision_sensitivity(...)
    arm.set_teach_sensitivity(...)
    arm.set_gravity_direction(...)
    arm.config_tgpio_reset_when_stop(...)
    arm.config_cgpio_reset_when_stop(...)
    arm.set_report_tau_or_i(...)
    arm.set_self_collision_detection(...)
    arm.set_collision_tool_model(...)
    arm.clean_conf()
    arm.save_conf()
    
  • Gripper

    arm.set_gripper_enable(...)
    arm.set_gripper_mode(...)
    arm.set_gripper_speed(...)
    arm.set_gripper_position(...)
    arm.get_gripper_position()
    arm.get_gripper_err_code()
    arm.clean_gripper_error()
    
  • BIO Gripper

    arm.set_bio_gripper_enable(...)
    arm.set_bio_gripper_speed(...)
    arm.open_bio_grippe(...)
    arm.close_bio_gripper(...)
    arm.get_bio_gripper_status()
    arm.get_bio_gripper_error()
    arm.clean_bio_gripper_error()
    
  • RobotIQ Gripper

    arm.robotiq_reset()
    arm.robotiq_set_activate(...)
    arm.robotiq_set_position(...)
    arm.robotiq_open(...)
    arm.robotiq_close(...)
    arm.robotiq_get_status(...)
    
  • Modbus of the end tools

    arm.set_tgpio_modbus_timeout(...)
    arm.set_tgpio_modbus_baudrate(...)
    arm.get_tgpio_modbus_baudrate(...)
    arm.getset_tgpio_modbus_data(...)
    
  • GPIO

    # Tool GPIO
    arm.get_tgpio_digital(...)
    arm.set_tgpio_digital(...)
    arm.get_tgpio_analog(...)
    arm.set_tgpio_digital_with_xyz(...)
    # Controller GPIO
    arm.get_cgpio_digital(...)
    arm.get_cgpio_analog(...)
    arm.set_cgpio_digital(...)
    arm.set_cgpio_analog(...)
    arm.set_cgpio_digital_input_function(...)
    arm.set_cgpio_digital_output_function(...)
    arm.get_cgpio_state()
    arm.set_cgpio_digital_with_xyz(...)
    arm.set_cgpio_analog_with_xyz(...)
    
  • Linear Track

    arm.get_linear_track_pos()
    arm.get_linear_track_status()
    arm.get_linear_track_error()
    arm.get_linear_track_is_enabled()
    arm.get_linear_track_on_zero()
    arm.get_linear_track_sci()
    arm.get_linear_track_sco()
    
    arm.clean_linear_track_error(...)
    arm.set_linear_track_enable(...)
    arm.set_linear_track_speed(...)
    arm.set_linear_track_back_origin(...)
    arm.set_linear_track_pos(...)
    arm.set_linear_track_stop(...)
    
  • FT Sensor

    arm.set_impedance(...)
    arm.set_impedance_mbk(...)
    arm.set_impedance_config(...)
    arm.config_force_control(...)
    arm.set_force_control_pid(...)
    arm.ft_sensor_set_zero(...)
    arm.ft_sensor_iden_load(...)
    arm.ft_sensor_cali_load(...)
    arm.ft_sensor_enable(...)
    arm.ft_sensor_app_set(...)
    arm.ft_sensor_app_get(...)
    arm.get_ft_sensor_data(...)
    arm.get_ft_senfor_config(...)
    arm.get_ft_sensor_error(...)
    
  • Other

    arm.set_pause_time(...)
    arm.shutdown_system(...)
    arm.clean_error()
    arm.clean_warn()
    arm.set_counter_reset()
    arm.set_counter_increase(...)
    
  • Register/Release

    arm.register_report_callback(...)
    arm.register_report_location_callback(...)
    arm.register_connect_changed_callback(callback)
    arm.register_state_changed_callback(callback)
    arm.register_mode_changed_callback(callback)
    arm.register_mtable_mtbrake_changed_callback(callback)
    arm.register_error_warn_changed_callback(callback)
    arm.register_cmdnum_changed_callback(callback)
    arm.register_temperature_changed_callback(callback)
    arm.register_count_changed_callback(callback)
    arm.release_report_callback(callback)
    arm.release_report_location_callback(callback)
    arm.release_connect_changed_callback(callback)
    arm.release_state_changed_callback(callback)
    arm.release_mode_changed_callback(callback)
    arm.release_mtable_mtbrake_changed_callback(callback)
    arm.release_error_warn_changed_callback(callback)
    arm.release_cmdnum_changed_callback(callback)
    arm.release_temperature_changed_callback(callback)
    arm.release_count_changed_callback(callback)
    
  • Property

    arm.connected
    arm.default_is_radian
    arm.version
    arm.position
    arm.last_used_position
    arm.tcp_speed_limit
    arm.tcp_acc_limit
    arm.last_used_tcp_speed
    arm.last_used_tcp_acc
    arm.angles
    arm.joint_speed_limit
    arm.joint_acc_limit
    arm.last_used_angles
    arm.last_used_joint_speed
    arm.last_used_joint_acc
    arm.tcp_offset
    arm.state
    arm.mode
    arm.joints_torque
    arm.tcp_load
    arm.collision_sensitivity
    arm.teach_sensitivity
    arm.motor_brake_states
    arm.motor_enable_states
    arm.has_err_warn
    arm.has_error
    arm.has_warn
    arm.error_code
    arm.warn_code
    arm.cmd_num
    arm.device_type
    arm.axis
    arm.gravity_direction
    arm.gpio_reset_config
    arm.count
    arm.temperatures
    arm.voltages
    arm.currents
    arm.cgpio_states
    
Copyright (c) 2018, UFACTORY Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

暂无描述 展开 收起
README
BSD-3-Clause
取消

发行版 (1)

全部
3年前

贡献者

全部

语言

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/supernatural-fork/xArm-Python-SDK.git
git@gitee.com:supernatural-fork/xArm-Python-SDK.git
supernatural-fork
xArm-Python-SDK
xArm-Python-SDK
master

搜索帮助