I have tried using joycon-python to get the motion values of the left Joy-Con's accelerometer and gyroscope. However, I need specifically the pitch to determine the position of the Toy-Con Pedal (link to the Vehicle Kit), and the calculated position cannot drift a lot from the actual position. Because sensor fusion requires an additional magnetometer, how can I do so without the magnetometer while minimizing drift, and being able to detect the Pedal's position even when the Pedal is actively moving down or up, since Nintendo Labo was able to do it?
The function I need is:
def get_pedal_angle(joycon_no): #get the pitch of the joycon with number joycon_no
#code to calculate pedal_angle from acceleration and gyro...
pedal_angle=45 #decreases as pedal is pressed further, this represents the pitch of the Joy-Con. It should still accurately detect the pitch even when the pedal is actively moving down or up.
return pedal_angle
Let's say you are pressing the gas pedal in your car. Your foot does not go straight from 0 to whatever position you want instantly (0 seconds), it takes time (even if its a few centiseconds). During that period of time is what i mean by actively changing, ie the pedal is actively moving thus changing the pitch of the Joy-Con. Plus, I don't know the actual way how Nintendo Labo senses pedal position accurately.