Additional argument in Rotation function

Hello,
I am using orekit with python. For my caclulation I need the rotation function from
org.hipparchus.geometry.euclidean.threed

I found examples for using it in java as follows:

Rotation rotation = new Rotation(q0, q1, q2, q3, true);

However using this in python gives me a missing argument error.
Looking into the class I found the following:
def init(self, double: float, double2: float, double3: float, double4: float, boolean: bool):

Is it possible to use this in python without the ‘self’ argument? Only handing over the quaternions like in the java example?
Thank you so much.

Hi,

Are you saying that:
Rotation(q0, q1, q2, q3, True)
Does not work in Python?
Do you have import Rotation after your from org… ?

Best,
Romain

It should work, but it asks me for more arguments than in this example:

Rotation(q0, q1, q2, q3, True).

Looking at the initialization function of this class (by holding shift and clicking on the function), the first argument is stated as ‘self’, followed by the ones of the example, as described here:

def **init** (self, double: float, double2: float, double3: float, double4: float, boolean: bool):

I wouldn’t know what I have to pass as an argument for the ‘self’ part.
So is there a way to make this function work as in the example ‘only’ by passing the 4 quaternions and the bool value?

self is always the first argument in the declaration of a constructor in Python. You don’t need to pass anything, it’s implicit by using the name of the class.
Your argument error is more likely to come from the type of q0, ..., q3
Are they float (and not Numpy’s float64)? Cast them to be sure.

Romain.

Hi @Serrof , thank you so much for the explanation with the self argument. It helped me a lot with debbuging my code.
At the end the bool value was not handed over correctly as booI. I wasn’t able to see this because it only gave me the standard argument error.
Thank you for your help!

Hello @EM1996 ! Could you share snippets of your python code with the properly working rotation part? I also have some troubles on implementing this basic task using python wrapper. Thank you!