npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

demodobot

v1.2.4

Published

DobotDemoForPython64 is the demo of python package dynamic library files. It can be used directly by the python function to control Dobot Magician.

Downloads

13

Readme

DobotDemoForPython64

DobotDemoForPython64 is the demo of python package dynamic library files. It can be used directly by the python function to control Dobot Magician.

This document describes the secondary development environment building and demo python codes, frameworks, and systems, aiming to help secondary developer to understand common API of Dobot Magician and build development environment quickly.

Files Description

  • Dll files contain the api functions needed to control Dobot Magician.
  • DobotDllType.py : Specific implementing file. This section encapsulate api functions provided by the dll as python function.
  • DobotControl.py : Secondary encapsulation of Dobot API. In order to get you up and running quickly, the code in the example adds a certain comment for easy reading.Examples are as follows:
#将dll读取到内存中并获取对应的CDLL实例
#Load Dll and get the CDLL object
api = dType.load()

#建立与dobot的连接
#Connect Dobot
state = dType.ConnectDobot(api, "", 115200)[0]
print("Connect status:",CON_STR[state])

Python API

DobotDllType.py encapsulates the C type interface of Dobot DLL, which is Python API of Dobot. The example for loading DLL is shown as follows.

def load():
    if platform.system() == "Windows":
        return CDLL("DobotDll.dll",  RTLD_GLOBAL)
    elif platform.system() == "Darwin" :
        return CDLL("libDobotDll.dylib",  RTLD_GLOBAL)
    elif platform.system() == "Linux":
        return cdll.loadLibrary("libDobotDll.so")

Usage

  • For Windows OS, please add the DLLs directory to environment variable Path.
  • For Linux OS, please add the following statement at the end of ~/.bash_profile file and restart computer.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:DOBOT_LIB_PATH
  • For Mac OS If the following error occurs, the solution is:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 356, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(libDobotDll.dylib, 10): image not found
% cd DobotDemoForPython
% otool -L libDobotDll.dylib

The executable_path part, all use the tools of install_name_tool to modify the path.

# install _name_tool -change <old path> <new path> libDobotDll.dylib
install_name_tool -change @executable_path/QtSerialPort.framework/Versions/5/QtSerialPort /Users/outannexway/Downloads/Dobot/DobotDemoV2.0-20170118/DobotDemoForPython/QtSerialPort.framework/Versions/5/QtSerialPort libDobotDll.dylib
  • cd DobotDemoForPython Use vscode debugging, be sure to use the DobotDemoForPython path
  • Connect the Dobot Magician
  • python DobotControl.py

Attention

There are the following points to note:
  • You need to add the DLL address to the system environment variable
  • A 32-bit system corresponds to a 32-bit dynamic library, and a 64-bit system corresponds to a 64-bit dynamic library
  • please use the python 64 bit environment.

Node JS

  • The above Python code has been used to create an app, a server, that listens to calls at its endpoints.

  • The endpoints functions are: test, point To Point, connect, disconnect.

  • In this code, you will have to fill:

    1. The COM Port your Dobot uses
    2. The Port your app will use
  • There is a node js file, app, that sends requests to the endpoints. The methods in the node js file are:

    1. Connect
    2. Disconnect
    3. Move
    4. run
    5. pinentry
    6. signature
    7. delay
  • In this code you will only fill the port your app will use for the requests uri.

  • A simple way to write both com port and endpoint port numbers is to put them in an .env file in the demodobot--which you are looking to use--node module. An example is:

     COM_PORT = 'COM100'
     PORT = '5000'