Code Monkey home page Code Monkey logo

turag-lmc's Introduction

TURAG LMC Client Interface

This is a Python3 module to communicate with the TURAG drive platform (LMC) over a USB CDC link. It handles:

  • Connection establishment and recovery
  • Executing commands on the LMC, such as starting drive tasks or setting parameters
  • Fetching and parsing LMC status messages
  • Accepting and providing Events from the LMC via a polling mechanism

Please note that the LMC provides two CDC endpoints. This library needs to connect to the first endpoint (CMD), the second endpoint (LOG) is reserved for the debug log and needs to be accessed using the TURAG Console. This may change in the future.

Example

from turag_lmc import *

lmc = LMCConnection("/dev/ttyACM0") # create the connection object
lmc.startConnection() # connect to the LMC

# Set up parameters (the values are examples only!)
lmc.setParameter(LMCParameters.WEIGHT, 20)
lmc.setPidParameters(LMCPidControlTypes.TRANS_DIST, ...)
lmc.setOdometryCalibration(42.36, 42.43, 19.8)

while True:
    # handle LMC events
    while lmc.hasPendingEvent():
        evtType, evtData = lmc.getNextPendingEvent()
        ... handle the event ...
    # get LMC status (e.g. pose)
    status = lmc.fetchLmcStatus()

    ... implement your control logic here ...

    # issue a drive command to the LMC
    dt = DrivePoseTask(Pose(123,456,78), DR.RAMP_SLOW)
    lmc.issueDriveTask(dt)

turag-lmc's People

Contributors

weber-niklas avatar orwell96 avatar

Watchers

Florian avatar  avatar

turag-lmc's Issues

Capture and forward LMC debug log

LMC debug log currently arrives on /dev/ttyACM1 and can be viewed by the TURAG Console.

TURAG-LMC should be able to connect to this endpoint as well and forward all log messages to the central log management

  • See documentation of the "TURAG-Debugprotokoll" for the specification of log levels, sources etc.
  • Graph output can be ignored for now

@weber-niklas How does the logging system currently look like?

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.