Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Green light in A.M. for new projects. Red light in P.M. for traffic tickets.


comp / comp.lang.python / How to go about a simple object grabbing in python (given coordinates of arms and objects)

SubjectAuthor
o How to go about a simple object grabbing in python (given coordinates of arms anmarc nicole

1
Subject: How to go about a simple object grabbing in python (given coordinates of arms and objects)
From: marc nicole
Newsgroups: comp.lang.python
Date: Sat, 22 Jun 2024 12:41 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: mk1853387@gmail.com (marc nicole)
Newsgroups: comp.lang.python
Subject: How to go about a simple object grabbing in python (given coordinates
of arms and objects)
Date: Sat, 22 Jun 2024 14:41:47 +0200
Lines: 47
Message-ID: <mailman.161.1719181173.2909.python-list@python.org>
References: <CAGJtH9SdZvsrgLHnC+NSmj9P9ykG8qXj2JXk27ai=HAYaam-GQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de bsgAIlwFVzYrn6BTj+x8sQoaC+gFBz/IPPF/6bkestWg==
Cancel-Lock: sha1:EFryF6NwGGqAy2lFLiFWsX7VkWE= sha256:PIgrTLpRmkdtIJhZirpD+U/NmWNXIg+sH7r5FeV34wM=
Return-Path: <mk1853387@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=nsj8u3/X;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: UNSURE 0.281
X-Spam-Level: **
X-Spam-Evidence: '*H*': 0.45; '*S*': 0.02; 'subject:python': 0.06;
'case?': 0.16; 'frame,': 0.16; 'src:': 0.16; 'subject:simple':
0.16; 'url:doc': 0.16; 'problem': 0.16; "can't": 0.17; 'figure':
0.19; 'to:addr:python-list': 0.20; 'to:no real name:2**1': 0.22;
'subject:How': 0.23; '<pre': 0.26; 'object': 0.26; 'perform':
0.26; 'solution.': 0.26; 'environment': 0.29; 'sfxlen:2': 0.31;
'question': 0.32; 'retrieve': 0.32; 'message-id:@mail.gmail.com':
0.32; 'but': 0.32; 'received:google.com': 0.34; 'following': 0.35;
'from:addr:gmail.com': 0.35; 'target': 0.36; 'using': 0.37;
'still': 0.40; 'both': 0.40; 'should': 0.40; 'days': 0.62; 'skip:m
20': 0.63; 'between': 0.63; '8bit%:9': 0.64; 'skip:t 20': 0.66;
'skip:e 20': 0.67; 'right': 0.68; 'exactly': 0.68; 'url:index':
0.68; 'order': 0.69; 'times': 0.69; 'below': 0.69; 'skip:a 40':
0.70; '<span': 0.76; 'spent': 0.81; 'magnificent': 0.84; 'nao':
0.84; 'robot': 0.84; 'skip:s 280': 0.84; 'subject: \n ': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1719060140; x=1719664940; darn=python.org;
h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
:date:message-id:reply-to;
bh=MGQevOTLFnSMFFavC2XYvkvY33VxjEcw4VYnx/5gG08=;
b=nsj8u3/XdhpDlXzAwm+yCZM61hDn3TrWVRMmxNELGBHpuNoCZluqrGA9x0aOfHYR8Z
zOel2vcdP4n16yLlpV/Oq29Mp5HDA7QIEQAmsxpdOyai6+Sxy98gFfL1J6CiI08sDiFm
gKinac+bBZJMRisN/qqgIPKQC3yiDQCiytfgrWwrtfPAbzOdvvIYK0Ug4I8i5HWQXEmQ
sHKLn4k9EXCi7UX9HoSDrpjRFQ+E4j4dpdNGFR3eEh2qe2hVPSIT22IJB77p4m8Z6t9W
w8l9B2tKfFXsJuvNY3sBy05zQskXNf5u9j0H6LZ1/TbCbrL93OpW+yZJnE6llcckRNrU
VKvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1719060140; x=1719664940;
h=to:subject:message-id:date:from:mime-version:x-gm-message-state
:from:to:cc:subject:date:message-id:reply-to;
bh=MGQevOTLFnSMFFavC2XYvkvY33VxjEcw4VYnx/5gG08=;
b=ZX0G/GXSAuHyyyhn2C78lJH6fzRQb8/cU/WddLgccK2NV9SpDZknI56vENbzwxioZE
Z0g9JQr01AfcldoVb8z+wrkT5m9LrZJHmSDl+5fEIL2uUBnN0R76EO7HGqt3j7UxmgGe
vvQKgKkpOa49CH0I2pi+9Xi5ekOZ/yt5C/U0Pv9DdIDIPv2psJtrElMAiKxXKzUtUSoN
M7ZQV+wtv+zxBuiXU9vVpcQ7Ufpa8iLsrREbqahpYwRbFO3WYFUTjNTmJRQ1D1eFKWCL
1ad0rshUXSouI4Zool776MHpTiM8P7yElavlb2EZbxCvuNuneWBA6ewdJwFgFoV2Iy2Q
4Wew==
X-Forwarded-Encrypted: i=1;
AJvYcCUNeX4rY0WqaTXZukR+By7qRsqTG1quxjRkM2YaGlHIXj0nQpZwe85ZfUEe1L1e8hB4W0nrsP9ErfwoV//Gb9JV
X-Gm-Message-State: AOJu0Yy/p//RTVQwMDUe8w2rtjfPL1FgdKXApyS/0QQzz8f6KcOgL04d
UfojslRlTZlx4T4wz/qtVpzaGzRmSJVA1LOcbxuUrmd+SPTET3BAYGdAQnhg10YJe7kB0Gyi1xd
+AI/qQxUsSwiTZZWMvAlA8DughEcMv2en8Kc=
X-Google-Smtp-Source: AGHT+IEzhlZC7/F3GPvDp8ng9Jwof7m7mZp0qwOVdfhAev2gosgEmTpu+D5LkuI7VlR9p3d0vAc1MLoHKP92gum2hEA=
X-Received: by 2002:a17:90a:bf0a:b0:2c4:aab0:f8b with SMTP id
98e67ed59e1d1-2c7b5c8fd6cmr10481287a91.22.1719060139937; Sat, 22 Jun 2024
05:42:19 -0700 (PDT)
X-Mailman-Approved-At: Sun, 23 Jun 2024 18:19:31 -0400
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
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: <CAGJtH9SdZvsrgLHnC+NSmj9P9ykG8qXj2JXk27ai=HAYaam-GQ@mail.gmail.com>
View all headers

Hello to all of this magnificent community!

I have this problem I had already spent a few days on and still can't
figure out a proper solution.

So, given the x,y,z coordinates of a target object and the offset x,y,z of
arms of a robot, what is a good algorithm to perform to grab the object
between the hands (either from both sides or from below all using both
hands).

Specifically, my problem is applied to a NAO robot environment where I
retrieve a target object coordinates using the following code:

tracker_service= session.service("ALTracker")
xyz_pos = tracker_service.getTargetPosition(motion.FRAME_TORSO)

src:
http://doc.aldebaran.com/2-8/naoqi/motion/control-cartesian.html#motion-cartesian-effectors

Then I get to move the right arm towards nearby the object using the
following code:

effector = "RArm"

frame = motion.FRAME_TORSO
effector_offset =
almath.Transform(self.motion.getTransform(effector, frame, False))
effector_init_3d_position = almath.position3DFromTransform(
effector_offset)

target_3d_position = almath.Position3D(target_position)
move_3d = target_3d_position - effector_init_3d_position
moveTransform = almath.Transform.fromPosition(move_3d.x,
move_3d.y, move_3d.z)
target_transformer_list = list(moveTransform.toVector())
times = [2.0]
axis_mask_list = motion.AXIS_MASK_VEL
self.motion.transformInterpolations(effector, frame,
target_transformer_list, axis_mask_list, times).

src: http://doc.aldebaran.com/1-14/dev/python/examples/almath/index.html?highlight=offset
This question is specific to NAO environment but in general how to go
about this task? what is a most common algorithm used in this case? Do
I have to also get the side of the object in order to know where
exactly the arms should be placed?

1

rocksolid light 0.9.8
clearnet tor