Giter VIP home page Giter VIP logo

pyuarm's Introduction

pyuarm (uArm Metal only)

## This Branch is currently on Developing.

This library support uArm Metal only, for Swift and Swift PRO, please use https://github.com/uArm-Developer/pyuf instead.

Overview

This module encapsulates the operations for uArm. It provides basic Movement on Python. Also provides Firmware_helper and Calibration. The module named "pyuarm" makes the API more pythonic.

Other pages (online)

Features

  • Auto uArm Port detection
  • Provide firmware_helper, firmware upgrade online
  • Provide Auto Calibration tool

Requirements

  • Python 2.7x or Python 3.4x above
  • uArmProtocol Firmware (Please use uarmcli firmware -d or python -m pyuarm.tools.firmware -d to upgrade your firmware)

Installation

pyuarm

This install a package that can be used from Python (import pyuarm).

To install for all users on the system, administrator rights (root) may be required.

From PyPI

pyuarm can be installed from PyPI, either manually downloading the files and installing as described below or using:

pip install pyuarm

From source (tar.gz or checkout)

Download the archive from http://pypi.python.org/pypi/pyuarm. Unpack the archive, enter the pyuarm-x.y directory and run:

python setup.py install

pyuarm's People

Contributors

altjz avatar dukelec avatar leixiayang avatar yilinjuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyuarm's Issues

error when playing with pump

Hello,

I have made a simple "learning mode" app, but when I play with the pump via uarm.set_pump(True), error appear on terminal (not always, 50% of the time).
the strangest thing is the the uarm itself continue moving, activating/deactivating pump without any problem...

Here is the log on my terminal:

trying to move
moved
trying to activate vacuum
vacum activated
trying to move
pyuarm - ERROR - Communication| ERROR: send #181 G0 X77.21 Y153.12 Z175.22 F300.0
, received error from robot: 
moved
trying to move
pyuarm - ERROR - Communication| ERROR: send #183 G0 X89.65 Y302.27 Z125.57 F300.0
, received error from robot: $182 OK V2.2.1


moved
trying to deactivate vacuum
pyuarm - ERROR - Communication| ERROR: send #185 M231 V0
, received error from robot: $184 OK V2.2.1


vacum deactivated
trying to move
pyuarm - ERROR - Communication| ERROR: send #187 G0 X52.26 Y151.1 Z144.89 F300.0
, received error from robot: $186 OK V2.2.1

moved

Do not know how to use

I am with a Uarm Swift pro. I install pyuarm by using pip.
Connected my uarm and it can be played with Uarm Studio. Uarm studio showed firmware is 3.1.5.
sudo python -m pyuarm.tools.list_uarms
0 ports found

and I cannot use it. are there any documents for more detailed steps to use this library?

rosparam vs. topics in uArm_core

Hi, looking through the code, uarm_core.py in particular, I see a lot of use of the parameter server to store the angles and positions of the servos on the arm. These are then accessed by the report_* scripts which then publish the same position and angle data out to the appropriate topics.
Normally, the parameter server is used for getting/setting command-line options and passing parameters into a launch file. I'm curious why you're using it this way rather than publishing straight to the relevant topics from within uarm_core.py.

Also, please consider removing the interactive functionality in the various scripts. It makes it difficult to start them as part of a launch file.
Thanks!

Weird position after calibration

After I enter Y to confirm in pyuarm.tools.calibrate step 2, uArm automatic move to another place in step 3. Then, I read the coordinate using uArm.read_coordinate(). The output is [-6.38, -6.64, 19.32]. Did I calibrate it in the right way? Following is the log of step 3.

3.0. Clearing Stretch Completed Flag in EEPROM.
3. Start Calibrate Stretch Offset
3.0 Moving uArm to Correct Place
minAngle_L: 457
minAngle_R: 118
initPosL: 126
initPosL: 125
initPosL: 124
initPosL: 123
    3.1 Saving Stretch Offset into EEPROM
    3.2 Mark Completed Flag in EEPROM
-13 -9
Calibration DONE!!

Error in read_coordinate() after move_to() with time_spend >=5

Hello,

I have this small procedure:

uarm = pyuarm.uArm()
uarm.attach_all_servos()
uarm.move_to(-9,-5,10, time_spend=5)
print uarm.read_coordinate()
uarm.detach_all_servos()

and every time that I set the "time_spend" (for the function move_to(..)) greater or equal to 5 I get the following error, but only if I use the read_coordinate() just after the calling.

error
I don't know if I should report issues here or if I should use the uFactory forum, please let me know.

-- Mss

detach_all_servos

After I updated the firmware to version 1.7.2, the function detach_all_servos() is not working anymore. None servo was detached.

uArm metal install firmware not working

I have a Mac with Python virtual environment Python 3.7.3 && pip 20.2.3 but after successfully running pip install pyuarm

running python -m pyuarm.tools.firmware -d gives the following
error:

/Users/qliu/Documents/jia.com/jia_virtual_environment/bin/python: No module named pyuarm.tools.firmware.__main__; 'pyuarm.tools.firmware' is a package and cannot be directly executed

repeated errors reported after set_position failure

Hi,
If I try to drive the uarm too far so that it returns an error, subsequent calls to set_position() also return errors/failure even if they are to valid positions. Is this expected? Do I have to do something to clear the error?
Thanks,
Randall.

e..g
Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import pyuarm
myuarm=pyuarm.uarm.UArm()
pyuarm - INFO - pyuarm version: 2.2.5.3
pyuarm - INFO - Connecting from port - /dev/ttyUSB0...
pyuarm - INFO - Connected...
pyuarm - INFO - Firmware Version: 2.2.1
myuarm.set_position(50,50,100)
True
myuarm.set_position(-150,150,100)
True
myuarm.set_position(-150,150,100,speed=50)
False
myuarm.set_position(-150,250,100,speed=50)
True
myuarm.set_position(-150,250,250,speed=50)
pyuarm - ERROR - Communication| ERROR: send #15 G0 X-150.0 Y250.0 Z250.0 F50.0
, received error from robot:
False
myuarm.set_position(-150,250,100,speed=50)
pyuarm - ERROR - Communication| ERROR: send #17 G0 X-150.0 Y250.0 Z100.0 F50.0
, received error from robot: $16 OK V2.2.1

False

myuarm.set_position(-150,150,100,speed=50)
pyuarm - ERROR - Communication| ERROR: send #19 G0 X-150.0 Y150.0 Z100.0 F50.0
, received error from robot: $18 OK V2.2.1

False

Some functions not working

I tried running some of the functions and the program kept getting hung...

readAngle and writeAngle don't seem to work, so when I try to attach all servos using uarmAttach(), the program gets stuck on line 82.

I was able workaround by manually attaching each servo and setting the uarm_status=1. With this, I'm able to use writeServoAngle() and moveTo(), but still not able to use writeAngle or readAngle().

Error while trying to import UArm

Hi,
I was trying to use the arm via Python in Anaconda, but I had the following error:

[Anaconda3] C:\Users\xxx>python
Python 3.5.1 |Anaconda 2.4.1 (64-bit)| (default, Jan 29 2016, 15:01:46) [MSC v.1
900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

from UArmForPython.uarm_python import Uarm
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\xxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\u
armforpython-1.0.1-py3.5.egg\UArmForPython\uarm_python.py", line 220
g_l5 = (MATH_L2 + MATH_L3_math.cos(theta_2 / MATH_TRANS) + MATH_L4_math.cos(
theta_3 / MATH_TRANS));

                  ^

TabError: inconsistent use of tabs and spaces in indentation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.