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

Liste des GroupesRevenir à cl python 
Sujet : How to go about a simple object grabbing in python (given coordinates of arms and objects)
De : mk1853387 (at) *nospam* gmail.com (marc nicole)
Groupes : comp.lang.python
Date : 22. Jun 2024, 14:41:47
Autres entêtes
Message-ID : <mailman.161.1719181173.2909.python-list@python.org>
References : 1
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?

Date Sujet#  Auteur
22 Jun 24 o How to go about a simple object grabbing in python (given coordinates of arms and objects)1marc nicole

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal