Giter Site home page Giter Site logo

Comments (9)

Phylliade avatar Phylliade commented on June 25, 2024

Hello,

Do you know the value of your origin_rotation?

from ikpy.

FlachyJoe avatar FlachyJoe commented on June 25, 2024

Basically I only know objects placement in global coordinates. I understood a link origin_rotation is defined in local coordinates so no: I don't know each link origin_rotation.
An other question torments me: is axis defined in local coordinates too ?

EDIT: this is an example of placements. FreeCAD represents rotation in ZYX convention and degrees but I can get quaternions.
Capture d’écran_2022-01-13_13-58-02

from ikpy.

Phylliade avatar Phylliade commented on June 25, 2024

Ok I get it.

In this case you don't care about origin_translation or origin_rotation.
These are positional attributes of your link at the origin of the robot (e.g. the table)

In your case, you want to position the other links of the robot and that's easy:

  1. Create a robot using a chain of links, indépendant of the position
  2. Apply inverse kinematics on the robot. In order to do so, you effectively need to transform your Pos+Yaw/Pitch/Roll coordinates into a transformation matrix. This can be done easily using the following function: https://github.com/Phylliade/ikpy/blob/master/src/ikpy/utils/geometry.py#L56

from ikpy.

FlachyJoe avatar FlachyJoe commented on June 25, 2024
  1. But I can't create a chain of links with all null origins and rotations, it has no sense ! As I only know the objects global placement and relative rotation axis I have to compute the links data from them.
  2. I already use inverse kinematics to set the robot in this position but it only works from an aligned state. If I have a robot in the state shown I don't know how to put it back (think I can't save the chain data).

from ikpy.

Phylliade avatar Phylliade commented on June 25, 2024

Actually links and chains are just abstract representations, they don't require any positions or orientation to work

For example, we create here a chain that looks like yours without any position or orientation

The orientation and positions appear when doing forward and inverse kinematics

from ikpy.

FlachyJoe avatar FlachyJoe commented on June 25, 2024

without any position or orientation

I'm not agree as you use ikpy/resources/poppy_ergo.URDF in which we find such data:
<link name="base_link"> <inertial> <origin xyz="-0.00619082439227047 1.87708924758407E-10 0.0111397401808713" rpy="0 0 0" />
parsed by

origin = joint.find("origin")

so origin_translation and origin_orientation are initialized.

I still argue that building a string without these values makes no sense. Firstly because joint angle obviously depends on link length.

from ikpy.

Phylliade avatar Phylliade commented on June 25, 2024

Yep you're right, that's just a misanderstanding.

To recap:

  • You have on one hand your chains's geometry, where each link has a defined geometry, such as <link name="base_link"><origin xyz="-0.00619082439227047 1.87708924758407E-10 0.0111397401808713" rpy="0 0 0" /> That's all you need to create a chain. It is something you bring by yourself when using IKPy
  • You move your chain using actuators positions (e.g. angles), using IKPy forward and inverse kinematics functions
  • And get final positions

From what i get of your issue is that you want to infer chain geometry from final positions.
The issue is that it's only one particular final position, and you won't be able to infer rotation axes from the final positions (you can infer positions and orientations, but not the rotation axes).

Unfortunately IKPy won't help you here.
The simplest solution by far is to ask FreeCAD to export your chain's geometry, for example to export a URDF file, as in https://answers.ros.org/question/355109/create-a-urdfxacro-file-from-model-of-freecad/

With this URDF file, you can use IKPy on it, as described in https://github.com/Phylliade/ikpy/blob/master/tutorials/Quickstart.ipynb

from ikpy.

FlachyJoe avatar FlachyJoe commented on June 25, 2024

Solved.
FreeCAD has placement calculus implemented and I found how to get origin relative to another.

[…]
	URDFLink(
		"Arm3",
		(obj('Arm2').Placement.inverse()*obj('Arm3').Placement).Base, # origin translation
		rpy((obj('Arm2').Placement.inverse()*obj('Arm3').Placement).Rotation), # origin rotation
		[0, 1, 0], # rotation axis
		None,  # translation axis
		(None, None),  # bounds
	)
[…]

from ikpy.

Phylliade avatar Phylliade commented on June 25, 2024

Great!

from ikpy.

Related Issues (20)

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.