Deutsch English Français Italiano |
<mailman.169.1719266224.2909.python-list@python.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!feeds.phibee-telecom.net!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!not-for-mail From: <avi.e.gross@gmail.com> Newsgroups: comp.lang.python Subject: RE: [Tutor] How to go about a simple object grabbing in python (given coordinates of arms and objects) Date: Mon, 24 Jun 2024 17:57:00 -0400 Lines: 223 Message-ID: <mailman.169.1719266224.2909.python-list@python.org> References: <CAGJtH9SdZvsrgLHnC+NSmj9P9ykG8qXj2JXk27ai=HAYaam-GQ@mail.gmail.com> <v58m8o$162k$1@ciao.gmane.io> <CAGJtH9QgCX1fZ_xN4pfwPATX+s--d1JQJarYsf5dAGYPAQoyJw@mail.gmail.com> <000601dac681$70bbaf00$52330d00$@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de oWtHnrFXdF79iW6KBq5hIwla754GQHBcaq0W6uyjkx0w== Cancel-Lock: sha1:u++I6Za8jzi5hoV7O4+T9zGh/bk= sha256:11y/97RD7yHohKlDEG/f2bitFVxWFmme02mJE8hLMtI= Return-Path: <avi.e.gross@gmail.com> X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org Authentication-Results: mail.python.org; dkim=pass reason="2048-bit key; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=VdOZhMj6; dkim-adsp=pass; dkim-atps=neutral X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'this:': 0.03; 'absolute': 0.05; 'fairly': 0.05; 'parallel': 0.05; 'usage': 0.05; 'subject:python': 0.06; 'circle': 0.07; 'moderator': 0.07; 'modules': 0.07; 'real-world': 0.07; 'translate': 0.07; '"python"': 0.09; 'approaches': 0.09; 'code?': 0.09; 'computing': 0.09; 'depend': 0.09; 'example.': 0.09; 'fewer': 0.09; 'modules.': 0.09; 'numpy': 0.09; 'other.': 0.09; 'received:108': 0.09; 'routine': 0.09; 'shortest': 0.09; 'smaller': 0.09; 'supplied': 0.09; 'tons': 0.09; 'traveling': 0.09; 'steps': 0.11; 'url:mailman': 0.15; 'problem.': 0.15; 'that.': 0.15; '(except': 0.16; '2024': 0.16; 'algorithms': 0.16; 'algorithms,': 0.16; 'algorithms.': 0.16; 'approached': 0.16; 'assuming': 0.16; 'backward': 0.16; 'carrying': 0.16; 'destination.': 0.16; 'distance.': 0.16; 'elaborate': 0.16; 'extending': 0.16; 'flickr': 0.16; 'flying': 0.16; 'gauld': 0.16; 'gradually': 0.16; 'in-line': 0.16; 'languages.': 0.16; 'like.': 0.16; 'locate': 0.16; 'lot,': 0.16; 'next,': 0.16; 'object,': 0.16; 'once.': 0.16; 'ones.': 0.16; 'paths': 0.16; 'photo-blog': 0.16; 'programmed': 0.16; 'renaming': 0.16; 'responses,': 0.16; 'robot.': 0.16; 'robotics.': 0.16; 'silence': 0.16; 'slow': 0.16; 'somewhat': 0.16; 'sounds': 0.16; 'structures': 0.16; 'subject:simple': 0.16; 'think.': 0.16; 'url-ip:79.170.44.132/32': 0.16; 'url-ip:79.170.44/24': 0.16; 'url-ip:79.170/16': 0.16; 'url-ip:79/8': 0.16; 'url:alan-g': 0.16; 'url:alan_gauld': 0.16; 'url:alangauldphotos': 0.16; 'url:tutor': 0.16; 'using.': 0.16; 'welcome.': 0.16; 'wikipedia': 0.16; 'wrapper': 0.16; 'wrote:': 0.16; 'problem': 0.16; 'python': 0.16; 'instead': 0.17; 'probably': 0.17; 'message-id:@gmail.com': 0.18; 'round': 0.19; 'url:amazon': 0.19; 'to:addr:python-list': 0.20; 'language': 0.21; 'subject:: [': 0.21; 'subject:] ': 0.21; 'machine': 0.22; 'closed': 0.22; 'first,': 0.22; 'maybe': 0.22; 'purposes': 0.22; 'to:no real name:2**1': 0.22; 'way.': 0.22; 'code': 0.23; 'feedback': 0.23; 'goal': 0.23; 'subject:How': 0.23; 'run': 0.23; 'degree': 0.76; 'detection': 0.76; 'languages,': 0.76; 'supposed': 0.76; 'domain': 0.77; '1st': 0.78; '400': 0.78; 'sent:': 0.78; 'out.': 0.80; '3rd': 0.81; 'monitor': 0.81; 'position': 0.81; 'more.': 0.82; 'known': 0.84; 'add-on': 0.84; 'allowed,': 0.84; 'angle': 0.84; 'arm,': 0.84; 'catching': 0.84; 'choices': 0.84; 'close,': 0.84; 'direction.': 0.84; 'experiments': 0.84; 'luck.': 0.84; 'marathon': 0.84; 'measures': 0.84; 'nao': 0.84; 'newest': 0.84; 'obstacles.': 0.84; 'parts.': 0.84; 'robot': 0.84; 'ultimately': 0.84; 'want.': 0.84; 'wheels': 0.84; '28th': 0.91; 'anticipated': 0.91; 'avoiding': 0.91; 'particular,': 0.91; 'sides.': 0.91; 'stopping': 0.91; 'degrees': 0.93; 'central': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719266222; x=1719871022; darn=python.org; h=content-language:thread-index:content-transfer-encoding :mime-version:message-id:date:subject:in-reply-to:references:to:from :from:to:cc:subject:date:message-id:reply-to; bh=RJHX99foTV4/0oCrL6Pt5vmNTDrG6Fz2LwNfqPwaVR4=; b=VdOZhMj6rbYMZySQoRfryVwAuZ/WsLqtZ0if40V15nd6wPvTrEad6ha9wjGzEF9IIO KczP6Vw6K8pvKy0ex7wBeGxa/ZJS9qJwnOlrGAiTTXOlS+RuHULE3jE2xp0Q9WQJ8RHp 8dsdSK3SuyHvE4oKyRl7ipqfTDGuS6j/7NsJHi/qRKYMjIR7vXA2h0YBx+X+Hj8qziBf B4BZEg0TS27vh3YmqXqOs0Fp7TcZrfJ5I+6cjQPKbkY1/6U8vk2F8a2lnGqCaQ2vBSkj ZYv3BWv7EHKjuPhjYkE6bbeAhXLlkZot22JP8wMx5c2sVsW8jLitOlFJdZcPDeRd+lcR aTAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719266222; x=1719871022; h=content-language:thread-index:content-transfer-encoding :mime-version:message-id:date:subject:in-reply-to:references:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RJHX99foTV4/0oCrL6Pt5vmNTDrG6Fz2LwNfqPwaVR4=; b=kVMs3jeaJj13CiQJhQs+KPG12tWo09R3yX5+sZW2fsJk4KLoYbYaXTO7F4cI51OR+M 8zILIkMUInodOyhEfrLqWfXm+kGr+9G/bQPqKMccpIRq/Qxaj927B9++7mfSuUqq+DwR Thse7zi3+VOS+LvWUszb4CIs5HuBvsNSb6QSuIgetQ0znn1vqPKOH5RwAXWe2n2W9QSB zTVNCCNy2ZQuvICRRC6Z6C4A1xW60COmxFzlQVG1VLX3Cl+nvdjEIHVZ/Av1h6wHBVhX AZQacxNw+iUrSF+Hm0J9MwCWJS8Za1AA8qEK/oK3zye2E6ZuHAR95JUguyj2d5XTw4rY nRlA== X-Forwarded-Encrypted: i=1; AJvYcCV6UhCZ5pibuRDgQKetWEJ/lZcGvsjfsiVcZPo6V/NdN0E5VoquKmoTRLTzf9kXuEaucXUnKkbvNEz3QBytg+hqYQl2nDBzQe4M9fhLYKn8WaHj1lSeSjcD X-Gm-Message-State: AOJu0YzebYuN57rBw3g9McBWRHnR5MjfkrpLEFrjrMDwZpV3iu0GFPYw +jqfDwfvryzuSAh+70dNvyIkMwv87HQNwoNFA5a9HIBApVX+WRQNYLFUoQ== X-Google-Smtp-Source: AGHT+IGsJosi9c19haYo+AS72ts9+O2r57fnaT9fZ/5L1sSeO72M+0GJNjEl+3aL4TiERK3f/64n5A== X-Received: by 2002:a05:690c:710:b0:632:5cae:3912 with SMTP id 00721157ae682-643aa3b138amr52669077b3.6.1719266221417; Mon, 24 Jun 2024 14:57:01 -0700 (PDT) In-Reply-To: <CAGJtH9QgCX1fZ_xN4pfwPATX+s--d1JQJarYsf5dAGYPAQoyJw@mail.gmail.com> X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIRu0eoxhJKb1M0MjGxX7K/VErFWQCX/NqrAL71Q+GxXs6z4A== Content-Language: en-us X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: General discussion list for the Python programming language <python-list.python.org> List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> List-Archive: <https://mail.python.org/pipermail/python-list/> List-Post: <mailto:python-list@python.org> List-Help: <mailto:python-list-request@python.org?subject=help> List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> X-Mailman-Original-Message-ID: <000601dac681$70bbaf00$52330d00$@gmail.com> X-Mailman-Original-References: <CAGJtH9SdZvsrgLHnC+NSmj9P9ykG8qXj2JXk27ai=HAYaam-GQ@mail.gmail.com> <v58m8o$162k$1@ciao.gmane.io> <CAGJtH9QgCX1fZ_xN4pfwPATX+s--d1JQJarYsf5dAGYPAQoyJw@mail.gmail.com> Bytes: 18789 Marc, Several people have supplied feedback on whether your request is a good = fit for here. Ultimately it is up to the owner/moderator. In particular, = your request to the Tutor List may not fit the purpose and be a bit = complex and to the main Python List also outside some common usage = whether it is about a specific module or product you are using, or = asking about algorithms in a very general way. You question has evolved to being about algorithms, more than about = Python as a basic language or even commonly used modules. So, I suggest you simplify your model and then maybe bring it in-line = with the module(s) you showed us you were using. Some of what you ask = sounds like it would be extremely commonly done in things like robotics, = or even just machines with moving parts. Consider the somewhat related concept often seen of how you get from one = place to another in parts of Manhattan where most of the streets run = either in one direction or the orthogonal direction. How do you get from = say East 14th Street at 1st Avenue to West 28th Street and 11th Avenue? = This is a slight imitation of how to move a robotic arm that can mainly = either go one way or another but not both at once. And, in the real = world, parts of Manhattan are more complex with streets ending or = renaming or running more diagonally or huge voids like Central Park. The number of solutions is huge for walking, and smaller for driving as = some streets are one way. But assuming you avoid wasteful paths (except = when roads are closed for endless purposes) and you do not take a path = through Brooklyn, Queens and The Bronx and back to Manhattan as in the = NY Marathon that also touches another borough, the solutions mainly look = like this: Go as far horizontally as you need and then as far vertically. Or, do vertical, then horizontal. Or lots of combined versions such as climbing stairs by doing a block or = three one way then some in the other and repeat. The above is referred to as Manhattan Distance, as compared to other = measures like Euclidean distance. So back to your robot arm, you can see a set of simple solutions where = you make a sort of triangle with the direct Euclidean arm being a = hypoteneuse and the X and Y movements are the other two sides. You can = then break up your problem as heading one way and pausing and turning = the other way and stopping just short of the object you want. If there = are no obstacles, you can do that in either order. Or, you could = alternate in smaller amounts and get to the same destination.=20 Grabbing it would be something else I will not address except to say = that depending on what is grabbing and how it is shaped, you may need to = aim not for the object, but the appropriate distance and direction so = that when you stop moving, the "grasper" can close on it, again, = avoiding existing obstacles. And note, speed is a consideration as many = things need to be approached slowly and gently. Next, consider what it would mean if you could have a combined motion = based on both operations allowed at the same time. Consider a robot that = is on wheels that can move horizontally while also having a "lift" = component that lifts the part with the graspers vertically. Both could = be programmed to run in tandem at appropriate speeds so the graspers are = traveling along the hypotenuse I mention and are going the shortest = path. This might be faster and more economical in other ways but can be = more complex. And, it may be the robot does not have power or computing = ability to do both at the same time. Your design is beyond vague. Both of the approaches above make a plan and carry it out. But in the = real world, many algorithms must adjust and work somewhat = probabilistically. One algorithm for say catching a moving object, = especially one that can change speed and direction a bit, like a running = dog or a kite flying in the wind, is to locate where the object seems to = be now, perhaps just a direction and a guess at distance, and maybe with = some observation make a guess at where it might be at some time in the = future that is approximately when you might move the robot near there. = Then, use a technique like above (or completely different) that perhaps = aims to get you something like halfway there. Monitor along the way to = ========== REMAINDER OF ARTICLE TRUNCATED ==========